How to create outlook task request in java - java

I would like to know how to create outlook "Task Request" in java.

Here is another Java lib: http://moonrug.com/

I have used an earlier version of this API in my previous job. It is a commercial product.
Trying to code purely from memory and looking at the examples provided by the Moyosoft website. I have no means to compile or execute this. But you will get an idea on how to proceed
Outlook outlookApplication = new Outlook();
// Get the Task folder where the task has to be created
OutlookFolder taskFolder= outlookApplication.getDefaultFolder(FolderType.TASKS);
//Creating a new Task
OutlookTask task = new OutlookTask (taskFolder);
task.setSubject("New Java Task"); //Name of the Task
task.setStart(new Date()); // creating task with current server time
task.setStatus(TaskStatus.NOT_STARTED); //task has not yet started
task.setOwner("owner's_email#example.com"); // I don't whether this is name or email.
task.setReminderTime(new Date()) //set a reminder time, set appropriately
task.setDueDate(new Date()); //deadline for the task completion, set appropriately
// and so one.
The following APIs should help you.
http://www.moyosoft.com/joc/javadocplus/?docclass=com.moyosoft.connector.ms.outlook.task.OutlookTaskRequest
http://www.moyosoft.com/joc/javadocplus/?docclass=com.moyosoft.connector.ms.outlook.task.OutlookTask
The complete java docs can be found here. It is not very well documented but the API names are self explanatory.
http://www.moyosoft.com/joc/javadocplus/
Their site also have a few code examples which was helpful in figuring it out.
I hope this is helpful. I do not have access to these APIs now, therefore I have no way to provide code examples.

Related

Create AEM packages via code

Is there a way to create an AEM package via a java code ?
We need to package some content every night via a service run by a cron job.
I checked online and it seems to be possible using a curl command. But either way, I'd need this done via a daily service running a java code.
Please refer to some of the links given below :
1)https://helpx.adobe.com/experience-manager/using/dynamic_aem_packages.html
2)http://cq5experiences.blogspot.in/2014/01/creating-packages-using-java-code-in-cq5.html
The main code goes something like this :
final JcrPackage jcrPackage = getPackageHelper().createPackageFromPathFilterSets(packageResources,
request.getResourceResolver().adaptTo(Session.class),
properties.get(PACKAGE_GROUP_NAME, getDefaultPackageGroupName()),
properties.get(PACKAGE_NAME, getDefaultPackageName()),
properties.get(PACKAGE_VERSION, DEFAULT_PACKAGE_VERSION),
PackageHelper.ConflictResolution.valueOf(properties.get(CONFLICT_RESOLUTION,
PackageHelper.ConflictResolution.IncrementVersion.toString())),
packageDefinitionProperties
);
So first of all you can create a scheduler and in the scheduler's run method you can write the logic to package the required filter paths .
Hoping this is helpful for you.

Extract JobID etc from Hadoop Job

I am running a Hadoop jar file inside a cluster. From the documentation, I know that Hadoop manages JobID, Start time etc. Is it possible to get the parameters so that we can show them on our web interface just to let user know how much time the job will consume (e.g. estimated duration)?
All the details shown in the Jobtracker UI can be obtained easily by using the APIs provided.
Use jobclient API refer : https://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapred/JobClient.html
and Jobstatus api refer : https://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapred/JobStatus.html
Using the combination of jobclient and jobstatus(jobsToComplete(), getAllJobs() ) you can retrieve the JobId . Once you get the jobId you can easily get all the other details by just calling the functions in the API.

ProgramCallDocument connecting to AS400 from Groovy Hangs

This question is specifically related to the JT400 class ProgramCallDocument, with it's method callProgram(String ProgramName)
I've tried wapping the call in a try/catch - but it's not throwing an exception, the debugger goes into the callProgram method, and just sits there indefinitely.
A small amount of specific information about the API is available here:
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.toolbox.doc/rzahhxpcmlusing.htm
Here's the code that I'm running:
AS400 as400System = AS400Factory.getAS400System()
ProgramCallDocument programCallDocument = new ProgramCallDocument(as400System, "com.sample.xpcml.Sample.xpcml")
programCallDocument.setStringValue("sampleProgramName.value", sampleValue)
Boolean didProgramCallDocumentRunSuccessfullyOnTheAS400 = programCallDocument.callProgram("sampleProgramName")
The last line of that snippet is the one that just sits there. I left out the try/catch for brevity.
The XPCML file that the ProgramCallDocument constructor uses is just a proprietary XML format that IBM uses for specifying the parameter lengths and types for a program call. I can come back and add it in if it would be helpful, but the ProgramCallDocument constructor runs validation on the XML, and it didn't come up with any validation errors. I'm not familiar with JT400, or how it does Program Calls, so any assistance would be wonderful.
As a further note, doing some more digging on a related issue today I also found this SO post:
Monitor and handle MSGW messages on a job on an IBM i-series (AS/400) from Java
I think it's relevant to this question, because it's about ways to trap MSGW status on the Java/Groovy side.
It's very likely the called program went into a MSGW status (error).
Check WRKACTJOB JOB(QZRCSRVS) to find the program call job and see the status as well as review the job log.
It may be easier to call a native program using the CommandCall class or as a JDBC stored procedure.
Here's an example of the CommandCall usage in Groovy:
sys = AS400Factory.AS400System
cmd = new CommandCall(sys)
if (!cmd.run "CALL MYLIB.MYPGM PARM('${sampleValue}')") {
println cmd.messageList
}

