Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.MetaAttributes


    }

    public void testDoMeta() throws Exception {
       privateSetUp();

       MetaAttributes attributes = new MetaAttributes();
       attributes.setContent("Test & encoding");
       attributes.setHttpEquiv("refresh");
       attributes.setName("URL");

       protocol.doMeta(buffer, attributes);

       // Check the meta tag and attributes
       Element nullElement = buffer.popElement();
View Full Code Here


     * This method tests the method public void writeMeta ( MetaAttributes )
     * for the com.volantis.mcs.protocols.VolantisProtocol class.
     * @todo fix this test
     */
    public void noTestWriteMeta() throws Exception {
        final MetaAttributes attributes =
                (MetaAttributes) ProtocolIntegrationTestHelper.
                provideAttributes(MetaAttributes.class);

        final VolantisProtocol protocol = getProtocol();

View Full Code Here

        ProtocolConfiguration conf = protocol.getProtocolConfiguration();
        int width = conf.getDevicePixelsX();
        String name = "viewport";
        String content = "width=" + width + ", initial-scale=1.0";

        MetaAttributes metaAttributes = new MetaAttributes();
        metaAttributes.setName(name);
        metaAttributes.setContent(content);

        // Write meta element to the head.
        protocol.doMeta(dom, metaAttributes);

    }
View Full Code Here

        MarinerPageContext ctx = ContextInternals.getMarinerPageContext(
            context.getInitialRequestContext());

        MetaData metaData = context.getPageMetaData();
        MetaAttributes attributes = new MetaAttributes();

        //add all search engine meta tags i.e. description, keywords, author       
        if(MetaPropertyHandlerFactory.DESCRIPTION.equals(propertyName)
                &&  DevicePolicyConstants.FULL_SUPPORT_POLICY_VALUE
                .equals(ctx.getDevicePolicyValue(DevicePolicyConstants.X_ELEMENT_SUPPORTS_META_DESCRIPTION))) {

            attributes.setName(MetaPropertyHandlerFactory.DESCRIPTION);
            attributes.setContent((String) metaData.getPropertyValue(MetaPropertyHandlerFactory.DESCRIPTION));
            ctx.getProtocol().writeMeta(attributes);           
        }   

        if(MetaPropertyHandlerFactory.KEYWORDS.equals(propertyName)
                &&  DevicePolicyConstants.FULL_SUPPORT_POLICY_VALUE
                .equals(ctx.getDevicePolicyValue(DevicePolicyConstants.X_ELEMENT_SUPPORTS_META_KEYWORDS))) {

            attributes.setName(MetaPropertyHandlerFactory.KEYWORDS);
            String value = null;
            if(metaData.getPropertyValue(MetaPropertyHandlerFactory.KEYWORDS) != null) {
                value = normalize((String) metaData.getPropertyValue(MetaPropertyHandlerFactory.KEYWORDS));
            }
            attributes.setContent(value);
            ctx.getProtocol().writeMeta(attributes);
        }           

        if(MetaPropertyHandlerFactory.AUTHOR.equals(propertyName)
                &&  DevicePolicyConstants.FULL_SUPPORT_POLICY_VALUE
                .equals(ctx.getDevicePolicyValue(DevicePolicyConstants.X_ELEMENT_SUPPORTS_META_AUTHOR))) {
           
            attributes.setName(AUTHOR_HTML_META);
            attributes.setContent((String) metaData.getPropertyValue(MetaPropertyHandlerFactory.AUTHOR));
            ctx.getProtocol().writeMeta(attributes);
        }
    }
View Full Code Here

    // Javadoc inherited from super class.
    protected void openHead(DOMOutputBuffer dom,
                            boolean empty) {

        // Write the meta tags to the head.
        MetaAttributes ma = new MetaAttributes();
        ma.setName("PalmComputingPlatform");
        ma.setContent("true");
        writeMeta(ma);

        ma.setName("HandheldFriendly");
        writeMeta(ma);

        super.openHead(dom, empty);
    }
View Full Code Here

    // javadoc inherited
    protected void openHead(DOMOutputBuffer dom,
                            boolean empty) {

        // Write the meta tags to the head.
        MetaAttributes ma = new MetaAttributes();
        ma.setName("HandheldFriendly");
        ma.setContent("true");
        writeMeta(ma);

        super.openHead(dom, empty);
    }
View Full Code Here

            context.getDevicePolicyValue(
                X_ELEMENT_SUPPORTS_META_REFRESH))) {
            if (logger.isDebugEnabled()) {
                logger.debug("writing timed refresh meta");
            }
            MetaAttributes attributes = new MetaAttributes();
            attributes.setHttpEquiv(TimedRefreshInfo.NAME);
            attributes.setContent(refreshInfo.getHTMLContent(context));


            DOMOutputBuffer dom =
                (DOMOutputBuffer) context.getProtocol().getPageHead().getHead();
            doMeta(dom, attributes);
View Full Code Here

TOP

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

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.