Examples of XDIMEException


Examples of com.volantis.mcs.xdime.XDIMEException

        String transformation = attributes.getValue("","transformation");       
        URI transURI = null;
        try {
            transURI = new URI(transformation);
        } catch (URISyntaxException e) {
              throw new XDIMEException(exceptionLocalizer.format(
                "xdime-attribute-value-invalid", new String[] {transformation, "transformation in widget:fetch element"}), e);
        }
       
        return rewriteURLWithPageURLRewriter(context, transURI.toString(), PageURLType.WIDGET);
    }
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

            // get the property handler
            propertyHandler =
                MetaPropertyHandlerFactory.getHandler(propertyName);
            if (propertyHandler == null) {
                throw new XDIMEException(LOCALIZER.format(
                    "no-meta-property-handler-registered", propertyName));
            }

            // get the content processor
            final String dataTypeAttrValue =
                ElementUtils.getAttributeValue(context, attributes,
                    XDIMESchemata.XHTML2_NAMESPACE, ATTR_NAME_DATA_TYPE);
            final ImmutableExpandedName dataType;
            if (dataTypeAttrValue == null || dataTypeAttrValue.length() == 0) {
                dataType = propertyHandler.getDefaultDataType().getExpandedName();
            } else {
                dataType = getAsExpandedName(dataTypeAttrValue, context);
            }
            contentProcessor =
                MetaContentProcessorFactory.getProcessor(dataType);
            if (contentProcessor == null) {
                throw new XDIMEException(LOCALIZER.format(
                    "no-meta-content-processor-registered", dataTypeAttrValue));
            }

            // check if this is the right property-data type pair
            if (!propertyHandler.isAcceptableType(contentProcessor.getType())) {
                throw new XDIMEException(LOCALIZER.format(
                    "invalid-type-for-meta-property",
                    new Object[]{dataTypeAttrValue, propertyName}));
            }

            contentProcessor.startProcess(context, this, attributes);
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

            XDIMESchemata.XHTML2_NAMESPACE, ATTR_NAME_ABOUT);
        if (result != null) {
            if (result.length() == 0) {
                result = null;
            } else if (!result.startsWith("#")) {
                throw new XDIMEException(LOCALIZER.format(
                    "invalid-meta-reference",
                    new Object[]{XDIMESchemata.XDIME2_MCS_NAMESPACE, result}));
            } else {
                result = result.substring(1);
            }
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

                // only set the result if the property has the right
                // namespace. It might be mcs, dc or default (empty) namespace
                localName = name.getLocalName();
            }           
        } else {
            throw new XDIMEException(LOCALIZER.format(
                    "illegal-meta-data-property-missing"));
        }
        return localName;
    }
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

        //check if start-time attribute is correct
        if (start_string!=null){
            try {
                start = new Integer(start_string);
            }catch (NumberFormatException e){
                throw new XDIMEException(exceptionLocalizer.format(
                        "widget-unexpected-attributes-type",
                        "int"), e);
            }
           
            if (start.intValue()<0){
                throw new XDIMEException(exceptionLocalizer.format(
                        "attribute-value-incorrect",
                        new Object[]{"start-time","start-time >= 0"}));
            }
        }

        //check if stop-time attribute is correct
        if (stop_string != null){
            try {
                stop = new Integer(stop_string);
            }catch (NumberFormatException e){
                throw new XDIMEException(exceptionLocalizer.format(
                        "widget-unexpected-attributes-type",
                        "int"), e);
            }
           
            if (stop.intValue()<0){
                throw new XDIMEException(exceptionLocalizer.format(
                        "attribute-value-incorrect",
                        new Object[]{"stop-time","stop-time >= 0"}));
            }  
        }
       
        if (start.intValue() < stop.intValue()){
            throw new XDIMEException(exceptionLocalizer.format(
                    "attribute-value-incorrect",
                    new Object[]{"start-time","start-time >= stop-time "}));
        }
       
        //attributes are ok
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

            protocol.writeOpenDefinitionData(
                (DefinitionDataAttributes)protocolAttributes);
        } catch (ProtocolException e) {
            logger.error("rendering-error", getTagName(), e);

            throw new XDIMEException(exceptionLocalizer.format(
                "rendering-error", getTagName()), e);
        }
        return XDIMEResult.PROCESS_ELEMENT_BODY;
    }
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

        try {
            protocol.writeOpenSpan((SpanAttributes)protocolAttributes);
        } catch (ProtocolException e) {
            logger.error("rendering-error", getTagName(), e);

            throw new XDIMEException(exceptionLocalizer.format(
                "rendering-error", getTagName()), e);
        }
        return XDIMEResult.PROCESS_ELEMENT_BODY;       
    }
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

        try {
            protocol.writeOpenHeading4((HeadingAttributes)protocolAttributes);
        } catch (ProtocolException e) {
            logger.error("rendering-error", getTagName(), e);

            throw new XDIMEException(exceptionLocalizer.format(
                "rendering-error", getTagName()), e);
        }
        return XDIMEResult.PROCESS_ELEMENT_BODY;       
    }
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

        // check the right type
        if (content != null) {
            checkContentType(content, String.class);
            if (((String) content).length() != 0) {
                throw new XDIMEException(LOCALIZER.format(
                    "empty-meta-content-expected", new Object[]{
                        MetaPropertyHandlerFactory.CACHE_AUTO, content}));
            }
        }
    }
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEException

            return new Integer(super.getResult().toString());
        } catch (NumberFormatException e) {
            // If string didn't parse to integer property, throw an exception
            // reusing existing localised message, saying that Integer was
            // expected, but String was encountered.
            throw new XDIMEException(LOCALIZER.format(
                "invalid-meta-content-type", new Object[] {
                    Integer.class.getName(), String.class.getName() }));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.