summaryrefslogtreecommitdiff
path: root/BKUViewer/src/main/java/at/gv
diff options
context:
space:
mode:
Diffstat (limited to 'BKUViewer/src/main/java/at/gv')
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java251
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java95
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundColorSLXHTML.java57
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java93
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderBottomColorSLXHTML.java57
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderColorSLXHTML.java81
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderLeftColorSLXHTML.java57
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderRightColorSLXHTML.java57
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java85
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderTopColorSLXHTML.java57
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java99
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java59
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssLetterSpacingSLXHTML.java54
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginBottomSLXHTML.java60
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java61
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginRightSLXHTML.java60
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java101
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java61
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingBottomSLXHTML.java60
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingLeftSLXHTML.java60
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingRightSLXHTML.java60
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java102
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java61
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssTextDecorationSLXHTML.java51
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssWordSpacingSLXHTML.java54
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLInvalidParamException.java71
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java22
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/TableLayoutSLXHTML.java45
-rw-r--r--BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java32
29 files changed, 2063 insertions, 0 deletions
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java
new file mode 100644
index 00000000..7ce5fdbe
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java
@@ -0,0 +1,251 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.nio.charset.IllegalCharsetNameException;
+import java.nio.charset.UnsupportedCharsetException;
+import java.util.Locale;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.ValidatorHandler;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import at.gv.egiz.bku.slxhtml.css.CSSValidatorSLXHTML;
+import at.gv.egiz.bku.viewer.ValidationException;
+
+public class SLXHTMLValidator implements at.gv.egiz.bku.viewer.Validator {
+
+ /**
+ * The schema file for the SLXHTML schema.
+ */
+ private static final String SLXHTML_SCHEMA_FILE = "at/gv/egiz/bku/slxhtml/slxhtml.xsd";
+
+ /**
+ * Logging facility.
+ */
+ private static Log log = LogFactory.getLog(SLXHTMLValidator.class);
+
+ private static Schema slSchema;
+
+ /**
+ * Initialize the security layer schema.
+ */
+ private synchronized static void ensureSchema() {
+ if (slSchema == null) {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ ClassLoader cl = SLXHTMLValidator.class.getClassLoader();
+ URL schemaURL = cl.getResource(SLXHTML_SCHEMA_FILE);
+ log.debug("Trying to create SLXHTML schema from URL '" + schemaURL + "'.");
+ long t0 = System.currentTimeMillis();
+ slSchema = schemaFactory.newSchema(schemaURL);
+ long t1 = System.currentTimeMillis();
+ log.debug("SLXHTML schema successfully created in " + (t1 - t0) + "ms.");
+ } catch (SAXException e) {
+ log.error("Failed to load security layer XHTML schema.", e);
+ throw new RuntimeException("Failed to load security layer XHTML schema.", e);
+ }
+
+ }
+ }
+
+ public SLXHTMLValidator() {
+ ensureSchema();
+ }
+
+ public void validate(InputStream is, String charset)
+ throws ValidationException {
+ if (charset == null) {
+ validate(is, (Charset) null);
+ } else {
+ try {
+ validate(is, Charset.forName(charset));
+ } catch (IllegalCharsetNameException e) {
+ throw new ValidationException(e);
+ } catch (UnsupportedCharsetException e) {
+ throw new ValidationException(e);
+ }
+ }
+ }
+
+ public void validate(InputStream is, Charset charset) throws ValidationException {
+
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setSchema(slSchema);
+ spf.setValidating(true);
+ spf.setXIncludeAware(false);
+
+ SAXParser parser;
+ try {
+ parser = spf.newSAXParser();
+ } catch (ParserConfigurationException e) {
+ log.error("Failed to create SLXHTML parser.", e);
+ throw new RuntimeException("Failed to create SLXHTML parser.", e);
+ } catch (SAXException e) {
+ log.error("Failed to create SLXHTML parser.", e);
+ throw new RuntimeException("Failed to create SLXHTML parser.", e);
+ }
+
+ InputSource source;
+ if (charset != null) {
+ source = new InputSource(new InputStreamReader(is, charset));
+ } else {
+ source = new InputSource(is);
+ }
+
+
+ ValidatorHandler validatorHandler = slSchema.newValidatorHandler();
+
+ DefaultHandler defaultHandler = new ValidationHandler(validatorHandler);
+ try {
+ parser.parse(source, defaultHandler);
+ } catch (SAXException e) {
+ if (e.getException() instanceof ValidationException) {
+ throw (ValidationException) e.getException();
+ } else {
+ throw new ValidationException(e);
+ }
+ } catch (IOException e) {
+ throw new ValidationException(e);
+ }
+
+ }
+
+ private void validateCss(InputStream is) throws ValidationException {
+ CSSValidatorSLXHTML cssValidator = new CSSValidatorSLXHTML();
+ // TODO: use the right locale
+ cssValidator.validate(is, Locale.getDefault(), "SLXHTML", 0);
+ }
+
+ private class ValidationHandler extends DefaultHandler implements ContentHandler {
+
+ private ValidatorHandler validatorHandler;
+
+ private boolean insideStyle = false;
+
+ private StringBuffer style = new StringBuffer();
+
+ private ValidationHandler(ValidatorHandler contentHandler) {
+ this.validatorHandler = contentHandler;
+ }
+
+ @Override
+ public void endDocument() throws SAXException {
+ validatorHandler.endDocument();
+ }
+
+ @Override
+ public void endPrefixMapping(String prefix) throws SAXException {
+ validatorHandler.endPrefixMapping(prefix);
+ }
+
+ @Override
+ public void ignorableWhitespace(char[] ch, int start, int length)
+ throws SAXException {
+ validatorHandler.ignorableWhitespace(ch, start, length);
+ }
+
+ @Override
+ public void processingInstruction(String target, String data)
+ throws SAXException {
+ validatorHandler.processingInstruction(target, data);
+ }
+
+ @Override
+ public void setDocumentLocator(Locator locator) {
+ validatorHandler.setDocumentLocator(locator);
+ }
+
+ @Override
+ public void skippedEntity(String name) throws SAXException {
+ validatorHandler.skippedEntity(name);
+ }
+
+ @Override
+ public void startDocument() throws SAXException {
+ validatorHandler.startDocument();
+ }
+
+ @Override
+ public void startPrefixMapping(String prefix, String uri)
+ throws SAXException {
+ validatorHandler.startPrefixMapping(prefix, uri);
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String name,
+ Attributes attributes) throws SAXException {
+ validatorHandler.startElement(uri, localName, name, attributes);
+
+ System.out.println(uri + ":" + localName);
+
+ if ("http://www.w3.org/1999/xhtml".equals(uri) &&
+ "style".equals(localName)) {
+ insideStyle = true;
+ }
+ }
+
+ @Override
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ validatorHandler.characters(ch, start, length);
+
+ if (insideStyle) {
+ style.append(ch, start, length);
+ }
+
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String name)
+ throws SAXException {
+ validatorHandler.endElement(uri, localName, name);
+
+ if (insideStyle) {
+ insideStyle = false;
+ try {
+ validateCss(new ByteArrayInputStream(style.toString().getBytes(Charset.forName("UTF-8"))));
+ } catch (ValidationException e) {
+ throw new SAXException(e);
+ }
+ }
+ }
+
+ }
+
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java
new file mode 100644
index 00000000..7abe4741
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java
@@ -0,0 +1,95 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Locale;
+
+import org.w3c.css.css.CssParser;
+import org.w3c.css.css.StyleSheet;
+import org.w3c.css.css.StyleSheetParser;
+import org.w3c.css.parser.CssError;
+import org.w3c.css.parser.Errors;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.Util;
+import org.w3c.css.util.Warning;
+import org.w3c.css.util.Warnings;
+
+import at.gv.egiz.bku.viewer.ValidationException;
+
+public class CSSValidatorSLXHTML {
+
+ public void validate(InputStream input, Locale locale, String title, int lineno) throws ValidationException {
+
+ // disable imports
+ Util.importSecurity = true;
+
+ CssParser cssParser = new StyleSheetParser();
+
+ ApplContext ac = new ApplContext(locale.getLanguage());
+ ac.setCssVersion("slxhtml");
+ ac.setMedium("all");
+
+ URL url;
+ try {
+ url = new URL("http://test.xyz");
+ } catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ }
+
+ cssParser.parseStyleElement(ac, input, title, "all", url, lineno);
+
+ StyleSheet styleSheet = cssParser.getStyleSheet();
+
+ // find conflicts
+ styleSheet.findConflicts(ac);
+
+ boolean valid = true;
+ StringBuilder sb = new StringBuilder().append("CSS:");
+
+ // look for errors
+ Errors errors = styleSheet.getErrors();
+ if (errors.getErrorCount() != 0) {
+ valid = false;
+ CssError[] cssErrors = errors.getErrors();
+ for (CssError cssError : cssErrors) {
+ Exception exception = cssError.getException();
+ sb.append(" ");
+ sb.append(exception.getMessage());
+ }
+ }
+
+ // look for warnings
+ Warnings warnings = styleSheet.getWarnings();
+ if (warnings.getWarningCount() != 0) {
+ valid = false;
+ Warning[] cssWarnings = warnings.getWarnings();
+ for (Warning warning : cssWarnings) {
+ sb.append(" ");
+ sb.append(warning.getWarningMessage());
+ }
+ }
+
+ if (!valid) {
+ throw new ValidationException(sb.toString());
+ }
+
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundColorSLXHTML.java
new file mode 100644
index 00000000..53191d17
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundColorSLXHTML.java
@@ -0,0 +1,57 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssBackgroundColorCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+public class CssBackgroundColorSLXHTML extends CssBackgroundColorCSS2 {
+
+ public CssBackgroundColorSLXHTML() {
+ }
+
+ public CssBackgroundColorSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ CssValue color = getColor();
+ if (!isSoftlyInherited() && color != null) {
+ if (CssColorSLXHTML.isDisallowedColor(color)) {
+ throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssBackgroundColorSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ super(ac, expression);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java
new file mode 100644
index 00000000..724c8c6a
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java
@@ -0,0 +1,93 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+/**
+ *
+ */
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssBackgroundCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+/**
+ * @author mcentner
+ *
+ */
+public class CssBackgroundSLXHTML extends CssBackgroundCSS2 {
+
+ public CssBackgroundSLXHTML() {
+ }
+
+ public CssBackgroundSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ CssValue color = getColor();
+ if (!isSoftlyInherited() && color != null) {
+ if (CssColorSLXHTML.isDisallowedColor(color)) {
+ throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac);
+ }
+ }
+
+ // The properties for selecting and controlling an image as background
+ // (background-image, background-repeat, background-position,
+ // background-attachment; cf. [CSS 2], section 14.2.1) must not be contained
+ // in an instance document to prevent content from overlapping. Otherwise
+ // the instance document must be rejected by the Citizen Card Environment.
+ //
+ // The property for the shorthand version of the background properties
+ // (background) should be supported by a Citizen Card Environment. The
+ // recommended values result from the explanations for the background-color
+ // property above (cf. [CSS 2], section 14.2.1). If the property contains
+ // values for selecting and controlling an image as background, the instance
+ // document must be rejected by the Citizen Card Environment.
+
+ if (getImage() != null) {
+ throw new SLXHTMLInvalidParamException("background", "background-image", ac);
+ }
+
+ if (getRepeat() != null) {
+ throw new SLXHTMLInvalidParamException("background", "background-repeat", ac);
+ }
+
+ if (getPosition() != null) {
+ throw new SLXHTMLInvalidParamException("background", "background-position", ac);
+ }
+
+ if (getAttachment() != null) {
+ throw new SLXHTMLInvalidParamException("background", "background-attachment", ac);
+ }
+
+ }
+
+ public CssBackgroundSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderBottomColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderBottomColorSLXHTML.java
new file mode 100644
index 00000000..4f5798b0
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderBottomColorSLXHTML.java
@@ -0,0 +1,57 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssBorderBottomColorCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+public class CssBorderBottomColorSLXHTML extends CssBorderBottomColorCSS2 {
+
+ public CssBorderBottomColorSLXHTML() {
+ }
+
+ public CssBorderBottomColorSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ CssValue color = getColor();
+ if (!isSoftlyInherited() && color != null) {
+ if (CssColorSLXHTML.isDisallowedColor(color)) {
+ throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssBorderBottomColorSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderColorSLXHTML.java
new file mode 100644
index 00000000..3f5a7319
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderColorSLXHTML.java
@@ -0,0 +1,81 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssBorderBottomColorCSS2;
+import org.w3c.css.properties.css1.CssBorderColorCSS2;
+import org.w3c.css.properties.css1.CssBorderLeftColorCSS2;
+import org.w3c.css.properties.css1.CssBorderRightColorCSS2;
+import org.w3c.css.properties.css1.CssBorderTopColorCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssBorderColorSLXHTML extends CssBorderColorCSS2 {
+
+ public CssBorderColorSLXHTML() {
+ }
+
+ public CssBorderColorSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ CssBorderTopColorCSS2 top = getTop();
+ if (!isSoftlyInherited() && top != null) {
+ if (CssColorSLXHTML.isDisallowedColor(top.getColor())) {
+ throw new SLXHTMLInvalidParamException("color", top.getColor(), getPropertyName(), ac);
+ }
+ }
+
+ CssBorderLeftColorCSS2 left = getLeft();
+ if (!isSoftlyInherited() && left != null) {
+ if (CssColorSLXHTML.isDisallowedColor(left.getColor())) {
+ throw new SLXHTMLInvalidParamException("color", left.getColor(), getPropertyName(), ac);
+ }
+ }
+
+ CssBorderRightColorCSS2 right = getRight();
+ if (!isSoftlyInherited() && right != null) {
+ if (CssColorSLXHTML.isDisallowedColor(right.getColor())) {
+ throw new SLXHTMLInvalidParamException("color", right.getColor(), getPropertyName(), ac);
+ }
+ }
+
+ CssBorderBottomColorCSS2 bottom = getBottom();
+ if (!isSoftlyInherited() && bottom != null) {
+ if (CssColorSLXHTML.isDisallowedColor(bottom.getColor())) {
+ throw new SLXHTMLInvalidParamException("color", bottom.getColor(), getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssBorderColorSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderLeftColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderLeftColorSLXHTML.java
new file mode 100644
index 00000000..e2378e99
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderLeftColorSLXHTML.java
@@ -0,0 +1,57 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssBorderLeftColorCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+public class CssBorderLeftColorSLXHTML extends CssBorderLeftColorCSS2 {
+
+ public CssBorderLeftColorSLXHTML() {
+ }
+
+ public CssBorderLeftColorSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ CssValue color = getColor();
+ if (!isSoftlyInherited() && color != null) {
+ if (CssColorSLXHTML.isDisallowedColor(color)) {
+ throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssBorderLeftColorSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderRightColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderRightColorSLXHTML.java
new file mode 100644
index 00000000..99d6bae5
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderRightColorSLXHTML.java
@@ -0,0 +1,57 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssBorderRightColorCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+public class CssBorderRightColorSLXHTML extends CssBorderRightColorCSS2 {
+
+ public CssBorderRightColorSLXHTML() {
+ }
+
+ public CssBorderRightColorSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ CssValue color = getColor();
+ if (!isSoftlyInherited() && color != null) {
+ if (CssColorSLXHTML.isDisallowedColor(color)) {
+ throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssBorderRightColorSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java
new file mode 100644
index 00000000..ac32670e
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java
@@ -0,0 +1,85 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssBorderCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+public class CssBorderSLXHTML extends CssBorderCSS2 {
+
+ public CssBorderSLXHTML() {
+ }
+
+ public CssBorderSLXHTML(ApplContext ac, CssExpression value, boolean check)
+ throws InvalidParamException {
+ super(ac, value, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ if (getTop() != null) {
+ CssValue top = getTop().getColor();
+ if (!isSoftlyInherited() && top != null) {
+ if (CssColorSLXHTML.isDisallowedColor(top)) {
+ throw new SLXHTMLInvalidParamException("color", top, getPropertyName(), ac);
+ }
+ }
+ }
+
+ if (getLeft() != null) {
+ CssValue left = getLeft().getColor();
+ if (!isSoftlyInherited() && left != null) {
+ if (CssColorSLXHTML.isDisallowedColor(left)) {
+ throw new SLXHTMLInvalidParamException("color", left, getPropertyName(), ac);
+ }
+ }
+ }
+
+ if (getRight() != null) {
+ CssValue right = getRight().getColor();
+ if (!isSoftlyInherited() && right != null) {
+ if (CssColorSLXHTML.isDisallowedColor(right)) {
+ throw new SLXHTMLInvalidParamException("color", right, getPropertyName(), ac);
+ }
+ }
+ }
+
+ if (getBottom() != null) {
+ CssValue bottom = getBottom().getColor();
+ if (!isSoftlyInherited() && bottom != null) {
+ if (CssColorSLXHTML.isDisallowedColor(bottom)) {
+ throw new SLXHTMLInvalidParamException("color", bottom, getPropertyName(), ac);
+ }
+ }
+ }
+ }
+
+ public CssBorderSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderTopColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderTopColorSLXHTML.java
new file mode 100644
index 00000000..42926479
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderTopColorSLXHTML.java
@@ -0,0 +1,57 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssBorderTopColorCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+public class CssBorderTopColorSLXHTML extends CssBorderTopColorCSS2 {
+
+ public CssBorderTopColorSLXHTML() {
+ }
+
+ public CssBorderTopColorSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ CssValue color = getColor();
+ if (!isSoftlyInherited() && color != null) {
+ if (CssColorSLXHTML.isDisallowedColor(color)) {
+ throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssBorderTopColorSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java
new file mode 100644
index 00000000..a640eb3a
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java
@@ -0,0 +1,99 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+public class CssColorSLXHTML extends org.w3c.css.properties.css1.CssColorCSS2 {
+
+ private static Set<String> SLXHTML_DISSALLOWED_COLORS = new HashSet<String>();
+
+ static {
+
+ SLXHTML_DISSALLOWED_COLORS.add("activeborder");
+ SLXHTML_DISSALLOWED_COLORS.add("activecaption");
+ SLXHTML_DISSALLOWED_COLORS.add("appworkspace");
+ SLXHTML_DISSALLOWED_COLORS.add("background");
+ SLXHTML_DISSALLOWED_COLORS.add("buttonface");
+ SLXHTML_DISSALLOWED_COLORS.add("buttonhighlight");
+ SLXHTML_DISSALLOWED_COLORS.add("buttonshadow");
+ SLXHTML_DISSALLOWED_COLORS.add("buttontext");
+ SLXHTML_DISSALLOWED_COLORS.add("captiontext");
+ SLXHTML_DISSALLOWED_COLORS.add("graytext");
+ SLXHTML_DISSALLOWED_COLORS.add("highlight");
+ SLXHTML_DISSALLOWED_COLORS.add("highlighttext");
+ SLXHTML_DISSALLOWED_COLORS.add("inactiveborder");
+ SLXHTML_DISSALLOWED_COLORS.add("inactivecaption");
+ SLXHTML_DISSALLOWED_COLORS.add("inactivecaptiontext");
+ SLXHTML_DISSALLOWED_COLORS.add("infobackground");
+ SLXHTML_DISSALLOWED_COLORS.add("infotext");
+ SLXHTML_DISSALLOWED_COLORS.add("menu");
+ SLXHTML_DISSALLOWED_COLORS.add("menutext");
+ SLXHTML_DISSALLOWED_COLORS.add("scrollbar");
+ SLXHTML_DISSALLOWED_COLORS.add("threeddarkshadow");
+ SLXHTML_DISSALLOWED_COLORS.add("threedface");
+ SLXHTML_DISSALLOWED_COLORS.add("threedhighlight");
+ SLXHTML_DISSALLOWED_COLORS.add("threedlightshadow");
+ SLXHTML_DISSALLOWED_COLORS.add("threedshadow");
+ SLXHTML_DISSALLOWED_COLORS.add("window");
+ SLXHTML_DISSALLOWED_COLORS.add("windowframe");
+ SLXHTML_DISSALLOWED_COLORS.add("windowtext");
+
+ }
+
+ public static boolean isDisallowedColor(CssValue cssValue) {
+ return SLXHTML_DISSALLOWED_COLORS.contains(cssValue.toString().toLowerCase());
+ }
+
+ public CssColorSLXHTML() {
+ }
+
+ public CssColorSLXHTML(ApplContext ac, CssExpression expression, boolean check)
+ throws InvalidParamException {
+
+ super(ac, expression, check);
+
+ // A Citizen Card Environment must support all the options for specifying a
+ // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an
+ // option is available for this property according to [CSS 2].
+
+ // The exceptions are the system colours (cf. [CSS 2], section 18.2); these
+ // must not be used in an instance document so as to prevent dependencies on
+ // the system environment. Otherwise the instance document must be rejected
+ // by the Citizen Card Environment.
+
+ CssValue color = getColor();
+ if (!isSoftlyInherited() && color != null) {
+ if (CssColorSLXHTML.isDisallowedColor(color)) {
+ throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssColorSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java
new file mode 100644
index 00000000..8e5298ec
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java
@@ -0,0 +1,59 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssFontCSS2;
+import org.w3c.css.properties.css1.CssFontConstantCSS2;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssIdent;
+import org.w3c.css.values.CssValue;
+
+public class CssFontSLXHTML extends CssFontCSS2 {
+
+ public CssFontSLXHTML() {
+ }
+
+ public CssFontSLXHTML(ApplContext ac, CssExpression expression, boolean check)
+ throws InvalidParamException {
+ super(ac, checkExpression(expression, ac), check);
+ }
+
+ public CssFontSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+ protected static CssExpression checkExpression(CssExpression expression,
+ ApplContext ac) throws InvalidParamException {
+
+ CssValue value = expression.getValue();
+
+ if (value instanceof CssIdent) {
+ for (String font : CssFontConstantCSS2.FONT) {
+ if (font.equalsIgnoreCase(value.toString())) {
+ throw new SLXHTMLInvalidParamException("font", value.toString(), ac);
+ }
+ }
+ }
+
+ return expression;
+
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssLetterSpacingSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssLetterSpacingSLXHTML.java
new file mode 100644
index 00000000..326a731f
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssLetterSpacingSLXHTML.java
@@ -0,0 +1,54 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssLetterSpacing;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssLength;
+import org.w3c.css.values.CssNumber;
+
+public class CssLetterSpacingSLXHTML extends CssLetterSpacing {
+
+ public CssLetterSpacingSLXHTML() {
+ }
+
+ public CssLetterSpacingSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ Object value = get();
+ if (value instanceof CssLength) {
+ Object length = ((CssLength) value).get();
+ if (length instanceof Float && ((Float) length).floatValue() < 0) {
+ throw new SLXHTMLInvalidParamException("spacing", length, getPropertyName(), ac);
+ }
+ } else if (value instanceof CssNumber) {
+ if (((CssNumber) value).getValue() < 0) {
+ throw new SLXHTMLInvalidParamException("spacing", value, getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssLetterSpacingSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginBottomSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginBottomSLXHTML.java
new file mode 100644
index 00000000..cac97d06
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginBottomSLXHTML.java
@@ -0,0 +1,60 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssMarginBottom;
+import org.w3c.css.properties.css1.CssMarginSide;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssMarginBottomSLXHTML extends CssMarginBottom {
+
+ public CssMarginBottomSLXHTML() {
+ }
+
+ public CssMarginBottomSLXHTML(CssMarginSide another) {
+ super(another);
+ }
+
+ public CssMarginBottomSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+ public CssMarginBottomSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // The margin-top, margin-bottom, margin-left and margin-right properties
+ // must be supported by a Citizen Card Environment. Values specified as
+ // percentages (cf. section 3.5.1.2) should be supported.
+
+ // The margin property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (CssMarginSLXHTML.isDisallowedMargin(getValue())) {
+ throw new SLXHTMLInvalidParamException("margin", getValue(),
+ getPropertyName(), ac);
+ }
+
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java
new file mode 100644
index 00000000..c456af43
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java
@@ -0,0 +1,61 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssMarginLeft;
+import org.w3c.css.properties.css1.CssMarginSide;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssMarginLeftSLXHTML extends CssMarginLeft {
+
+ public CssMarginLeftSLXHTML() {
+ }
+
+ public CssMarginLeftSLXHTML(CssMarginSide another) {
+ super(another);
+ }
+
+ public CssMarginLeftSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+ public CssMarginLeftSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // TODO Auto-generated constructor stub
+ // The margin-top, margin-bottom, margin-left and margin-right properties
+ // must be supported by a Citizen Card Environment. Values specified as
+ // percentages (cf. section 3.5.1.2) should be supported.
+
+ // The margin property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (CssMarginSLXHTML.isDisallowedMargin(getValue())) {
+ throw new SLXHTMLInvalidParamException("margin", getValue(),
+ getPropertyName(), ac);
+ }
+
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginRightSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginRightSLXHTML.java
new file mode 100644
index 00000000..7f16830d
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginRightSLXHTML.java
@@ -0,0 +1,60 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssMarginRight;
+import org.w3c.css.properties.css1.CssMarginSide;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssMarginRightSLXHTML extends CssMarginRight {
+
+ public CssMarginRightSLXHTML() {
+ }
+
+ public CssMarginRightSLXHTML(CssMarginSide another) {
+ super(another);
+ }
+
+ public CssMarginRightSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+ public CssMarginRightSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // The margin-top, margin-bottom, margin-left and margin-right properties
+ // must be supported by a Citizen Card Environment. Values specified as
+ // percentages (cf. section 3.5.1.2) should be supported.
+
+ // The margin property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (CssMarginSLXHTML.isDisallowedMargin(getValue())) {
+ throw new SLXHTMLInvalidParamException("margin", getValue(),
+ getPropertyName(), ac);
+ }
+
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java
new file mode 100644
index 00000000..f478b96a
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java
@@ -0,0 +1,101 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssMargin;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssLength;
+import org.w3c.css.values.CssNumber;
+import org.w3c.css.values.CssPercentage;
+import org.w3c.css.values.CssValue;
+
+public class CssMarginSLXHTML extends CssMargin {
+
+ public CssMarginSLXHTML() {
+ }
+
+ public CssMarginSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ if (getTop() != null) {
+ if (isDisallowedMargin(getTop().getValue())) {
+ throw new SLXHTMLInvalidParamException("margin", getTop().getValue(),
+ getPropertyName(), ac);
+ }
+ }
+
+ if (getRight() != null) {
+ if (isDisallowedMargin(getRight().getValue())) {
+ throw new SLXHTMLInvalidParamException("margin", getRight().getValue(),
+ getPropertyName(), ac);
+ }
+ }
+
+ if (getLeft() != null) {
+ if (isDisallowedMargin(getLeft().getValue())) {
+ throw new SLXHTMLInvalidParamException("margin", getLeft().getValue(),
+ getPropertyName(), ac);
+ }
+ }
+
+ if (getBottom() != null) {
+ if (isDisallowedMargin(getBottom().getValue())) {
+ throw new SLXHTMLInvalidParamException("margin", getBottom().getValue(),
+ getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssMarginSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+ public static boolean isDisallowedMargin(CssValue margin) {
+
+ // The margin-top, margin-bottom, margin-left and margin-right properties
+ // must be supported by a Citizen Card Environment. Values specified as
+ // percentages (cf. section 3.5.1.2) should be supported.
+
+ // The margin property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (margin instanceof CssLength) {
+ Object value = ((CssLength) margin).get();
+ if (value instanceof Float) {
+ return ((Float) value).floatValue() < 0;
+ }
+ } else if (margin instanceof CssPercentage) {
+ Object value = ((CssPercentage) margin).get();
+ if (value instanceof Float) {
+ return ((Float) value).floatValue() < 0;
+ }
+ } else if (margin instanceof CssNumber) {
+ return ((CssNumber) margin).getValue() < 0;
+ }
+
+ return false;
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java
new file mode 100644
index 00000000..06b30c4f
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java
@@ -0,0 +1,61 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssMarginSide;
+import org.w3c.css.properties.css1.CssMarginTop;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssMarginTopSLXHTML extends CssMarginTop {
+
+ public CssMarginTopSLXHTML() {
+ }
+
+ public CssMarginTopSLXHTML(CssMarginSide another) {
+ super(another);
+ }
+
+ public CssMarginTopSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+
+ }
+
+ public CssMarginTopSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // The margin-top, margin-bottom, margin-left and margin-right properties
+ // must be supported by a Citizen Card Environment. Values specified as
+ // percentages (cf. section 3.5.1.2) should be supported.
+
+ // The margin property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (CssMarginSLXHTML.isDisallowedMargin(getValue())) {
+ throw new SLXHTMLInvalidParamException("margin", getValue(),
+ getPropertyName(), ac);
+ }
+
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingBottomSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingBottomSLXHTML.java
new file mode 100644
index 00000000..4bcb0065
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingBottomSLXHTML.java
@@ -0,0 +1,60 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssPaddingBottom;
+import org.w3c.css.properties.css1.CssPaddingSide;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssPaddingBottomSLXHTML extends CssPaddingBottom {
+
+ public CssPaddingBottomSLXHTML() {
+ }
+
+ public CssPaddingBottomSLXHTML(CssPaddingSide another) {
+ super(another);
+ }
+
+ public CssPaddingBottomSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // The padding-top, padding-bottom, padding-left and padding-right
+ // properties must be supported by a Citizen Card Environment. Values
+ // specified as percentages (cf. section 3.5.1.2) should be supported.
+
+ // The padding property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (CssPaddingSLXHTML.isDisallowedValue(getValue())) {
+ throw new SLXHTMLInvalidParamException("padding", getValue(),
+ getPropertyName(), ac);
+ }
+
+ }
+
+ public CssPaddingBottomSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingLeftSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingLeftSLXHTML.java
new file mode 100644
index 00000000..350a5c15
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingLeftSLXHTML.java
@@ -0,0 +1,60 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssPaddingLeft;
+import org.w3c.css.properties.css1.CssPaddingSide;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssPaddingLeftSLXHTML extends CssPaddingLeft {
+
+ public CssPaddingLeftSLXHTML() {
+ }
+
+ public CssPaddingLeftSLXHTML(CssPaddingSide another) {
+ super(another);
+ }
+
+ public CssPaddingLeftSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // The padding-top, padding-bottom, padding-left and padding-right
+ // properties must be supported by a Citizen Card Environment. Values
+ // specified as percentages (cf. section 3.5.1.2) should be supported.
+
+ // The padding property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (CssPaddingSLXHTML.isDisallowedValue(getValue())) {
+ throw new SLXHTMLInvalidParamException("padding", getValue(),
+ getPropertyName(), ac);
+ }
+
+ }
+
+ public CssPaddingLeftSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingRightSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingRightSLXHTML.java
new file mode 100644
index 00000000..d2d62748
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingRightSLXHTML.java
@@ -0,0 +1,60 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssPaddingRight;
+import org.w3c.css.properties.css1.CssPaddingSide;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssPaddingRightSLXHTML extends CssPaddingRight {
+
+ public CssPaddingRightSLXHTML() {
+ }
+
+ public CssPaddingRightSLXHTML(CssPaddingSide another) {
+ super(another);
+ }
+
+ public CssPaddingRightSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // The padding-top, padding-bottom, padding-left and padding-right
+ // properties must be supported by a Citizen Card Environment. Values
+ // specified as percentages (cf. section 3.5.1.2) should be supported.
+
+ // The padding property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (CssPaddingSLXHTML.isDisallowedValue(getValue())) {
+ throw new SLXHTMLInvalidParamException("padding", getValue(),
+ getPropertyName(), ac);
+ }
+
+ }
+
+ public CssPaddingRightSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java
new file mode 100644
index 00000000..57d7cf77
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java
@@ -0,0 +1,102 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssPadding;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssLength;
+import org.w3c.css.values.CssNumber;
+import org.w3c.css.values.CssPercentage;
+import org.w3c.css.values.CssValue;
+
+public class CssPaddingSLXHTML extends CssPadding {
+
+ public CssPaddingSLXHTML() {
+ }
+
+ public CssPaddingSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ if (getTop() != null) {
+ if (isDisallowedValue(getTop().getValue())) {
+ throw new SLXHTMLInvalidParamException("padding", getTop().getValue(),
+ getPropertyName(), ac);
+ }
+ }
+
+ if (getRight() != null) {
+ if (isDisallowedValue(getRight().getValue())) {
+ throw new SLXHTMLInvalidParamException("padding", getRight().getValue(),
+ getPropertyName(), ac);
+ }
+ }
+
+ if (getLeft() != null) {
+ if (isDisallowedValue(getLeft().getValue())) {
+ throw new SLXHTMLInvalidParamException("padding", getLeft().getValue(),
+ getPropertyName(), ac);
+ }
+ }
+
+ if (getBottom() != null) {
+ if (isDisallowedValue(getBottom().getValue())) {
+ throw new SLXHTMLInvalidParamException("padding", getBottom().getValue(),
+ getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssPaddingSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+ public static boolean isDisallowedValue(CssValue padding) {
+
+ // The padding-top, padding-bottom, padding-left and padding-right
+ // properties must be supported by a Citizen Card Environment. Values
+ // specified as percentages (cf. section 3.5.1.2) should be supported.
+
+ // The padding property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (padding instanceof CssLength) {
+ Object value = ((CssLength) padding).get();
+ if (value instanceof Float) {
+ return ((Float) value).floatValue() < 0;
+ }
+ } else if (padding instanceof CssPercentage) {
+ Object value = ((CssPercentage) padding).get();
+ if (value instanceof Float) {
+ return ((Float) value).floatValue() < 0;
+ }
+ } else if (padding instanceof CssNumber) {
+ return ((CssNumber) padding).getValue() < 0;
+ }
+
+ return false;
+
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java
new file mode 100644
index 00000000..bc113bfe
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java
@@ -0,0 +1,61 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssPaddingSide;
+import org.w3c.css.properties.css1.CssPaddingTop;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+
+public class CssPaddingTopSLXHTML extends CssPaddingTop {
+
+ public CssPaddingTopSLXHTML() {
+ }
+
+ public CssPaddingTopSLXHTML(CssPaddingSide another) {
+ super(another);
+ }
+
+ public CssPaddingTopSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ // The padding-top, padding-bottom, padding-left and padding-right
+ // properties must be supported by a Citizen Card Environment. Values
+ // specified as percentages (cf. section 3.5.1.2) should be supported.
+
+ // The padding property may be supported by a Citizen Card Environment.
+
+ // An instance document must not contain a negative value in the properties
+ // mentioned above. Otherwise it must be rejected by the Citizen Card
+ // Environment.
+
+ if (CssPaddingSLXHTML.isDisallowedValue(getValue())) {
+ throw new SLXHTMLInvalidParamException("padding", getValue(),
+ getPropertyName(), ac);
+ }
+
+ }
+
+ public CssPaddingTopSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ super(ac, expression);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssTextDecorationSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssTextDecorationSLXHTML.java
new file mode 100644
index 00000000..16b9780a
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssTextDecorationSLXHTML.java
@@ -0,0 +1,51 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssTextDecoration;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssValue;
+
+public class CssTextDecorationSLXHTML extends CssTextDecoration {
+
+ public CssTextDecorationSLXHTML() {
+ }
+
+ public CssTextDecorationSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ if (get() instanceof CssValue) {
+ if ("blink".equalsIgnoreCase(((CssValue) get()).toString())) {
+ throw new SLXHTMLInvalidParamException("text-decoration", "blink", ac);
+ }
+ } else if (get() instanceof String) {
+ if ("blink".equalsIgnoreCase((String) get())) {
+ throw new SLXHTMLInvalidParamException("text-decoration", "blink", ac);
+ }
+ }
+
+ }
+
+ public CssTextDecorationSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssWordSpacingSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssWordSpacingSLXHTML.java
new file mode 100644
index 00000000..a497f4e3
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssWordSpacingSLXHTML.java
@@ -0,0 +1,54 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css1.CssWordSpacing;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssLength;
+import org.w3c.css.values.CssNumber;
+
+public class CssWordSpacingSLXHTML extends CssWordSpacing {
+
+ public CssWordSpacingSLXHTML() {
+ }
+
+ public CssWordSpacingSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ Object value = get();
+ if (value instanceof CssLength) {
+ Object length = ((CssLength) value).get();
+ if (length instanceof Float && ((Float) length).floatValue() < 0) {
+ throw new SLXHTMLInvalidParamException("spacing", length, getPropertyName(), ac);
+ }
+ } else if (value instanceof CssNumber) {
+ if (((CssNumber) value).getValue() < 0) {
+ throw new SLXHTMLInvalidParamException("spacing", value, getPropertyName(), ac);
+ }
+ }
+
+ }
+
+ public CssWordSpacingSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLInvalidParamException.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLInvalidParamException.java
new file mode 100644
index 00000000..edac03f4
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLInvalidParamException.java
@@ -0,0 +1,71 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.w3c.css.util.ApplContext;
+
+public class SLXHTMLInvalidParamException extends
+ org.w3c.css.util.InvalidParamException {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String message;
+
+ public SLXHTMLInvalidParamException() {
+ }
+
+ public SLXHTMLInvalidParamException(String error, ApplContext ac) {
+ setMessage(error, null, ac);
+ }
+
+ public SLXHTMLInvalidParamException(String error, Object message, ApplContext ac) {
+ setMessage(error, new Object[] {message}, ac);
+ }
+
+ public SLXHTMLInvalidParamException(String error, Object message1, Object message2,
+ ApplContext ac) {
+ setMessage(error, new Object[] {message1, message2}, ac);
+ }
+
+ @Override
+ public String getMessage() {
+ return getLocalizedMessage();
+ }
+
+ @Override
+ public String getLocalizedMessage() {
+ return message;
+ }
+
+ protected void setMessage(String error, Object[] arguments, ApplContext ac) {
+ Locale locale = new Locale(ac.getContentLanguage());
+ ResourceBundle bundle = ResourceBundle.getBundle("at/gv/egiz/bku/slxhtml/css/Messages", locale);
+ String pattern;
+ try {
+ pattern = bundle.getString(error);
+ } catch (MissingResourceException e) {
+ pattern = "Can't find error message for : " + error;
+ }
+ message = MessageFormat.format(pattern, arguments);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java
new file mode 100644
index 00000000..99448ec4
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java
@@ -0,0 +1,22 @@
+//
+// $Id: Css2Style.java,v 1.2 2005-09-08 12:24:01 ylafon Exp $
+// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
+//
+// (c) COPYRIGHT MIT and INRIA, 1997.
+// Please first read the full copyright statement in file COPYRIGHT.html
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.aural.ACssStyle;
+import org.w3c.css.parser.CssPrinterStyle;
+
+/**
+ * @version $Revision: 1.2 $
+ */
+public class SLXHTMLStyle extends ACssStyle {
+
+ public void print(CssPrinterStyle printer) {
+ super.print(printer);
+ }
+
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/TableLayoutSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/TableLayoutSLXHTML.java
new file mode 100644
index 00000000..50f30cce
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/TableLayoutSLXHTML.java
@@ -0,0 +1,45 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.slxhtml.css;
+
+import org.w3c.css.properties.css2.table.TableLayout;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssIdent;
+
+public class TableLayoutSLXHTML extends TableLayout {
+
+ public TableLayoutSLXHTML() {
+ }
+
+ public TableLayoutSLXHTML(ApplContext ac, CssExpression expression,
+ boolean check) throws InvalidParamException {
+ super(ac, expression, check);
+
+ if (new CssIdent("fixed").equals(get())) {
+ throw new SLXHTMLInvalidParamException("table-layout", "fixed", getPropertyName(), ac);
+ }
+
+ }
+
+ public TableLayoutSLXHTML(ApplContext ac, CssExpression expression)
+ throws InvalidParamException {
+ this(ac, expression, false);
+ }
+
+}
diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java b/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java
new file mode 100644
index 00000000..5108140d
--- /dev/null
+++ b/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java
@@ -0,0 +1,32 @@
+/*
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egiz.bku.text;
+
+import java.io.InputStream;
+
+import at.gv.egiz.bku.viewer.ValidationException;
+import at.gv.egiz.bku.viewer.Validator;
+
+public class TextValidator implements Validator {
+
+ @Override
+ public void validate(InputStream is, String charset)
+ throws ValidationException {
+ // TODO: implement character validation
+ }
+
+}