• OKMPropertyGroup.setProperties() method not working

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #8451  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);

 #8505  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;
}
 #8837  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)
 #9214  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.
 #19562  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

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.