Out of Office Agent Lotus Domino - java

I need to Change Subject Of Out Of Office Message through Java. At the same time I wish to enable Out of Office through java.
I tried something by myself like this :
Document dc = db.getProfileDocument("OutOfOfficeProfile", s.getUserName());
Vector vc = dc.getItems();
for(int i=0;i<vc.size();i++){
Item it = (Item) vc.get(i);
System.out.println(it.toString()+":::::::>>>>>>"
+ dc.getItemValueString(it.toString()));
}
I got the Item names as :
$Name:::::::>>>>>>$profile_018outofofficeprofile_cn=sachin jain/o=tcsapp
$UpdatedBy:::::::>>>>>>CN=Sachin Jain/O=TCSAPP
$NoPurge:::::::>>>>>>
$ConflictAction:::::::>>>>>>2
I had searched for it a lot. I came across OutOfOffice Agent though Domino Designer. But I don't know how I can change the Subject and Body Of OOO Message and how can I enable it through Java?

The OutOfOfficeProfile profile document contains all necessary data for the OutOfOffice agent to run. So if you change data in this profile document, the changes will be reflected when the OutOfOffice agent runs.
I suggest that you look at the OutOfOffice agent and see what fields it uses - and thereby what fields you need to modify to change the subject for the Out Of Office mail. A quick look in the agent tells me that the field GeneralSubject is used for the general OoO messages while the field SpecialSubject is used for the special OoO messages.
With Java you can change the profile data using the Document class (as you have alrady started to use). Remember to call dc.Save() when you change the NotesDocument fields.
With Java you can enable the agent using the Agent class and agent.setEnabled(true);.
Look in the Domino Designer Help database for more information on the classes, properties and methods.

Related

Azure Function (Java) add attribute to CustomDimensions

I am desperatly searching on how to add a new attribute to the custom dimensions collection in the request table of the log analytics in the context of a Java function.
I know in C# you can do it using Activity and ITelementryInitializer but for Java I can not get it to work.
Any hints are appreciated. ;)
Azure Function (Java) add attribute to CustomDimensions
In Java, we have the Span attributes concept for adding the optional (extra) fields to the App Insights Schema that populates with the customDimensions in the form of various tables such as traces, exceptions, dependencies.
For that, one of the dependencies is required which is opentelemetry-api-1.jar.
AttributeKey newAttributeKey= AttributeKey.stringKey("resourcecustomDimension"); Span.current().setAttribute(newAttributeKey, "customDimValue");
This brings us the custom attributes for the custom dimensions that will be added to the Telemetry data.
Refer to this MS Doc for more information on adding the attributes to the customDimensions and found the GitHub issue 13310 regarding the user seeking for the Java Code on ITelemetryInitializer where the sample code on it provided by #dhaval24 user.

Wikidata Toolkit: Is it possible to access properties of entities?

First of all, I want to clarify that my experience working with wikidata is very limited, so feel free to correct if any of my terminology is wrong.
I've been playing with wikidata toolkit, more specifically their wdtk-wikibaseapi. This allows you to get entity information and their different properties as such:
WikibaseDataFetcher wbdf = WikibaseDataFetcher.getWikidataDataFetcher();
EntityDocument q42 = wbdf.getEntityDocument("Q42");
List<StatementGroup> groups = ((ItemDocument) q42).getStatementGroups();
for(StatementGroup g : groups) {
List<Statement> statements = g.getStatements();
for(Statement s : statements) {
System.out.println(s.getMainSnak().getPropertyId().getId());
System.out.println(s.getValue());
}
}
The above would get me the entity Douglas Adams and all the properties under his site: https://www.wikidata.org/wiki/Q42
Now wikidata toolkit has the ability to load and process dump files, meaning you can download a dump to your local and process it using their DumpProcessingController class under the wdtk-dumpfiles library. I'm just not sure what is meant by processing.
Can anyone explain me what does processing mean in this context?
Can you do something similar to what was done using wdtk-wikibaseapi in the example above but using a local dump file and wdtk-dumpfiles i.e. get an entity and it's respective properties? I don't want to get the info from online source, only from the dump (offline).
If this is not possible using wikidata-toolkit, could you point me to somewhere that can get me started on getting entities and their properties from a dump file for wikidata please? I am using Java.

