Package org.apache.jetspeed.capability

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


       @param rundata  RunData object from Turbine.
       @return ConcreteElement object, including the complete ECS code for rendering
       the page.
    */             
    public ConcreteElement getContent( RunData rundata ) {
        CapabilityMap cm = CapabilityMapFactory.getCapabilityMap( rundata );
        if ( cm.getPreferredType().equals( MimeType.HTML ) ) {
            return getHTMLContent( rundata );
        }
        if ( cm.getPreferredType().equals( MimeType.WML ) ) {
            return getWMLContent( rundata );
        }
        logger.error("The Given MIME-Type is not supportet for this control");
        return null;
    }
View Full Code Here

    /**
    */
    public ConcreteElement getContent( RunData rundata )
    {

        CapabilityMap map = ((JetspeedRunData)rundata).getCapability();
        ConcreteElement content = null;

        if ( MimeType.WML.equals( map.getPreferredType() ) )
        {
            content = getWMLContent( portlets, rundata );
        }
        else if ( MimeType.HTML.equals( map.getPreferredType() ) )
        {
            content = getHTMLContent( portlets, rundata );
        }
        else
        {
View Full Code Here

    public void testDefaultMap() throws Exception
    {
        try
        {
            // first test default capailitymap
            CapabilityMap cm = CapabilityMapFactory.getDefaultCapabilityMap();
            assertNotNull(cm);
            assertTrue(cm.toString().startsWith("ns4"));
        }
        catch (Exception e)
        {
            String errmsg = "Error in test: " + e.toString();
           // e.printStackTrace();
View Full Code Here

    public void testCapabilityCheck() throws Exception
    {
        try
        {
            // test simple capabilities
            CapabilityMap cm = CapabilityMapFactory.getCapabilityMap("Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc1) Gecko/20020417");
            assertTrue(cm.hasCapability("HTML_DOM_1"));
            assertTrue(cm.hasCapability("HTML_IFRAME"));
            assertTrue(cm.supportsMimeType(MimeType.XML));
            assertTrue(cm.supportsMediaType("html"));
        }
        catch (Exception e)
        {
            String errmsg = "Error in test: " + e.toString();
           // e.printStackTrace();
View Full Code Here

        }
    }

    private void getUserAgent(String name, String ua)
    {
        CapabilityMap cm = CapabilityMapFactory.getCapabilityMap(ua);
        assertNotNull(cm);
        assertNotNull(name);
        assertTrue(cm.toString().startsWith(name));
    }
View Full Code Here

        // Verify we have a user
        JetspeedUser user = (JetspeedUser)rundata.getUser();
        assertNotNull( "Got user", user);

        // Verify we have a CapabilityMap
        CapabilityMap cm = ((JetspeedRunData)rundata).getCapability();
        assertNotNull( "Got Capability", cm);

        // Verify we have a profile
        Profile profile = Profiler.getProfile(rundata);
        assertNotNull( "Got profile from Profiler", profile);
View Full Code Here

    public ConcreteElement getContent(RunData rundata)
    {       
        JetspeedRunData jrun = (JetspeedRunData) rundata;
        PortletConfig pc = this.getPortletConfig();

        CapabilityMap map = jrun.getCapability();
       
        StringBuffer text = new StringBuffer();
       
        String mimeType = map.getPreferredType().toString();

        if (this.supportsType(map.getPreferredType()))
        {
            text.append("Supports preferred MimeType: " + mimeType);
        }
        else
        {
View Full Code Here

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

        String newTemplate;

        if (data == null)
        {
View Full Code Here

     * @param rundata the rundata object for the current request
     * @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

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.