Package org.apache.jetspeed.portal

Examples of org.apache.jetspeed.portal.PortletInstance


    {
       String attrKey = "portlet_instance:"+portlet.getID();
      // optimize portlet instance retreival by saving it to the request
      // this also guarantees the PortletInstance object is the same
      // object for the entire life of the request
      PortletInstance instance = (PortletInstance) data.getRequest().getAttribute(attrKey);
      if(instance != null)
      {
        return instance;
      }
      else
View Full Code Here


    }
   
    public void setTitle( String title, RunData rundata ) {
      setTitle(title);
     
      PortletInstance instance = PersistenceManager.getInstance(this, rundata);
      instance.getEntry().setTitle(title);
     
        try {
          PersistenceManager.store(instance);
    } catch (PortalPersistenceException e) {
      logger.error("Exception occurred", e);
View Full Code Here

     */
    public String getAttribute( String attrName, String attrDefValue, RunData rundata )
    {
        String attrValue = null ;

        PortletInstance instance = PersistenceManager.getInstance(this, rundata);
        attrValue = instance.getAttribute(attrName, attrDefValue);

        return attrValue;
    }
View Full Code Here

     */
    public void setAttribute( String attrName, String attrValue, RunData rundata )
    {
        try
        {
            PortletInstance instance = PersistenceManager.getInstance(this, rundata);
            instance.setAttribute(attrName, attrValue);
            PersistenceManager.store(instance);
        }
        catch (PortalPersistenceException e)
        {
            logger.error("Exception while setting attribute "+attrName+" for portlet "+getName(), e);
View Full Code Here

    public org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData data)
    {
        String s1 = "Config ID: " + getPortletConfig().getPortletId();
        String s2 = ", Portlet ID: " + getID();
        String s3 = ", Page ID: " + getPortletConfig().getPageId();
        PortletInstance instance = PersistenceManager.getInstance(this,data);
        String s4 = instance.getAttribute("country");
        return new org.apache.jetspeed.util.JetspeedClearElement( s1 + s2 + s3 + ", " + s4);       
    }
View Full Code Here

     */
    public String getAttribute( String attrName, String attrDefValue, RunData rundata )
    {
        String attrValue = null ;

        PortletInstance instance = PersistenceManager.getInstance(this, rundata);
        attrValue = instance.getAttribute(attrName, attrDefValue);

        return attrValue;
    }
View Full Code Here

     */
    public void setAttribute( String attrName, String attrValue, RunData rundata )
    {
        try
        {
            PortletInstance instance = PersistenceManager.getInstance(this, rundata);
            instance.setAttribute(attrName, attrValue);
            PersistenceManager.store(instance);
        }
        catch (PortalPersistenceException e)
        {
            logger.error("Exception while setting attribute "+attrName+" for portlet "+getName(),e);
View Full Code Here

            PortletTab tab = new PortletTab();
           
            // Handle the portlet title
            String title = null;           
            PortletInstance pi = PersistenceManager.getInstance(p, rundata);
            if (pi != null)
            {
                title = pi.getTitle();
                if (title == null)
                {
                    title = (p.getTitle() != null) ? p.getTitle() : p.getName();
                }
            }
View Full Code Here

            return true;
        }

        // Retrieve portlet instance
        String peId = null;
        PortletInstance instance = PersistenceManager.getInstance(portlet, rundata);
        if (instance != null)
        {
            peId = instance.getPortlet().getID();
        }

        // Compare the ids
        if (peId != null && peId.equals(requestPeid))
        {
View Full Code Here

        // we should first retrieve the portlet to customize
        Portlet p = ((JetspeedRunData) rundata).getCustomized();

        context.put("action", "portlets.CustomizeAction");

        PortletInstance instance = PersistenceManager.getInstance(p, rundata);
        context.put(
            "portlet_instance",
            PersistenceManager.getInstance(p, rundata));

        if (p == null)
            return;

        // retrieve the portlet parameters
        PortletEntry entry =
            (PortletEntry) Registry.getEntry(Registry.PORTLET, p.getName());
        // save the entry in the session
        Vector params = new Vector();
        Iterator i = entry.getParameterNames();

        //System.out.println("==========================================");
        while (i.hasNext())
        {
            String name = (String) i.next();
            Parameter param = entry.getParameter(name);

            // filter some "system" and hidden parameters
            if ((!param.isHidden()) && (name.charAt(0) != '_'))
            {
                // check the user role
                if (JetspeedSecurity
                    .checkPermission(
                        (JetspeedUser) rundata.getUser(),
                        new PortalResource(entry, param),
                        JetspeedSecurity.PERMISSION_CUSTOMIZE))
                {
                    // Implementation of clone() is missing so we have do it "by hand"
                    Parameter clone = new BaseParameter();
                    clone.setName(param.getName());
                    clone.setTitle(param.getTitle());
                    clone.setDescription(param.getDescription());
                    clone.setType(param.getType());
                    if (instance.getAttribute(name, null) != null)
                    {
                        clone.setValue(instance.getAttribute(name));
                        //System.out.println("Adding value from instance [" + name + "] = [" + clone.getValue() + "]");
                    }
                    else if (
                        p.getPortletConfig().getInitParameter(name) != null)
                    {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.portal.PortletInstance

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.