]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - src/org/argeo/cms/acr/CmsContentTypes.java
1 package org
.argeo
.cms
.acr
;
3 import java
.net
.MalformedURLException
;
5 import java
.util
.Objects
;
7 public enum CmsContentTypes
{
8 CR_2("cr", "http://argeo.org/ns/cr", "cr.xsd", null),
10 XSD_2001("xs", "http://www.w3.org/2001/XMLSchema", "XMLSchema.xsd", "http://www.w3.org/2001/XMLSchema.xsd"),
12 XML_1998("xml", "http://www.w3.org/XML/1998/namespace", "xml.xsd", "http://www.w3.org/2001/xml.xsd"),
14 XLINK_1999("xlink", "http://www.w3.org/1999/xlink", "xlink.xsd", "http://www.w3.org/XML/2008/06/xlink.xsd"),
16 XSLT_2_0("xsl", "http://www.w3.org/1999/XSL/Transform", "schema-for-xslt20.xsd", "https://www.w3.org/2007/schema-for-xslt20.xsd"),
18 SVG_1_1("svg", "http://www.w3.org/2000/svg", "SVG.xsd",
19 "https://raw.githubusercontent.com/oreillymedia/HTMLBook/master/schema/svg/SVG.xsd"),
21 DOCBOOK_5_0_1("dbk","http://docbook.org/ns/docbook","docbook.xsd","http://docbook.org/xml/5.0.1/xsd/docbook.xsd"),
23 XML_EVENTS_2001("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_2002("xforms", "http://www.w3.org/2002/xforms", "XForms-11-Schema.xsd",
27 "https://www.w3.org/MarkUp/Forms/2007/XForms-11-Schema.xsd"),
29 DSML_v2("dsml", "urn:oasis:names:tc:DSML:2:0:core", "DSMLv2.xsd",
30 "https://www.oasis-open.org/committees/dsml/docs/DSMLv2.xsd"),
34 private final static String RESOURCE_BASE
= "/org/argeo/cms/acr/schemas/";
36 private String defaultPrefix
;
37 private String namespace
;
39 private URL publicUrl
;
41 CmsContentTypes(String defaultPrefix
, String namespace
, String resourceFileName
, String publicUrl
) {
42 Objects
.requireNonNull(namespace
);
43 this.defaultPrefix
= defaultPrefix
;
44 Objects
.requireNonNull(namespace
);
45 this.namespace
= namespace
;
46 resource
= getClass().getResource(RESOURCE_BASE
+ resourceFileName
);
47 Objects
.requireNonNull(resource
);
48 if (publicUrl
!= null)
50 this.publicUrl
= new URL(publicUrl
);
51 } catch (MalformedURLException e
) {
52 throw new IllegalArgumentException("Cannot interpret public URL", e
);
56 public String
getDefaultPrefix() {
60 public String
getNamespace() {
64 public URL
getResource() {
68 public URL
getPublicUrl() {