Hi,
I did some tests with Java client using new OpenKM-5.0.2 on PostgreSQL database. Test scenario:
- first I upload txt document, then by web UI setup default property groups (Technology, Consulting - screenshots in attachment),
- after that I create all classes and sample Java client (using information from wiki), and simple test to get all data from property groups:
Code: Select allFormElementComplexArray propList = pgm.getProperties(token, "/okm:root/test.txt", "okg:technology");
for (FormElementComplex f : propList.getItem()) {
System.out.println("---------Technology----------");
System.out.println("Label: " + f.getLabel() + "\nName: " + f.getName()
+ "\nHeight: " + f.getHeight() + "\nWidth: " + f.getWidth()
+ " \nValue: " + f.getValue()+"\nOptions:" + f.getOptions()
+ "\nType:" + f.getType());
if (!f.getOptions().isEmpty()) {
System.out.println("----Options----");
for (Option o : f.getOptions()) {
System.out.println("Label: "+o.getLabel()+"\nSelected: "+o.isSelected());
}
}
}
Same code for consulting.
And results:
---------Technology----------
Label: Type
Name: okp:technology.type
Height: 25px
Width: 150px
Value: null
Options:[com.openkm.ws.client.Option@1e1dadb, com.openkm.ws.client.Option@e79839, com.openkm.ws.client.Option@bac9b9]
Type:null
----Options----
Label: t1
Selected: true
Label: t2
Selected: false
Label: t3
Selected: false
---------Technology----------
Label: Language
Name: okp:technology.language
Height: 25px
Width: 150px
Value: null
Options:[com.openkm.ws.client.Option@111b910, com.openkm.ws.client.Option@8ceeea, com.openkm.ws.client.Option@995a79]
Type:null
----Options----
Label: Java
Selected: true
Label: Python
Selected: false
Label: PHP
Selected: false
---------Technology----------
Label: Comment
Name: okp:technology.comment
Height: 25px
Width: 100px
Value: asd
Options:[]
Type:text
---------Technology----------
Label: Description
Name: okp:technology.description
Height: 100px
Width: 300px
Value: description
Options:[]
Type:null
---------Technology----------
Label: link
Name: okp:technology.link
Height: 25px
Width: 100px
Value:
Options:[]
Type:link
---------Consulting----------
Label: Name
Name: okp:consulting.name
Height: 25px
Width: 100px
Value: name
Options:[]
Type:text
---------Consulting----------
Label: Name
Name: okp:consulting.date
Height: 25px
Width: 100px
Value: 2011-02-08T00:00:00.000+01:00
Options:[]
Type:date
---------Consulting----------
Label: Important
Name: okp:consulting.important
Height: 25px
Width: 100px
Value: true
Options:[]
Type:null
---------Consulting----------
Label: Comment
Name: okp:consulting.comment
Height: 100px
Width: 300px
Value: comment
Options:[]
Type:null
Second test: check set property groups method. Scenario:
- upload new txt document and set the same values form this method: propList = pgm.getProperties(token, "/okm:root/test.txt", "okg:technology");
Result:
Code: Select allcom.openkm.ws.client.ParseException_Exception: Inconsistent property definition: okp:technology.type
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy31.setProperties(Unknown Source)
at pl.poznan.put.erepodevel.OKMPropertyGroupMethods.setProperties(OKMPropertyGroupMethods.java:75)
at pl.poznan.put.erepodevel.Main.propertyGroupCheck(Main.java:254)
at pl.poznan.put.erepodevel.Main.main(Main.java:63)