Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.ProtocolException


            // Set id
            Element insertedImage = (Element) buffer.getCurrentElement()
                    .getTail();

            if (null == insertedImage) {
                throw new ProtocolException(exceptionLocalizer.format(
                        "missing-policy-failure", content.toString()));
            }

            String imgId = protocol.getMarinerPageContext()
                    .generateUniqueFCID();
            insertedImage.setAttribute("id", imgId);

            // Set required styles
            Styles styles = insertedImage.getStyles();
            if (null == styles) {
                styles = StylingFactory.getDefaultInstance().createStyles(null);
                insertedImage.setStyles(styles);
            }
            styles.getPropertyValues().setComputedAndSpecifiedValue(
                    StylePropertyDetails.DISPLAY, DisplayKeywords.INLINE);
            styles.getPropertyValues().setComputedAndSpecifiedValue(
                    StylePropertyDetails.VERTICAL_ALIGN,
                    VerticalAlignKeywords.BOTTOM);

            if (!visible) {
                insertedImage.setAttribute("style", "display:none");
            }

            // Extract from policy and set alt text for image
            String altText = extractAltText(protocol, component);
            insertedImage.setAttribute("alt", altText);

            return imgId;

        } else {
            throw new ProtocolException(exceptionLocalizer
                    .format("widget-tab-label-incorrect-content-type"));
        }
    }
View Full Code Here


        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
        String altText = textAsset.getText(TextEncoding.PLAIN);
View Full Code Here

            throws ProtocolException {

        if (content instanceof StyleList) {
            StyleList contentList = (StyleList) content;
            if (contentList.getList().isEmpty()) {
                throw new ProtocolException(exceptionLocalizer
                        .format("widget-tab-label-empty-content"));
            }
            return (StyleValue) contentList.getList().get(0);
        } else {
            return content;
View Full Code Here

            styles.removeNestedStyles(StatefulPseudoClasses.MCS_CONCEALED);  
       
        try {
            writeScriptElement(currentBuffer, textBuffer.toString());
        } catch (IOException e) {
            throw new ProtocolException();
        }       

        // After the rendering is finished, pop current context.
        popContext();
    }
View Full Code Here

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

                scriptWriter.write("Widget.addStartupItem(function(){Widget.getInstance(" + createJavaScriptString(validateAttributes.getId()) + ").setInputEvents()})");

                // Flush JavaScript to the page.
                writeJavaScript(currentBuffer, scriptWriter.toString());
            } catch (IOException e) {
                throw new ProtocolException(e);
            }

            // Close script element.
            closeScriptElement(currentBuffer);           
           
View Full Code Here

                newContainer.addCreatedWidgetId((String)i.next());
            }
            try {
                newContainer.getWriter().write(jsContainer.getJavaScriptContent());
            } catch (IOException e) {
                throw new ProtocolException();
            }
        }
       
    }
View Full Code Here

        // so reusing of the same attriubtes leads to duplicated ID.
        final ButtonAttributes buttonAttributes = new ButtonAttributes();
        buttonAttributes.setActionReference(refButtonAttributes.getActionReference());
       
        if(null == buttonAttributes){
            throw new ProtocolException();           
        }
       
        DOMOutputBuffer buffer = getCurrentBuffer();

       
View Full Code Here

    
          
        try {
            writeScriptElement(currentBuffer, textToScript.toString());
        } catch (IOException e) {
            throw new ProtocolException();
        }
       
        // After the FieldExpander is rendered, pop it from the stack.
        styles.removeNestedStyles(StatefulPseudoClasses.MCS_CONCEALED);    
       
View Full Code Here

       
        // Write JavaScript content to DOM.
        try {
            getJavaScriptWriter().write(scriptBuffer.toString());
        } catch (IOException e) {
            throw new ProtocolException(e);
        }
    }
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.