AS400 Job's Thread details

I've already been retrieved details of a specific AS/400 job by its job number. I have a problem. I want to get that specific jobs thread detail. Some jobs have multi threading. I need to get specific job's list of multi threads and thread details. I'm checked jt400 doc for finding some class for it. But I'm failing to find :(
Thank in Advance!
JobList jobList = new JobList(System);
jobList.clearJobSelectionCriteria();
jobList.addJobSelectionCriteria(JobList.SELECTION_JOB_NUMBER, jobNumber);
Enumeration list = jobList.getJobs();
while (list.hasMoreElements()) {
Job j = (Job) list.nextElement();
System.out.println(j.getName());
System.out.println(j.getStatus());
System.out.println(j.getOutputQueue());
}
The API you're looking for is QWCOLTHD. JTOpen 8.1 was recently released and I don't see the QWCOLTHD API implemented.
It looks like you either need to email the developers and ask for this API, or write the implementation yourself. JTOpen is open source; you can get the source code and see how similar APIs are implemented and then write the appropriate classes for QWCOLTHD.

XEP-0080 User Location in Smack Library

I would like to create a simple XMPP client in java that shares his location (XEP-0080) with other clients.
I already know I can use the smack library for XMPP and that it supports PEP, which is needed for XEP-0080.
Does anyone have an example how to implement this or any pointers, i don't find anything using google.
thanks in advance.
Kristof's right, the doc's are sparse - but they are getting better. There is a good, albeit hard to find, set of docs on extensions though. The PubSub one is at http://www.igniterealtime.org/fisheye/browse/~raw,r=11613/svn-org/smack/trunk/documentation/extensions/pubsub.html.
After going the from scratch custom IQ Provider route with an extension I found it was easier to do it using the managers as much as possible. The developers that wrote the managers have abstracted away a lot of the pain points.
Example (modified-for-geoloc version of one rcollier wrote on the Smack forum):
ConfigureForm form = new ConfigureForm(FormType.submit);
form.setPersistentItems(false);
form.setDeliverPayloads(true);
form.setAccessModel(AccessModel.open);
PubSubManager manager
= new PubSubManager(connection, "pubsub.communitivity.com");
Node myNode = manager.createNode("http://jabber.org/protocol/geoloc", form);
StringBuilder body = new StringBuilder(); //ws for readability
body.append("<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>");
body.append(" <country>Italy</country>");
body.append(" <lat>45.44</lat>");
body.append(" <locality>Venice</locality>");
body.append(" <lon>12.33</lon>");
body.append(" <accuracy>20</accuracy>");
body.append("</geoloc>");
SimplePayload payload = new SimplePayload(
"geoloc",
"http://jabber.org/protocol/geoloc",
body.toString());
String itemId = "zz234";
Item<SimplePayload> item = new Item<SimplePayload>(itemId, payload);
// Required to recieve the events being published
myNode.addItemEventListener(myEventHandler);
// Publish item
myNode.publish(item);
Or at least that's the hard way :). Just remembered there's a PEPManager now...
PEPProvider pepProvider = new PEPProvider();
pepProvider.registerPEPParserExtension(
"http://jabber.org/protocol/tune", new TuneProvider());
ProviderManager.getInstance().addExtensionProvider(
"event",
"http://jabber.org/protocol/pubsub#event", pepProvider);
Tune tune = new Tune("jeff", "1", "CD", "My Title", "My Track");
pepManager.publish(tune);
You'd need to write the GeoLocProvider and GeoLoc classes.
I covered a pure PEP based approach as an alternative method in detail for Android here: https://stackoverflow.com/a/26719158/406920.
This will be very close to what you'd need to do with regular Smack.
Take a look at the existing code for implementations of other extensions. This will be your best example of how to develop with the current library. Unfortunately, there is no developers guide that I know of, so I just poked around to understand some of the basics myself until I felt comfortable with the environment. Hint: Use the providers extension facility to add custom providers for the extension specific stanzas.
You can ask questions on the developer forum for Smack, and contribute your code back to the project from here as well. If you produce an implementation of this extension, then you could potentially get commit privileges yourself if you want it.

Categories

Resources