Package org.apache.ecs

Examples of org.apache.ecs.ConcreteElement


    @return the content to be displayed to the user-agent
    */
    public ConcreteElement getContent( RunData 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) {
            content = getContent( data, map );
            if ( content == null ) {
View Full Code Here


        // need to get this functionality
        // into the model?
        CapabilityMap map = ((JetspeedRunData) context.get("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

           
        try
       
            pageContext.getOut().flush();

            ConcreteElement result = new ConcreteElement();

            if (data != null && data.getUser() != null)
            {
                JetspeedTool jt = new JetspeedTool(data);
                String jspeid = (String) data.getUser().getTemp("js_peid");
                if (jspeid != null)
                {
                    data.setMode(JetspeedRunData.MAXIMIZE);
                    result = jt.getPortletById(jspeid);
                }
                else
                {
                    result = jt.getPane(this.name);
                }
            }
       
            // Check whether this is an "old" screen (that returns a ConcreteElement)
            // or a "new" one that returns null.
            if (result != null)
            {
                //The ECS element must serialize in the character encoding
                // of the response
                result.setCodeSet(data.getResponse().getCharacterEncoding());

                result.output(data.getResponse().getWriter());
            }

        }
        catch (Exception e)
        {
View Full Code Here

    {
        JetspeedRunData data = (JetspeedRunData) pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);

        try
        {
            ConcreteElement result = null;
            String def = this.alt != null && this.alt.trim().length() > 0 ? this.alt : this.key;
            try
            {
                CustomLocalizationService locService = (CustomLocalizationService) ServiceUtil.getServiceByName(
                    LocalizationService.SERVICE_NAME);
View Full Code Here

        try
        {
            pageContext.getOut().flush();

            ConcreteElement result = new ConcreteElement();
            Entry entry = null;

            if (this.psml != null)
            {
               ProfileLocator baseLocator = Profiler.createLocator();
               baseLocator.createFromPath(this.psml);
               Profile baseProfile = Profiler.getProfile(baseLocator);
               if (baseProfile != null)
               {
                   entry = baseProfile.getDocument().getEntry(name);
                   Log.debug("JetspeedPortletTag: retrieved [" + entry + "] from psml [" + this.psml);
               }
            }
            else
            {
               entry  = data.getProfile().getDocument().getEntry(name);
               Log.debug("JetspeedPortletTag: retrieved [" + entry + "] from current psml");
            }

            if (entry != null)
            {
                result = PortletFactory.getPortlet(entry).getContent(data);
            }

            // Check whether this is an "old" screen (that returns a ConcreteElement)
            // or a "new" one that returns null.
            if ( result != null )
            {
                //The ECS element must serialize in the character encoding
                // of the response
                result.setCodeSet( data.getResponse().getCharacterEncoding() );

                result.output( data.getResponse().getWriter() );
            }

        }
        catch (Exception e)
        {
View Full Code Here

    {
        JetspeedRunData data = (JetspeedRunData) pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
       
        try
        {
            ConcreteElement result = null;
            Profile baseProfile = null;
            ProfileLocator baseLocator = Profiler.createLocator();
            int rootType = JetspeedLink.DEFAULT;
            String rootValue = null;
            int elementType = JetspeedLink.DEFAULT;
View Full Code Here

        CapabilityMap mymap = map;
        if ( mymap == null ) {
            mymap = CapabilityMapFactory.getDefaultCapabilityMap();
        }

        ConcreteElement buffer = new JetspeedClearElement( content.toString( ) );
        this.content.put( mymap.toString(), buffer );
    }
View Full Code Here

                                       boolean allowRecurse ) {

        CapabilityMap mymap = map;
        if ( mymap == null ) mymap = CapabilityMapFactory.getCapabilityMap( rundata );

        ConcreteElement element = (ConcreteElement)content.get( mymap.toString() );

        if ( element == null ) {
            if ( allowRecurse ) {
                try {
                    // init will put content under default cmap
View Full Code Here

    /**
    */
    public void init() throws PortletException
    {
        PortletConfig pc = getPortletConfig();
        ConcreteElement myContent = null;
        try
        {
            screen = ( String ) pc.getInitParameter( SCREEN );
            //if it is null here it should be in the parameters
            if ( screen == null )
View Full Code Here

    /**
    */
    public ConcreteElement getContent(RunData rundata)
    {
        ConcreteElement content = null;
        PortletController controller = getController();
        PortalResource portalResource = new PortalResource(this);

        try
        {
            JetspeedLink jsLink = JetspeedLinkFactory.getInstance(rundata);
            portalResource.setOwner(jsLink.getUserName());
            JetspeedLinkFactory.putInstance(jsLink);
        }
        catch (Exception e)
        {
            Log.warn(e.toString());
            portalResource.setOwner(null);
        }

        if (!JetspeedSecurity.checkPermission((JetspeedUser) rundata.getUser()
                  portalResource, JetspeedSecurity.PERMISSION_VIEW))
        {  
            Log.debug("Unauthorized access by user \"" + rundata.getUser().getUserName() + "\"");
            // Clear any portlets that exist in this set
            if (this.portlets != null)
            {
                this.portlets.clear();
            }
            return new StringElement(Localization.getString("SECURITY_NO_ACCESS"));
        }
        else
        {
            Log.debug("User \"" + rundata.getUser().getUserName() + "\" is authorized to portlet set " + getID());
        }
           
        if (controller == null)
        {
            Portlet p = getPortletAt(0);
   
            if (p != null)
            {
                content = p.getContent(rundata);
            }
        }
        else
        {
            content = controller.getContent(rundata);
        }

        if (content == null)
        {
            content = new ConcreteElement();
        }
       
        return content;
    }
View Full Code Here

TOP

Related Classes of org.apache.ecs.ConcreteElement

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.