Import-Package:\
org.osgi.service.http.context,\
+org.argeo.naming,\
*
--- /dev/null
+package org.argeo.support.odk;
+
+import org.argeo.jcr.QualifiedName;
+
+/** Types related to the http://openrosa.org/xforms/xformsList namespace. */
+public enum OrxListType implements QualifiedName {
+ xform;
+
+ @Override
+ public String getPrefix() {
+ return prefix();
+ }
+
+ public static String prefix() {
+ return "orxList";
+ }
+
+ @Override
+ public String getNamespace() {
+ return namespace();
+ }
+
+ public static String namespace() {
+ return "http://openrosa.org/xforms/xformsList";
+ }
+
+}
<xforms = "http://www.w3.org/2002/xforms">
[xforms:model]
-+ xforms:instance (nt:base) = nt:unstructured *
++ xforms:instance (xforms:instance) = xforms:instance *
+ xforms:bind (xforms:bind) = xforms:bind *
+ xforms:setvalue (xforms:setvalue) = xforms:setvalue *
+[xforms:instance] > nt:unstructured
+
[xforms:bind]
- * (STRING)
/** Constants used to name entity structures. */
public interface EntityNames {
- final String ENTITY_DEFINITIONS_PATH = "/entity";
- final String TYPOLOGIES_PATH = "/class";
final String FORM_BASE = "form";
+ final String TERM_BASE = "term";
+ final String ENTITY_DEFINITIONS_PATH = "/entity";
+ @Deprecated
+ final String TYPOLOGIES_PATH = "/" + TERM_BASE;
/** Administrative units. */
final String ADM = "adm";
package org.argeo.entity;
-import org.argeo.naming.QualifiedName;
+import org.argeo.jcr.QualifiedName;
/** Types related to entities. */
public enum EntityType implements QualifiedName {
// entity
entity, definition,
- // xml
- xmlvalue, xmltext,
// typology
- typology, term,
+ typologies, terms, term,
// form
form, formSet,
// ldap
//
// TYPOLOGY
//
+[entity:typologies]
++ * (entity:terms) = entity:terms
+
[entity:term]
orderable
-+ * (entity:term) *
++ * (entity:term) = entity:term *
-[entity:typology] > mix:referenceable, mix:created
+[entity:terms] > mix:referenceable
orderable
-+ * (entity:term) *
++ * (entity:term) = entity:term *
//
// FORM
import java.io.IOException;
+import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import org.argeo.entity.EntityNames;
+import org.argeo.entity.EntityType;
import org.argeo.maintenance.AbstractMaintenanceService;
/** Initialises an Argeo Suite backend. */
@Override
public boolean prepareJcrTree(Session adminSession) throws RepositoryException, IOException {
- //EntityJcrUtils.getOrAddFormFolder(adminSession.getRootNode(), EntityNames.FORM_BASE);
- return adminSession.hasPendingChanges();
+ boolean modified = false;
+ Node rootNode = adminSession.getRootNode();
+ if (!rootNode.hasNode(EntityNames.TERM_BASE)) {
+ rootNode.addNode(EntityNames.TERM_BASE, EntityType.typologies.qualified());
+ modified = true;
+ }
+ if (modified)
+ adminSession.save();
+ return modified;
}
}