X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.entity.core%2Fsrc%2Forg%2Fargeo%2Fentity%2Fcore%2FJcrEntityDefinition.java;h=6eb086da2f40d6bfb1e2e60824674d50b4b661d9;hb=d7d9881c3a7e83c39015ac48e232292d7efc17d2;hp=15fb812c0567505fef6c80ee9a9b228bb444780e;hpb=a55bb0dc7e9fbcefb645d34ce24b326d1506a623;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.entity.core/src/org/argeo/entity/core/JcrEntityDefinition.java b/org.argeo.entity.core/src/org/argeo/entity/core/JcrEntityDefinition.java index 15fb812..6eb086d 100644 --- a/org.argeo.entity.core/src/org/argeo/entity/core/JcrEntityDefinition.java +++ b/org.argeo.entity.core/src/org/argeo/entity/core/JcrEntityDefinition.java @@ -10,10 +10,7 @@ import javax.jcr.Session; import org.argeo.api.NodeUtils; import org.argeo.entity.EntityConstants; import org.argeo.entity.EntityDefinition; -import org.argeo.entity.EntityNames; -import org.argeo.entity.EntityTypes; import org.argeo.jcr.Jcr; -import org.argeo.jcr.JcrUtils; import org.osgi.framework.BundleContext; /** An entity definition based on a JCR data structure. */ @@ -21,7 +18,7 @@ public class JcrEntityDefinition implements EntityDefinition { private Repository repository; private String type; - private String defaultEditoryId; + private String defaultEditorId; public void init(BundleContext bundleContext, Map properties) throws RepositoryException { Session adminSession = NodeUtils.openDataAdminSession(repository, null); @@ -29,13 +26,13 @@ public class JcrEntityDefinition implements EntityDefinition { type = properties.get(EntityConstants.TYPE); if (type == null) throw new IllegalArgumentException("Entity type property " + EntityConstants.TYPE + " must be set."); - defaultEditoryId = properties.get(EntityConstants.DEFAULT_EDITORY_ID); - String definitionPath = EntityNames.ENTITY_DEFINITIONS_PATH + '/' + type; - if (!adminSession.itemExists(definitionPath)) { - Node entityDefinition = JcrUtils.mkdirs(adminSession, definitionPath); - entityDefinition.addMixin(EntityTypes.ENTITY_DEFINITION); - adminSession.save(); - } + defaultEditorId = properties.get(EntityConstants.DEFAULT_EDITOR_ID); +// String definitionPath = EntityNames.ENTITY_DEFINITIONS_PATH + '/' + type; +// if (!adminSession.itemExists(definitionPath)) { +// Node entityDefinition = JcrUtils.mkdirs(adminSession, definitionPath, EntityTypes.ENTITY_DEFINITION); +//// entityDefinition.addMixin(EntityTypes.ENTITY_DEFINITION); +// adminSession.save(); +// } initJcr(adminSession); } finally { Jcr.logout(adminSession); @@ -53,7 +50,7 @@ public class JcrEntityDefinition implements EntityDefinition { @Override public String getEditorId(Node entity) { - return defaultEditoryId; + return defaultEditorId; } @Override