Page 1 of 1

Property Groups!

PostPosted:Thu Sep 27, 2012 1:27 pm
by pmbsa
Hi, I seem to be struggling with property groups in a big way. I created a basic property group when I first installed openKM, (v5.1.11 Community). I now would like to modify it and add so it but it simply refuses. I have read the instructions that state that once its there its there but the instructions imply that you can still change things after you have created them. I have tried simply adding the new field (in the case a select) to the current group with no joy. I have also tried to add a new group to the .cnd file in addiotin ot the old one which seems to not allow change and that doesnt work either. Is there a trick to this that I am missing?

If I try re-read the PropertyGroup.cnd file after I start OpenKM I get the following error

Application error
Code: Select all
Class:	javax.jcr.RepositoryException
Message:	The following nodetype change contains non-trivial changes.Up until now only trivial changes are supported. (see javadoc for org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff): org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff[ nodeTypeName={http://www.openkm.org/group/1.0}lawsofkenya, mixinFlagDiff=NONE, supertypesDiff=NONE, propertyDifferences=[ org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.welcome, type=MAJOR, operation=REMOVED], org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.ascensiondate, type=NONE, operation=NONE], org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.actname, type=NONE, operation=NONE], org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.comment, type=NONE, operation=NONE] ], childNodeDifferences=[ ] ]
I get that error regardless of whether there was a change to my cnd and xml files or not actually.

any advice would be appreciated. At this point its looking like I need to start a fresh repo which I am very loathed to do. I am a long way into a project now.

my cnd and xml files look lke the following (the okg:lawsofkenyaeditorial is now the new group I am trying to create just so I can add a select to the group but like I siad, I had no joy just adding the select to the original group either)
Code: Select all
<okm = 'http://www.openkm.org/1.0'>
<okg = 'http://www.openkm.org/group/1.0'>
<okp = 'http://www.openkm.org/group/property/1.0'>

[okg:lawsofkenya] mixin
- okp:lawsofkenya.actname (string) = '' autocreated
- okp:lawsofkenya.ascensiondate (string) = '' autocreated
- okp:lawsofkenya.comment (string) = '' autocreated
[okg:lawsofkenyaeditorial] mixin
- okp:lawsofkenyaeditorial.actname (string) = '' autocreated
- okp:lawsofkenyaeditorial.assentdate (string) = '' autocreated
- okp:lawsofkenyaeditorial.comment (string) = '' autocreated	
- okp:lawsofkenyaeditorial.wfstate (string) = '' autocreated
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.0//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.0.dtd">
<property-groups>
  <property-group label="Laws of Kenya" name="okg:lawsofkenya">
    <input label="Act Name" type="text" name="okp:lawsofkenya.actname"/>
    <input label="Ascension Date" type="date" name="okp:lawsofkenya.ascensiondate" />
<textarea label="Comment" name="okp:lawsofkenya.comment"/>
  </property-group>
<property-group label="Laws of Kenya Editorial" name="okg:lawsofkenyaeditorial">
    	<input label="Act Name" type="text" name="okp:lawsofkenyaeditorial.actname" readonly="true"/>
    	<input label="Assent Date" type="date" name="okp:lawsofkenyaeditorial.assentdate" readonly="true"/>
		<textarea label="Comment" name="okp:lawsofkenyaeditorial.comment"/>
		<select label="Editorial Process State" type="simple" name="okp:lawsofkenyaeditorial.wfstate">
			<option label="1" value="one" selected="true"/>
			<option label="2" value="two"/>
			<option label="3" value="three"/>
		</select>
</property-group>  
</property-groups>
thanks
Paul

Re: Property Groups!

PostPosted:Sat Sep 29, 2012 6:27 pm
by jllort
This kind of error means you're changing some of yet recorded property group to other type, the error is not caused to adding new field is caused to modify some one ( for example deleting or changing from multiple to simple type or reverse ). First return to initial property group. And then explain which changes do you want to doing. Do not copy all property group files versions, simply put initial values and the changes you done.

Re: Property Groups!

PostPosted:Wed Oct 03, 2012 12:34 pm
by boris
I had the exact same problem. You don't have to register your property group twice. Just add fields to the xml in your installation and it should work (at least on my installation it did)

Re: Property Groups!

PostPosted:Tue Oct 23, 2012 12:24 pm
by pmbsa
It looks like I really cant add any new properties to whats there for some reason. I reverted back to the original as suggested and I can change things like readonly attributes to the existing properties but it wont let me add anything new.
the initial values look like this
Code: Select all
<okm = 'http://www.openkm.org/1.0'>
<okg = 'http://www.openkm.org/group/1.0'>
<okp = 'http://www.openkm.org/group/property/1.0'>

[okg:lawsofkenya] mixin
- okp:lawsofkenya.actname (string) = '' autocreated
- okp:lawsofkenya.ascensiondate (string) = '' autocreated
- okp:lawsofkenya.comment (string) = '' autocreated
Code: Select all
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.0//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.0.dtd">
<property-groups>
  <property-group label="Laws of Kenya" name="okg:lawsofkenya">
    <input label="Act Name" type="text" name="okp:lawsofkenya.actname"/>
    <input label="Assent Date" type="date" name="okp:lawsofkenya.ascensiondate"/>
	<textarea label="Comment" name="okp:lawsofkenya.comment"/>
  </property-group> 
</property-groups>
I need to add a few more but I fail on just adding one which I would like to be this
Code: Select all
	<checkbox label="Available for Online Publication" name="okp:lawsofkenya.onlinepublishable"/>
the exception in the log is as follows
Code: Select all
org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff[
	nodeTypeName={http://www.openkm.org/group/1.0}lawsofkenya,
	mixinFlagDiff=NONE,
	supertypesDiff=NONE,
	propertyDifferences=[
		org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.welcome, type=MAJOR, operation=REMOVED],
		org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.ascensiondate, type=NONE, operation=NONE],
		org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.actname, type=NONE, operation=NONE],
		org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.comment, type=NONE, operation=NONE],
		org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={http://www.openkm.org/group/property/1.0}lawsofkenya.onlinepublishable, type=TRIVIAL, operation=ADDED]
	],
	childNodeDifferences=[
	]
]

	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(NodeTypeRegistry.java:442)
	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(NodeTypeRegistry.java:364)
	at com.openkm.module.direct.DirectRepositoryModule.registerCustomNodeTypes(DirectRepositoryModule.java:773)
	at com.openkm.servlet.admin.PropertyGroupsServlet.register(PropertyGroupsServlet.java:138)
	at com.openkm.servlet.admin.PropertyGroupsServlet.doGet(PropertyGroupsServlet.java:90)
	at com.openkm.servlet.admin.PropertyGroupsServlet.service(PropertyGroupsServlet.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:679)

