Page 1 of 1

OKMPropertyGroup.setProperties() method not working

PostPosted:Thu Jan 27, 2011 5:19 pm
by amenti
On the demo site (version 5.0.1e 4727) the following code does not seem to work. I verified that the document already has the below PropertyGroup (Technology) assigned to it and that the PropertyGroup exists. Has anyone else ran into this issue? Perhaps I am not declaring the PropertyName correctly?
Code: Select all
final FormElementComplex elementComplex = new FormElementComplex();
elementComplex.setName("okp\\:technology.comment");
elementComplex.setValue("This is a comment");

final FormElementComplexArray compArray = new FormElementComplexArray();
compArray.getItem().add(elementComplex);

impl.getOKMPropertyGroup().setProperties(token, "/okm:root/PBE/setup.txt", "okg:technology", compArray);


Re: OKMPropertyGroup.setProperties() method not working

PostPosted:Tue Feb 01, 2011 8:56 am
by pavila
This is a sample PHP code:
Code: Select all
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl');
$OKMPropertyGroup = new SoapClient('http://localhost:8080/OpenKM/OKMPropertyGroup?wsdl');

$fec = new formElementComplex();
$fec->objClass = "com.openkm.bean.form.Input";
$fec->name = "okp:technology.comment";
$fec->value = "Other comment from PHP";
$fecArray = new formElementComplexArray();
$fecArray->item = $fec;

$token = $OKMAuth->login('okmAdmin', 'admin');
$docPath = "/okm:root/salida.pdf";
$OKMPropertyGroup->setProperties($token, $docPath, 'okg:technology', $fecArray);
$OKMAuth->logout($token);

class formElementComplex {
  var $objClass;
  var $name;
  var $value;
  var $readonly;
}

class formElementComplexArray {
  var $item;
}

Re: OKMPropertyGroup.setProperties() method not working

PostPosted:Wed Feb 16, 2011 10:01 am
by mateusz
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 all
FormElementComplexArray 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 all
com.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)

Re: OKMPropertyGroup.setProperties() method not working

PostPosted:Thu Feb 17, 2011 1:18 pm
by pavila
Please, post or attach a compilable sample code and I will try to reproduce the issue. Thanks.

Re: OKMPropertyGroup.setProperties() method not working

PostPosted:Fri Feb 18, 2011 10:37 am
by mateusz
Hi,

Code in attachment.

Re: OKMPropertyGroup.setProperties() method not working

PostPosted:Mon Feb 28, 2011 4:31 pm
by pavila
The null type is ok for some kind of form elements, like TextArea, because there is no different types of this component. This make sense for elements like Input because may be a text, date, or folder. If you want to know which kind of component is a property, check the f.getObjClass() method.

Respect the other exception, try the nighbuild because I have submitted a fix.

Re: OKMPropertyGroup.setProperties() method not working

PostPosted:Thu Mar 03, 2011 9:28 pm
by mateusz
Thanks for your help.

Re: OKMPropertyGroup.setProperties() method not working

PostPosted:Thu Nov 29, 2012 9:57 am
by cjain78
Hi,

I am not able to set the property group using SOAP. Can anyone tell me what is the correct syntax/example. Here is my code:


s1 = "<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:end=""http://endpoint.ws.openKM.com/"">" _
& "<soapenv:Header/>" _
& "<soapenv:Body>" _
& "<end:setProperties>" _
& "<token>token</token>" _
& "<nodePath>/okm_root</nodePath>" _
& "<grpName>invoice</grpName>" _
& "<properties>name:okp:invoice.invoiceno</properties>" _
& "<properties>value:IN7877666</properties>" _
& "</end:setProperties>" _
& "</soapenv:Body>" _
& "</soapenv:Envelope>"

Thanks in Advance

Regards
Chirag

Re: OKMPropertyGroup.setProperties() method not working

PostPosted:Sat Dec 01, 2012 11:36 am
by jllort
If you're using some client like soapUI please add new post for this kind of problem do not merge with actual post.