]>
git.argeo.org Git - gpl/argeo-suite.git/blob - org.argeo.app.core/src/org/argeo/app/core/SuiteContentNamespace.java
1 package org
.argeo
.app
.core
;
3 import java
.net
.MalformedURLException
;
5 import java
.util
.Objects
;
7 import org
.argeo
.api
.acr
.spi
.ContentNamespace
;
9 public enum SuiteContentNamespace
implements ContentNamespace
{
13 ENTITY("entity", "http://www.argeo.org/ns/entity", "entity.xsd", null),
15 ARGEO_DBK("argeodbk", "http://www.argeo.org/ns/argeodbk", null, null),
19 DOCBOOK5("dbk", "http://docbook.org/ns/docbook", "docbook.xsd", "http://docbook.org/xml/5.0.1/xsd/docbook.xsd"),
21 XML_EVENTS("ev", "http://www.w3.org/2001/xml-events", "xml-events-attribs-1.xsd",
22 "http://www.w3.org/MarkUp/SCHEMA/xml-events-attribs-1.xsd"),
24 XFORMS("xforms", "http://www.w3.org/2002/xforms", "XForms-11-Schema.xsd",
25 "https://www.w3.org/MarkUp/Forms/2007/XForms-11-Schema.xsd"),
27 XCARD("xcard", "urn:ietf:params:xml:ns:vcard-4.0", "xCard-4.0.xsd", null),
29 XSL_FO("fo", "http://www.w3.org/1999/XSL/Format", "fop.xsd",
30 "https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd"),
32 // XCAL_2_0("xcal", "urn:ietf:params:xml:ns:icalendar-2.0", "xCal-2.0.xsd", null),
34 XHTML("h", "http://www.w3.org/1999/xhtml", null, "https://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"),
38 JR("jr", "http://openrosa.org/javarosa", null, null),
40 ORX("orx", "http://openrosa.org/xforms", null, null),
42 ORX_LIST("orxList", "http://openrosa.org/xforms/xformsList", null, null),
44 ORX_MANIFEST("orxManifest", "http://openrosa.org/xforms/xformsManifest", null, null),
46 ODK("odk", "http://www.opendatakit.org/xforms", null, null),
48 WGS84("geo", "http://www.w3.org/2003/01/geo/wgs84_pos#", null, null),
52 private final static String RESOURCE_BASE
= "/org/argeo/app/core/schemas/";
54 private String defaultPrefix
;
55 private String namespace
;
57 private URL publicUrl
;
59 SuiteContentNamespace(String defaultPrefix
, String namespace
, String resourceFileName
, String publicUrl
) {
60 Objects
.requireNonNull(namespace
);
61 this.defaultPrefix
= defaultPrefix
;
62 Objects
.requireNonNull(namespace
);
63 this.namespace
= namespace
;
64 if (resourceFileName
!= null) {
65 resource
= getClass().getResource(RESOURCE_BASE
+ resourceFileName
);
66 Objects
.requireNonNull(resource
);
68 if (publicUrl
!= null)
70 this.publicUrl
= new URL(publicUrl
);
71 } catch (MalformedURLException e
) {
72 throw new IllegalArgumentException("Cannot interpret public URL", e
);
77 public String
getDefaultPrefix() {
82 public String
getNamespaceURI() {
87 public URL
getSchemaResource() {
91 public URL
getPublicUrl() {