Introduce namespace support
[lgpl/argeo-commons.git] / org.argeo.api / src / org / argeo / api / gcr / CrName.java
index 3fc1481856643e6a57cdd1999ef3e4e18f1d5740..283e5cc716f09c6c8a7af6c8dc4bc1f31c969e85 100644 (file)
@@ -1,42 +1,58 @@
 package org.argeo.api.gcr;
 
-import java.util.UUID;
-
 /** Standard names. */
-public enum CrName implements ContentName {
+public enum CrName implements ContentNameSupplier {
+
        /*
         * TYPES
         */
-       COLLECTION("collection"), // a collection type
+       COLLECTION, // a collection type
 
        /*
         * ATTRIBUTES
         */
-       UUID("uuid"), // the UUID of a content
+       UUID, // the UUID of a content
+
+       /*
+        * ATTRIBUTES FROM FILE SEMANTICS
+        */
+       CREATION_TIME, //
+       LAST_MODIFIED_TIME, //
+       SIZE, //
+       FILE_KEY, //
+       OWNER, //
+       GROUP, //
+       PERMISSIONS, //
+
+       /*
+        * CONTENT NAMES
+        */
+       ROOT,
+
        //
        ;
 
-       private String name;
-       private UUID uuid;
+       public final static String CR_NAMESPACE_URI = "http://argeo.org/ns/cr";
+       public final static String CR_DEFAULT_PREFIX = "cr";
+       private final ContentName value;
 
-       CrName(String name) {
-               this.name = name;
-               this.uuid = ContentNamespace.CR_NS.nameUuid(name);
+       CrName() {
+               value = toContentName();
        }
 
        @Override
-       public UUID getUuid() {
-               return uuid;
+       public ContentName get() {
+               return value;
        }
 
        @Override
-       public ContentNamespace getNamespace() {
-               return ContentNamespace.CR_NS;
+       public String getNamespaceURI() {
+               return CR_NAMESPACE_URI;
        }
 
        @Override
-       public String getName() {
-               return name;
+       public String getDefaultPrefix() {
+               return CR_DEFAULT_PREFIX;
        }
 
 }