Rhapsody Java API to get the URL of a remote artifact element - java

I am trying to create a OSLCLink using this Java API:
void createOSLCLink(java.lang.String type, java.lang.String purl)
ex: cellElement.createOSLCLink("TRACE", purl );
The problem is I cannot find any solution to get the "purl" - URL of the remote element.
Thank you.

Related

Json Error in Eclipse stating Expected value at 1:0

I have a web application built on Spring Boot and running on a Tomcat 8.5 server. I am trying to create a json object in Eclipse which contains the information about the apis. But it throws an error stating: "Expected value at 1:0" The error gets resolved when I remove the object declaration.
Here the code to my url.json file.
URL = {
"FETCH_ALL_USER":"http://localhost:8080/rest/info/",
"SEND_LEAVE_REQUEST":"http://localhost:8080/rest/find"
}
Why do I get this error and how do I solve this.
We need to enclose the json property in double quotes. save and re-validate the file.
Visit -> JSON Parse Error: Expecting 'STRING'
solved this issue for me.

TFS - Java SDK : How to create a child relation link type on Workitems

I am currently making my way through the examples given by Microsoft in the
TFS 2012 SDK for Java.
Through the example AddRelatedLinkToWorkItem in the snippets I am able to create a link between two workitems.
This is always a RelatedLink.
But I could not find out how to create a Child <-> Parent-Relationship between two WorkItems.
I found
newRelatedLink(WorkItem sourceWorkItem, WorkItem targetWorkItem, int linkTypeId, java.lang.String comment, boolean readOnly)
in the LinkFactory-Class.
I assume with the third parameter: linkTypeId
I am able to change the link to a child-parent-ralation.
But I could not find any information about linkTypeId.
Any help would be appreciated...
Jogi
Following is the linkTypeID I get from .NET TFS API. It should the same with Java SDK. You can try with it.

Restlet : Unable to find a converter for this representation : [application/json,UTF-8]

I have researched this quite heavily but have been unable to find a solution. I have created the simplest unit test to fetch a single entity but am still receiving the "Unable to find converter" exception. I have included the org.restlet.ext.servlet.jar,org.json.jar and org.restlet.ext.net.jar in my class path. I am also able to see the json returned and have been able to print using the cr.get(MediaType.APPLICATION_JSON) method.
ClientResource cr = new ClientResource("http://localhost:8888/r/establishment/29");
Establishment est = cr.get(Establishment.class);
System.out.println("Establishment name is " + est.getName());
I am using restlet-gae-2.1rc6 on GAE vs 1.7.1
You need to register a converter. Example:
Engine.getInstance().getRegisteredConverters().add(new JacksonConverter());
See a question with the same solution but a different problem: Android to gae restlet example doesn't work on the Android side
I found the solution here: https://stackoverflow.com/a/5205993/435605

Edit Spreadsheets at Google Drive with Gdata (Java)

I am trying to edit a public spreadsheet (key = 0Av4aUydPYoNAdHV2MnRaSFhrY0NSZnNOS28yTlhRTVE) on my google_drive using Java and gdata api, but without success.
I change the url from https://spreadsheets.google.com/feeds/worksheets/key/private/full to https://spreadsheets.google.com/feeds/worksheets/0Av4aUydPYoNAdHV2MnRaSFhrY0NSZnNOS28yTlhRTVE/private/full , but returns:
Exception in thread "main" com.google.gdata.util.InvalidEntryException: Bad Request
What does this mean?
The URL you are using is invalid, the correct one has /private/ instead of /public/, as in:
https://spreadsheets.google.com/feeds/worksheets/0Av4aUydPYoNAdHV2MnRaSFhrY0NSZnNOS28yTlhRTVE/private/full

Application name on Java GAE

There is any way to get by code the application name on Java GAE?
I need to configure some objects according with my application instance (production or development), and I want to build a automatic way.
String ID = SystemProperty.applicationId.get();
You can find more details at the following URL
https://developers.google.com/appengine/docs/java/#Java_The_environment
Try using App Identity
Calling:
String serviceAccountName = AppIdentityServiceFactory.getAppIdentityService().getServiceAccountName();
The serviceAccountName will be set as <app name>#appspot.gserviceaccount.com
This gives you the app id:
ApiProxy.getCurrentEnvironment().getAppId()
https://cloud.google.com/appengine/docs/java/appidentity/?csw=1#Java_Identifying_itself

Categories

Resources