chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r798872 - in /incubator/chemistry/trunk/chemistry: chemistry-api/src/main/java/org/apache/chemistry/ chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/ chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ c...
Date Wed, 29 Jul 2009 12:29:18 GMT
Author: fguillaume
Date: Wed Jul 29 12:29:18 2009
New Revision: 798872

URL: http://svn.apache.org/viewvc?rev=798872&view=rev
Log:
CMIS-44: added XHTML property type

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java?rev=798872&r1=798871&r2=798872&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java
Wed Jul 29 12:29:18 2009
@@ -45,6 +45,8 @@
 
     public static final int HTML_ORD = 9;
 
+    public static final int XHTML_ORD = 10;
+
     private static final Map<String, PropertyType> all = new HashMap<String, PropertyType>();
 
     /**
@@ -101,6 +103,12 @@
     public static final PropertyType HTML = register(new PropertyType("html",
             HTML_ORD, String.class));
 
+    /**
+     * An XHTML property, represented as a String.
+     */
+    public static final PropertyType XHTML = register(new PropertyType("xhtml",
+            XHTML_ORD, String.class));
+
     private final String name;
 
     private final int ordinal;

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java?rev=798872&r1=798871&r2=798872&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
Wed Jul 29 12:29:18 2009
@@ -194,6 +194,9 @@
                 case PropertyType.HTML_ORD:
                     qname = CMIS.PROPERTY_HTML_DEFINITION;
                     break;
+                case PropertyType.XHTML_ORD:
+                    qname = CMIS.PROPERTY_XHTML_DEFINITION;
+                    break;
                 default:
                     throw new AssertionError(pd.getType().name());
                 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java?rev=798872&r1=798871&r2=798872&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
Wed Jul 29 12:29:18 2009
@@ -137,6 +137,8 @@
 
     public static final QName PROPERTY_HTML_DEFINITION = CMISName("propertyHtmlDefinition");
 
+    public static final QName PROPERTY_XHTML_DEFINITION = CMISName("propertyXhtmlDefinition");
+
     public static final QName PROPERTY_TYPE = CMISName("propertyType");
 
     public static final QName CARDINALITY = CMISName("cardinality");
@@ -173,6 +175,8 @@
 
     public static final QName PROPERTY_HTML = CMISName("propertyHtml");
 
+    public static final QName PROPERTY_XHTML = CMISName("propertyXhtml");
+
     public static final QName PDID = CMISName("pdid");
 
     public static final QName LOCALNAME = CMISName("localname");

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java?rev=798872&r1=798871&r2=798872&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java
Wed Jul 29 12:29:18 2009
@@ -295,6 +295,33 @@
         }
     }
 
+    protected static final class XhtmlValueAdapter extends ValueAdapter {
+        @Override
+        public Serializable readValue(String xml) {
+            return xml;
+        }
+
+        @Override
+        public String writeValue(Serializable val) {
+            return val.toString();
+        }
+
+        @Override
+        public Serializable[] createArray(int size) {
+            return new String[size];
+        }
+
+        @Override
+        public QName getPropertyQName() {
+            return CMIS.PROPERTY_XHTML;
+        }
+
+        @Override
+        public PropertyType getPropertyType() {
+            return PropertyType.XHTML;
+        }
+    }
+
     public static final ValueAdapter STRING = new StringValueAdapter();
 
     public static final ValueAdapter DECIMAL = new DecimalValueAdapter();
@@ -313,6 +340,8 @@
 
     public static final ValueAdapter HTML = new HtmlValueAdapter();
 
+    public static final ValueAdapter XHTML = new XhtmlValueAdapter();
+
     protected static final Map<PropertyType, ValueAdapter> byPropertyType = new HashMap<PropertyType,
ValueAdapter>();
 
     protected static final Map<QName, ValueAdapter> byQName = new HashMap<QName,
ValueAdapter>();
@@ -327,7 +356,8 @@
                 URI, //
                 ID, //
                 XML, //
-                HTML //
+                HTML, //
+                XHTML //
         )) {
             byPropertyType.put(va.getPropertyType(), va);
             byQName.put(va.getPropertyQName(), va);

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java?rev=798872&r1=798871&r2=798872&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java
Wed Jul 29 12:29:18 2009
@@ -241,6 +241,8 @@
             throw new UnsupportedOperationException(type.toString());
         case PropertyType.HTML_ORD:
             throw new UnsupportedOperationException(type.toString());
+        case PropertyType.XHTML_ORD:
+            throw new UnsupportedOperationException(type.toString());
         default:
             throw new UnsupportedOperationException(type.toString());
         }
@@ -267,6 +269,8 @@
             return CMIS.PROPERTY_XML;
         case PropertyType.HTML_ORD:
             return CMIS.PROPERTY_HTML;
+        case PropertyType.XHTML_ORD:
+            return CMIS.PROPERTY_XHTML;
         default:
             throw new UnsupportedOperationException(def.getType().toString());
         }



Mime
View raw message