]>
git.argeo.org Git - gpl/argeo-suite.git/blob - org.argeo.app.core/src/org/argeo/app/core/SuiteContentTypes.java
1 package org
.argeo
.app
.core
;
3 import java
.net
.MalformedURLException
;
5 import java
.util
.Objects
;
7 public enum SuiteContentTypes
{
11 ENTITY("entity", "http://www.argeo.org/ns/entity", null, null),
13 ARGEO_DBK("argeodbk", "http://www.argeo.org/ns/argeodbk", null, null),
17 XCARD_4_0("xcard", "urn:ietf:params:xml:ns:vcard-4.0", "xCard-4.0.xsd", null),
19 XSL_FO_1999("fo", "http://www.w3.org/1999/XSL/Format", "fop.xsd",
20 "https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd"),
22 // XCAL_2_0("xcal", "urn:ietf:params:xml:ns:icalendar-2.0", "xCal-2.0.xsd", null),
24 XHTML_1_1("h", "http://www.w3.org/1999/xhtml", null, "https://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"),
28 JR("jr", "http://openrosa.org/javarosa", null, null),
30 ORX("orx", "http://openrosa.org/xforms", null, null),
32 ORX_LIST("orxList", "http://openrosa.org/xforms/xformsList", null, null),
34 ORX_MANIFEST("orxManifest", "http://openrosa.org/xforms/xformsManifest", null, null),
36 ODK("odk", "http://www.opendatakit.org/xforms", null, null),
40 private final static String RESOURCE_BASE
= "/org/argeo/app/core/schemas/";
42 private String defaultPrefix
;
43 private String namespace
;
45 private URL publicUrl
;
47 SuiteContentTypes(String defaultPrefix
, String namespace
, String resourceFileName
, String publicUrl
) {
48 Objects
.requireNonNull(namespace
);
49 this.defaultPrefix
= defaultPrefix
;
50 Objects
.requireNonNull(namespace
);
51 this.namespace
= namespace
;
52 if (resourceFileName
!= null) {
53 resource
= getClass().getResource(RESOURCE_BASE
+ resourceFileName
);
54 Objects
.requireNonNull(resource
);
56 if (publicUrl
!= null)
58 this.publicUrl
= new URL(publicUrl
);
59 } catch (MalformedURLException e
) {
60 throw new IllegalArgumentException("Cannot interpret public URL", e
);
64 public String
getDefaultPrefix() {
68 public String
getNamespace() {
72 public URL
getResource() {
76 public URL
getPublicUrl() {