Package org.apache.jetspeed.capability

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


            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

            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

* @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

    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

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

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

     * @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

     * @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

     * @return The newly created profile.
     */
    public Profile createProfile( RunData data, Profile profile, MimeType mt )
        throws ProfileException
    {
        CapabilityMap cm = CapabilityMapFactory.getCapabilityMap(mt.getContentType());
        profile.setMediaType( getMediaType(data, cm) );
        return createProfile(data, profile);
    }
View Full Code Here

    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

TOP

Related Classes of org.apache.jetspeed.capability.CapabilityMap

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.