]>
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", "entity.xsd", 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),
38 WGS84("geo", "http://www.w3.org/2003/01/geo/wgs84_pos#", null, null),
42 private final static String RESOURCE_BASE
= "/org/argeo/app/core/schemas/";
44 private String defaultPrefix
;
45 private String namespace
;
47 private URL publicUrl
;
49 SuiteContentTypes(String defaultPrefix
, String namespace
, String resourceFileName
, String publicUrl
) {
50 Objects
.requireNonNull(namespace
);
51 this.defaultPrefix
= defaultPrefix
;
52 Objects
.requireNonNull(namespace
);
53 this.namespace
= namespace
;
54 if (resourceFileName
!= null) {
55 resource
= getClass().getResource(RESOURCE_BASE
+ resourceFileName
);
56 Objects
.requireNonNull(resource
);
58 if (publicUrl
!= null)
60 this.publicUrl
= new URL(publicUrl
);
61 } catch (MalformedURLException e
) {
62 throw new IllegalArgumentException("Cannot interpret public URL", e
);
66 public String
getDefaultPrefix() {
70 public String
getNamespace() {
74 public URL
getResource() {
78 public URL
getPublicUrl() {