]>
git.argeo.org Git - gpl/argeo-suite.git/blob - org.argeo.app.core/src/org/argeo/app/core/SuiteContentNamespace.java
ec77eda02f8ce7702f0e0952cef6e58d20624e71
1 package org
.argeo
.app
.core
;
3 import java
.net
.MalformedURLException
;
6 import java
.util
.Objects
;
8 import org
.argeo
.api
.acr
.spi
.ContentNamespace
;
10 public enum SuiteContentNamespace
implements ContentNamespace
{
14 ENTITY("entity", "http://www.argeo.org/ns/entity",
15 "platform:/plugin/org.argeo.app.api/org/argeo/app/api/entity.xsd", null),
17 ARGEO_DBK("argeodbk", "http://www.argeo.org/ns/argeodbk", null, null),
21 DOCBOOK5("dbk", "http://docbook.org/ns/docbook", "docbook.xsd", "http://docbook.org/xml/5.0.1/xsd/docbook.xsd"),
23 XML_EVENTS("ev", "http://www.w3.org/2001/xml-events", "xml-events-attribs-1.xsd",
24 "http://www.w3.org/MarkUp/SCHEMA/xml-events-attribs-1.xsd"),
26 XFORMS("xforms", "http://www.w3.org/2002/xforms", "XForms-11-Schema.xsd",
27 "https://www.w3.org/MarkUp/Forms/2007/XForms-11-Schema.xsd"),
29 XCARD("xcard", "urn:ietf:params:xml:ns:vcard-4.0", "xCard-4.0.xsd", null),
31 XSL_FO("fo", "http://www.w3.org/1999/XSL/Format", "fop.xsd",
32 "https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd"),
34 // XCAL_2_0("xcal", "urn:ietf:params:xml:ns:icalendar-2.0", "xCal-2.0.xsd", null),
36 XHTML("h", "http://www.w3.org/1999/xhtml", null, "https://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"),
40 JR("jr", "http://openrosa.org/javarosa", null, null),
42 ORX("orx", "http://openrosa.org/xforms", null, null),
44 ORX_LIST("orxList", "http://openrosa.org/xforms/xformsList", null, null),
46 ORX_MANIFEST("orxManifest", "http://openrosa.org/xforms/xformsManifest", null, null),
48 ODK("odk", "http://www.opendatakit.org/xforms", null, null),
50 WGS84("geo", "http://www.w3.org/2003/01/geo/wgs84_pos#", null, null),
51 // Re-add XML in order to solve import issue with xlink
52 XML("xml", "http://www.w3.org/XML/1998/namespace", "xml.xsd", "http://www.w3.org/2001/xml.xsd"),
57 private final static String RESOURCE_BASE
= "/org/argeo/app/core/schemas/";
59 private String defaultPrefix
;
60 private String namespace
;
62 private URL publicUrl
;
64 SuiteContentNamespace(String defaultPrefix
, String namespace
, String resourceFileName
, String publicUrl
) {
65 Objects
.requireNonNull(namespace
);
66 this.defaultPrefix
= defaultPrefix
;
67 Objects
.requireNonNull(namespace
);
68 this.namespace
= namespace
;
69 if (resourceFileName
!= null) {
71 // FIXME workaround when in nested OSGi frameworks
72 // we should use class path, as before
73 if (!resourceFileName
.startsWith("platform:")) {
74 resource
= URI
.create("platform:/plugin/org.argeo.app.core" + RESOURCE_BASE
+ resourceFileName
)
77 resource
= URI
.create(resourceFileName
).toURL();
79 } catch (MalformedURLException e
) {
80 throw new IllegalArgumentException("Cannot convert " + resourceFileName
+ " to URL");
83 Objects
.requireNonNull(resource
);
85 if (publicUrl
!= null)
87 this.publicUrl
= new URL(publicUrl
);
88 } catch (MalformedURLException e
) {
89 throw new IllegalArgumentException("Cannot interpret public URL", e
);
94 public String
getDefaultPrefix() {
99 public String
getNamespaceURI() {
104 public URL
getSchemaResource() {
108 public URL
getPublicUrl() {