Author: ktlili
Date: Sun Nov 25 20:30:11 2007
New Revision: 19286

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D19286&repname=
=3Djahia
Log:
- commit portlets categories( admin view ): classes + categories + entryPoi=
ntObjectKey

Added:
    trunk/core/src/java/org/jahia/data/applications/EntryPointObjectKey.java

Added: trunk/core/src/java/org/jahia/data/applications/EntryPointObjectKey.=
java
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/trunk/core/src=
/java/org/jahia/data/applications/EntryPointObjectKey.java&rev=3D19286&repn=
ame=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/data/applications/EntryPointObjectKey.jav=
a (added)
+++ trunk/core/src/java/org/jahia/data/applications/EntryPointObjectKey.jav=
a Sun Nov 25 20:30:11 2007
@@ -0,0 +1,71 @@
+package org.jahia.data.applications;
+
+import org.jahia.content.ObjectKey;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ktlili
+ * Date: 26 janv. 2007
+ * Time: 16:26:42
+ */
+public class EntryPointObjectKey extends ObjectKey {
+    public static final String ENTRY_POINT_TYPE =3D "entrypoint";
+    =

+    static {
+        ObjectKey.registerType(ENTRY_POINT_TYPE, EntryPointObjectKey.class=
);
+    }
+
+    /*TO DO: ckeck value of this IDInType */
+    private String IDInType =3D "100";
+    private int idInType;
+
+    /**
+     * Protected constructor to use this class also as a factory by calling
+     * the getChildInstance method. Please do not use this constructor dir=
ectly
+     */
+    public EntryPointObjectKey() {}
+
+    public EntryPointObjectKey(String appID_entryPointName) {
+        super(ENTRY_POINT_TYPE, appID_entryPointName);
+    }
+
+    public EntryPointObjectKey(String appID_entryPointName, String objectK=
ey) {
+        super(ENTRY_POINT_TYPE, appID_entryPointName, objectKey);
+    }
+
+    public String getType() {
+        return ENTRY_POINT_TYPE;
+    }
+
+    public String getIDInType() {
+        return this.IDInType;
+    }
+
+    public int getIdInType() {
+        if (idInType <=3D 0) {
+            try {
+                idInType =3D Integer.parseInt(IDInType);
+            } catch (NumberFormatException e) {
+                idInType =3D -1;
+            }
+        }
+        return idInType;
+    }
+
+    /**
+     * @deprecated This method should not be called directly, but rather it
+     * should be replace by a call to the constructor with the proper IDIn=
Type.
+     * This has been deprecated because the new getChildInstance() is much
+     * faster
+     * @param IDInType the IDInType
+     * @return the ObjectKey corresponding to the ID for this class type
+     */
+    public static ObjectKey getChildInstance(String IDInType) {
+        return new EntryPointObjectKey(IDInType);
+    }
+
+    public ObjectKey getChildInstance(String IDInType, String objectKey) {
+        return new EntryPointObjectKey(IDInType, objectKey);
+    }
+
+}

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to