Programmatically set signatures in Outlook client using JAVA

I want to set signatures for multiple address in outlook client application. I read concepts using VBA and other scripts. But I want to do it in Java. I have already created the html signature files. I can use AD to pull user information but I don't know how to connect it with Outlook using Java. Can someone help me with this?
Thanks in advance.
Outlook Object Model does not expose signatures at all.
On the Outlook account level, the name of the signature is stored in the account profile data accessible through the IOlkAccountManager Extended MAPI interface. Since that interface is Extended MAPI, it can only be accessed using C++ or Delphi. You can see the interface and its data in OutlookSpy (I am its author) if you click the IOlkAccountManager button.:
If using Redemption is an option (I am also its author), you can use its RDOAccount object (accessible in any language, including Java). New message signature name is stored in the 0x0016001F property, reply signature is in 0x0017001F (can be read or set using RDOAccount.Fields[]).
You can also use the RDOAccount.ReplySignature and NewSignature properties.

How to set Record Selection Formula on Crystal Reports java

How do you create/set Record Selection Formula programatically on crystal reports using java? I tried searching on the internet but the only option is through IFilter which requires a Crystal Report Server. My program only uses the JRC library. Also this is a java desktop application using swing.
It may be a bit late, but maybe this is useful for someone:
reportClientDoc.getDataDefController().getRecordFilterController().setFormulaText("your record selection formula here");
I was doing some research about this and noticed that there are 3 methods with which you can do this:
Using the IFilter interface as shown in this example provided by SAP
// Set the filter string to be used as the Record Filter
String freeEditingFilter = "{Customer.Country} = 'Canada'";
// Retrieve the record filter for the Data Definition Controller
IFilter iFilter = clientDoc.getDataDefController().getDataDefinition().getRecordFilter();
// Set the filter to free editing text filter string
iFilter.setFreeEditingText(freeEditingFilter);
// Modify the filter through the Record Filter Controller to the report
clientDoc.getDataDefController().getRecordFilterController().modify(iFilter);
I am using the JRC only without a Crystal Report Server and the above example worked for me.
As Francisco said in his answer, using the setFormulaText method:
clientDoc.getDataDefController().getRecordFilterController().setFormulaText("{Customer.Country} = 'Canada'");
Using parameters. Parameters can be passed to the report using code (you can use the addDiscreteParameterValue function in the helper class) or else they can be filled in by the user during runtime. I chose not to opt for this option because they can not be set to optional
If you want to create a crystal report of your program, you need another jar file of software.
You can create your program in NetBeans IDE and link your IDE with IReport software which is used in NetBeans for creating Reporting in java.
You get many example from internet about this.

How do I overwrite the URL in an IE address bar using RFT?

I need to execute the following steps:
1. Start an IE browser window and open a URL (Done using StartBrowser(final string URL)
2. Start a session (done by logging in)
3. Now, I want to enter a different URL in the same browser window which has the same session.
My question is related to Step 3. How can I overwrite the URL in the existing IE window.
Note: I am using a keyword driven framework written in java.
From the IBM RFT online help: You can use the loadURL() method of the browser object.
If you do not have the browser object already 'learned' into your object map, just record a click on the browser toolbar. Then you can modify that line to be Browser_htmlBrowser().loadURL("http://stackoverflow.com");
Thanks Tom. I agree that loadURL has the implementation to do what I need.
There is one more aspect that may interest others looking at this question, i.e. the way the appropriate browser object is captured. Obviously the easist way is to use the RFT record and click way, and use the appropriate recognition properties or the other way is to implement it is find the existing browseron the fly when the method is called irrespective of recognistion properties etc which may be more useful for some scenarios or frameworks, like it is done below.
RootTestObject root = getRootTestObject();
TestObject[] testobj = root.find(atDescendant(".class", "Html.HtmlBrowser"));
BrowserTestObject bto;
bto = new BrowserTestObject(testobj[0]);
bto.loadUrl(curParamOne);

Categories

Resources