Deprecate JCR entity definition
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 4 Oct 2023 07:14:08 +0000 (09:14 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 4 Oct 2023 07:14:08 +0000 (09:14 +0200)
org.argeo.app.api/src/org/argeo/app/api/EntityConstants.java
org.argeo.app.api/src/org/argeo/app/api/EntityDefinition.java
org.argeo.app.core/src/org/argeo/app/core/AbstractEntityDefinition.java [new file with mode: 0644]
org.argeo.app.jcr/src/org/argeo/app/jcr/JcrEntityDefinition.java

index c7885be9a22649c1268d1be5d7a6dcc4a18157aa..f04a6d0b457b841bfe9f4f90fef0f8d96e6318c2 100644 (file)
@@ -3,6 +3,6 @@ package org.argeo.app.api;
 /** Constant related to entities, typically used in an OSGi context. */
 public interface EntityConstants {
        final static String TYPE = "entity.type";
-       final static String DEFAULT_EDITOR_ID = "entity.defaultEditorId";
+//     final static String DEFAULT_EDITOR_ID = "entity.defaultEditorId";
 
 }
index e1280cf03c77da17e6e7469301e96a2175c478f8..97f7d7c68a30e337d0f5d0e7f946958b57ae542a 100644 (file)
@@ -1,10 +1,8 @@
 package org.argeo.app.api;
 
-import javax.jcr.Node;
-
 /** The definition of an entity, a composite configurable data structure. */
 public interface EntityDefinition {
-       String getEditorId(Node entity);
+//     String getEditorId(Node entity);
 
        String getType();
 }
diff --git a/org.argeo.app.core/src/org/argeo/app/core/AbstractEntityDefinition.java b/org.argeo.app.core/src/org/argeo/app/core/AbstractEntityDefinition.java
new file mode 100644 (file)
index 0000000..7e10bf0
--- /dev/null
@@ -0,0 +1,14 @@
+package org.argeo.app.core;
+
+import org.argeo.app.api.EntityDefinition;
+
+public abstract class AbstractEntityDefinition implements EntityDefinition {
+
+       public void init() {
+
+       }
+
+       public void destroy() {
+
+       }
+}
index e76315c8d3106f65afc2dec9389831ff7808da6f..8795d02d7f63c341192455697feaa31e1c42d97a 100644 (file)
@@ -2,7 +2,6 @@ package org.argeo.app.jcr;
 
 import java.util.Map;
 
-import javax.jcr.Node;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -14,11 +13,12 @@ import org.argeo.jcr.Jcr;
 import org.osgi.framework.BundleContext;
 
 /** An entity definition based on a JCR data structure. */
+@Deprecated
 public class JcrEntityDefinition implements EntityDefinition {
        private Repository repository;
 
        private String type;
-       private String defaultEditorId;
+//     private String defaultEditorId;
 
        public void init(BundleContext bundleContext, Map<String, String> properties) throws RepositoryException {
                Session adminSession = CmsJcrUtils.openDataAdminSession(repository, null);
@@ -26,7 +26,7 @@ public class JcrEntityDefinition implements EntityDefinition {
                        type = properties.get(EntityConstants.TYPE);
                        if (type == null)
                                throw new IllegalArgumentException("Entity type property " + EntityConstants.TYPE + " must be set.");
-                       defaultEditorId = properties.get(EntityConstants.DEFAULT_EDITOR_ID);
+//                     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);
@@ -48,10 +48,10 @@ public class JcrEntityDefinition implements EntityDefinition {
 
        }
 
-       @Override
-       public String getEditorId(Node entity) {
-               return defaultEditorId;
-       }
+//     @Override
+//     public String getEditorId(Node entity) {
+//             return defaultEditorId;
+//     }
 
        @Override
        public String getType() {