Re: Property Groups!

PostPosted:Tue Oct 23, 2012 1:17 pm
by pmbsa
I managed to find out at least partially what was causing an issue. A member of the team had in the past added a property and then removed it (or tried to). I have added it back into the main group again
now and I am able to get past the non-trivial changes exception. Unfortunately, I am now getting a realy nasty issue with what I though was an issue with a missing jar but I have included the jar in the lib folder under server/default and the error persists. The really squiffy part is that the error completely obliterates the custom_nodetypes.xml file which then really causes a problem. fortunately I was able to restore it from a backup.

the exception I get is
Code: Select all
2012-10-23 15:11:31,394 ERROR [STDERR] Error 
  DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath
2012-10-23 15:11:31,402 ERROR [com.openkm.servlet.admin.PropertyGroupsServlet] internal error: failed to persist custom node type definitions to custom_nodetypes.xml: DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath
javax.jcr.RepositoryException: internal error: failed to persist custom node type definitions to custom_nodetypes.xml: DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath: DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath
	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.persistCustomNodeTypeDefs(NodeTypeRegistry.java:893)
	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(NodeTypeRegistry.java:424)
	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(NodeTypeRegistry.java:364)
	at com.openkm.module.direct.DirectRepositoryModule.registerCustomNodeTypes(DirectRepositoryModule.java:773)
	at com.openkm.servlet.admin.PropertyGroupsServlet.register(PropertyGroupsServlet.java:138)
	at com.openkm.servlet.admin.PropertyGroupsServlet.doGet(PropertyGroupsServlet.java:90)
	at com.openkm.servlet.admin.PropertyGroupsServlet.service(PropertyGroupsServlet.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.IOException: DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath
	at org.apache.jackrabbit.core.util.DOMBuilder.write(DOMBuilder.java:87)
	at org.apache.jackrabbit.core.nodetype.xml.NodeTypeWriter.write(NodeTypeWriter.java:282)
	at org.apache.jackrabbit.core.nodetype.xml.NodeTypeWriter.write(NodeTypeWriter.java:66)
	at org.apache.jackrabbit.core.nodetype.NodeTypeDefStore.store(NodeTypeDefStore.java:98)
	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.persistCustomNodeTypeDefs(NodeTypeRegistry.java:884)
	... 26 more
Caused by: net.sf.saxon.trans.XPathException: DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath
	at net.sf.saxon.event.Sender.send(Sender.java:251)
	at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:30)
	at org.apache.jackrabbit.core.util.DOMBuilder.write(DOMBuilder.java:80)
	... 30 more
java.io.IOException: DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath
	at org.apache.jackrabbit.core.util.DOMBuilder.write(DOMBuilder.java:87)
	at org.apache.jackrabbit.core.nodetype.xml.NodeTypeWriter.write(NodeTypeWriter.java:282)
	at org.apache.jackrabbit.core.nodetype.xml.NodeTypeWriter.write(NodeTypeWriter.java:66)
	at org.apache.jackrabbit.core.nodetype.NodeTypeDefStore.store(NodeTypeDefStore.java:98)
	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.persistCustomNodeTypeDefs(NodeTypeRegistry.java:884)
	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(NodeTypeRegistry.java:424)
	at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(NodeTypeRegistry.java:364)
	at com.openkm.module.direct.DirectRepositoryModule.registerCustomNodeTypes(DirectRepositoryModule.java:773)
	at com.openkm.servlet.admin.PropertyGroupsServlet.register(PropertyGroupsServlet.java:138)
	at com.openkm.servlet.admin.PropertyGroupsServlet.doGet(PropertyGroupsServlet.java:90)
	at com.openkm.servlet.admin.PropertyGroupsServlet.service(PropertyGroupsServlet.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:679)
Caused by: net.sf.saxon.trans.XPathException: DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath
	at net.sf.saxon.event.Sender.send(Sender.java:251)
	at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:30)
	at org.apache.jackrabbit.core.util.DOMBuilder.write(DOMBuilder.java:80)
	... 30 more

Re: Property Groups!

PostPosted:Wed Oct 24, 2012 9:41 pm
by jllort
Which is your OpenKM version ?

Re: Property Groups!

PostPosted:Thu Oct 25, 2012 8:19 am
by pmbsa
Running 5.1.11 on the standard Jboss container

Re: Property Groups!

PostPosted:Mon Oct 29, 2012 6:20 pm
by pavila
We don't user saxon9-dom.jar library and I don't know why need it. Can you reproduce the problem in a clean installation?

BTW: OpenKM 6.2 is more permisive with property groups changes.