Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.ProtocolException


     */
    private static ScriptAttributes assetToAttributes(
            final ScriptAssetReference scriptReference) throws ProtocolException {
        final ScriptAsset scriptAsset = scriptReference.getScriptAsset();
        if (scriptAsset == null) {
           throw new ProtocolException(exceptionLocalizer.format(
                    "widget-missing-script-policy-variant"));
       
        final ScriptAttributes attributes = new ScriptAttributes();
        attributes.setCharSet(scriptAsset.getCharacterSet());
        attributes.setLanguage(scriptAsset.getProgrammingLanguage());
View Full Code Here


        // Write JavaScript content to DOM.
        try {
            getJavaScriptWriter().write(scriptWriter.toString());
        } catch (IOException e) {
            throw new ProtocolException(e);
        }
       
        scriptWriter = null;
    }   
View Full Code Here

        // Write JavaScript content to DOM.
        try {
            getJavaScriptWriter().write(scriptBuffer.toString());
        } catch (IOException e) {
            throw new ProtocolException(e);
        }

        getGalleryDefaultModule(protocol).itemDisplayRendered(id);
    }
View Full Code Here

        buffer.append("}))");
       
        try {
            getJavaScriptWriter().write(buffer.toString());
        } catch (IOException e) {
            throw new ProtocolException(e);
        }
       
        itemIds = null;
    }
View Full Code Here

            .append("))");
       
        try {
            getJavaScriptWriter().write(buffer.toString());
        } catch (IOException e) {
            throw new ProtocolException(e);
        }
       
        itemIds = null;
    }
View Full Code Here

        // Render label content
        if (null != labelContent) {
            if (labelContent instanceof StyleList) {
                StyleList contentList = (StyleList) labelContent;
                if (contentList.getList().isEmpty()) {
                    throw new ProtocolException(exceptionLocalizer
                            .format("widget-tab-label-empty-content"));
                }
                labelContent =  (StyleValue) contentList.getList().get(0);
                if (labelContent.getStyleValueType() == StyleValueType.STRING) {
                    textLabel = ((StyleString)labelContent).getString();
                } else {
                    textLabel = labelContent.getStandardCSS();
                }
            } else if (labelContent instanceof StyleComponentURI) {

                // Get asset and policy resolvers, resolve component policy
                PolicyReferenceResolver referenceResolver = protocol.getMarinerPageContext().getPolicyReferenceResolver();
                AssetResolver assetResolver = protocol.getMarinerPageContext()
                        .getAssetResolver();
                RuntimePolicyReference policyReference = referenceResolver
                        .resolvePolicyExpression(((StyleComponentURI)labelContent).getExpression());

                // Create image asset from the policy and get fallback
                DefaultComponentImageAssetReference imageAsset = new DefaultComponentImageAssetReference(
                        policyReference, assetResolver);
                TextAssetReference textAsset = imageAsset.getTextFallback();

                // If e.g policy file is missing and as consequence textAsset == null,
                // throw suitable exception
                if (null == textAsset) {
                    throw new ProtocolException(exceptionLocalizer.format(
                            "missing-policy-failure", policyReference.getName()));
                }

                // Return text in plain encoding, or empty string
                textLabel = textAsset.getText(TextEncoding.PLAIN);
View Full Code Here

       
        // Write JavaScript content to DOM.
        try {
            getJavaScriptWriter().write(scriptWriter.toString());
        } catch (IOException e) {
            throw new ProtocolException(e);
        }
       
        scriptWriter = null;
    }   
View Full Code Here

        
        // Write JavaScript content to DOM.
        try {
            getJavaScriptWriter().write(scriptWriter.toString());
        } catch (IOException e) {
            throw new ProtocolException(e);
        }
    }
View Full Code Here

        DivAttributes divAttributes;

        try {
            divAttributes = popDivAttributes();
        } catch (EmptyStackException e) {
            throw new ProtocolException("Div element not opened.");
        }

        // Get the div element that has just been put.
        Element element = getCurrentBuffer(protocol).getCurrentElement();
       
View Full Code Here

        SpanAttributes spanAttributes;

        try {
            spanAttributes = popSpanAttributes();
        } catch (EmptyStackException e) {
            throw new ProtocolException("Span element not opened.");
        }

        // Get the span element that has just been put.
        Element element = getCurrentBuffer(protocol).getCurrentElement();
       
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.ProtocolException

Copyright © 2018 www.massapicom. 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.