Examples of CapabilityMap


Examples of org.apache.jetspeed.capability.CapabilityMap

            parser = docfactory.newDocumentBuilder();
            parser.setEntityResolver(new JetspeedXMLEntityResolver());
            url = portlet.getPortletConfig().getURL();

            String content = JetspeedDiskCache.getInstance().getEntry(url).getData();
            CapabilityMap xmap = CapabilityMapFactory.getCapabilityMap(CapabilityMapFactory.AGENT_XML);

            // no cache yet // portlet.setContent( new JetspeedClearElement(content), xmap );
            InputSource isrc = new InputSource(this.cleanse(content));
            isrc.setSystemId(url);
            isrc.setEncoding("UTF-8");
View Full Code Here

Examples of org.apache.jetspeed.capability.CapabilityMap

        {
            logger.error("XSLViewProcessor - error: " + pe.getMessage(), pe);
        }

        RunData data = (RunData) context.get("data");
        CapabilityMap map = ((JetspeedRunData) data).getCapability();
        String type = map.getPreferredType().toString();
        ConcreteElement content = new JetspeedClearElement(INVALID_TYPE);
        String stylesheet = (String) stylesheets.get(type);

        if (stylesheet != null)
        {
View Full Code Here

Examples of org.apache.jetspeed.capability.CapabilityMap

            parser= docfactory.newDocumentBuilder();
            parser.setEntityResolver(new JetspeedXMLEntityResolver() );

            url = getPortletConfig().getURL();
            String content = JetspeedDiskCache.getInstance().getEntry( url ).getData();
           CapabilityMap xmap =
               CapabilityMapFactory.getCapabilityMap(CapabilityMapFactory.AGENT_XML);
            setContent( new JetspeedClearElement(content), xmap );
            InputSource isrc = new InputSource( this.cleanse( content ) );
            isrc.setSystemId( url );
            isrc.setEncoding("UTF-8");
View Full Code Here

Examples of org.apache.jetspeed.capability.CapabilityMap

            catch (PortletException pe)
            {
                logger.error("Exception",  pe);
            }
        }
        CapabilityMap map = ((JetspeedRunData)data).getCapability();
        String type = map.getPreferredType().toString();
        ConcreteElement content = new JetspeedClearElement(INVALID_TYPE);
        String stylesheet = (String)stylesheets.get(type);

        if (stylesheet != null) {
            content = getContent( data, map );
            if ( content == null ) {
                try {
                    content = new JetspeedClearElement(
                        SimpleTransform.transform( this.document,
                                                   stylesheet,
                                                   this.params ) );
                    setContent( content, map );
                } catch ( SAXException e ) {
                    logger.error("Exception",  e);
                    content = new JetspeedClearElement(e.getMessage());
                }
            }
        }
        else
        {
            if (map.getPreferredType().equals(MimeType.XML))
            {
                return getContent( data, map );
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.capability.CapabilityMap

* @param data org.apache.turbine.util.RunData
*/
public org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData data)
{

  CapabilityMap cap = ((JetspeedRunData)data).getCapability();

  // only for HTML mimetype!!!
  if (cap.getPreferredType().getCode().equals(MimeType.HTML.getCode()))
  {
    String link;
    String image;
    String name;
    String desc;
View Full Code Here

Examples of org.apache.jetspeed.capability.CapabilityMap

    public void setRequest(HttpServletRequest req)
    {
        super.setRequest(req);

        String enc = JetspeedResources.getString(JetspeedResources.CONTENT_ENCODING_KEY,"US-ASCII");
        CapabilityMap cm = CapabilityMapFactory.getCapabilityMap( req.getHeader("User-Agent") );
        String mimeCode = cm.getPreferredType().getCode();
        if ( mimeCode != null )
        {
            MediaTypeEntry media = (MediaTypeEntry)Registry.getEntry(Registry.MEDIA_TYPE, mimeCode);
            if ( media != null && media.getCharacterSet() != null)
            {
View Full Code Here

Examples of org.apache.jetspeed.capability.CapabilityMap

     */
    public Profile createProfile(RunData data, Profile profile)
            throws ProfileException
    {
        Profile current = null;
        CapabilityMap map;

        if (data == null)
        {
            map = CapabilityMapFactory.getDefaultCapabilityMap();
        }
View Full Code Here

Examples of org.apache.jetspeed.capability.CapabilityMap

     * @return a new Profile object
     */
    public Profile getProfile(RunData rundata)
        throws ProfileException
    {
        CapabilityMap cm = null;

        if (rundata instanceof JetspeedRunData)
        {
            cm = ((JetspeedRunData)rundata).getCapability();
        }
View Full Code Here

Examples of org.apache.jetspeed.capability.CapabilityMap

     * @return a new Profile object
     */
    public Profile getProfile(RunData data, MimeType mt)
        throws ProfileException
    {
        CapabilityMap cm = CapabilityMapFactory.getCapabilityMap(mt.toString());
        return getProfile(data, cm);
    }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.CapabilityMap

                rundata.getParameters().getString(registryEntryName);
            RegistryEntry regEntry = Registry.getEntry(registry, entryName);

            if (regEntry != null)
            {
                CapabilityMap cm = null;
                if (regEntry instanceof MediaTypeEntry)
                {
                    MediaTypeEntry mediaTypeEntry = (MediaTypeEntry) regEntry;
                    cm = mediaTypeEntry.getCapabilityMap();
                }
                else if (regEntry instanceof ClientEntry)
                {
                    ClientEntry clientEntry = (ClientEntry) regEntry;
                    cm = clientEntry.getCapabilityMap();
                }
                else
                {
                    //TODO: throw error
                }

                if (cm != null)
                {
                    String[] capabilities =
                        rundata.getParameters().getStrings("capability");
                    if (capabilities != null && capabilities.length > 0)
                    {
                        for (int i = 0; i < capabilities.length; i++)
                        {
                            String capability = capabilities[i];
                            if (cm.contains(capability))
                            {
                            }
                            else
                            {
                                if (capability != null
                                    && capability.length() > 0)
                                {
                                    cm.addCapability(capability);
                                }
                            }
                        }
                    }
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.