Hi,
I am working on Livesite 7.1 on linux.
I have created a java program where I am using code similar to following to retrieve content from LSCS repository.
Factory factory = new Factory();
Client client = factory.getClient(properties);
client.setProject("path to project");
Document doc = client.getDocumentById("document id");
But, when I run this code, it gives me following error.
Error:
Exception in thread "main" java.lang.NoSuchMethodError: org.json.JSONObject.getNames(Lorg/json/JSONObject

[Ljava/lang/String;
at com.interwoven.wcm.lscs.impl.JSONExtractionUtils.convertToMetadataMap(JSONExtractionUtils.java:64)
at com.interwoven.wcm.lscs.impl.JSONExtractionUtils.extractDocumentFacets(JSONExtractionUtils.java:116)
at com.interwoven.wcm.lscs.impl.ClientImpl.getDocumentById(ClientImpl.java:210)
at com.geam.lscsJavaApi.main(lscsJavaApi.java:36)
---------------------------------------------------
The url that is getting called is like below:
http://server name : port/lscs/v1/document/id/document id/$?project= path to project &format=json
Can anyone post the solution to this issue?
This is a standalone java class that uses lscsclient to query lscs repository.
Want to check whether setting format=xml will resolve this issue.
But, I did not find any method in Client class to set the format of the response.
'format=json' is assumed and gets appended automatically,which I am not able to change to 'format=xml'.
Do I need to set it in the properties where I am setting details like host, port, context, etc?
e.g. I am setting properties as below:
Properties properties = new Properties();
properties.setProperty("lscs.transport","http");
properties.setProperty("lscs.host","server name");
properties.setProperty("lscs.port","port");
properties.setProperty("lscs.context.path","lscs");
properties.setProperty("lscs.version","v1");
Is there any property for format like lscs.format?
When I try some urls to query LSCS repository directly from browser, it works with both formats: xml and json.
But, when using lscsclient gives json error.
pl. suggest.
Regards,
Gauri