Package org.apache.jetspeed.portal

Examples of org.apache.jetspeed.portal.PortletInstance


        Portlet p = ((JetspeedRunData) rundata).getCustomized();

        // Update paramaters
        try
        {
            PortletInstance instance =
                PersistenceManager.getInstance(p, rundata);

            instance.removeAllAttributes();

            try
            {
                ((JetspeedRunData) rundata).getCustomizedProfile().store();
            }
View Full Code Here


    }

        // Update paramaters
        try
        {
            PortletInstance instance =
                PersistenceManager.getInstance(p, rundata);
            PortletEntry regEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, p.getName());

            Iterator i = params.iterator();

            //System.out.println("==========================================");
            while (i.hasNext())
            {
                Parameter param = (Parameter) i.next();
                String name = param.getName();
                String newValue = null;
                String[] testArray = rundata.getParameters().getStrings(name);
                if (testArray != null && testArray.length > 1)
                {
                    newValue =
                        org.apache.jetspeed.util.StringUtils.arrayToString(
                            testArray,
                            ",");
                }
                else
                {
                    newValue = rundata.getParameters().getString(name);
                    if (newValue == null)
                    {
                        newValue = "";
                    }
                }
                String regValue = regEntry.getParameter(name).getValue();
                //param.getValue();
                String psmlValue = instance.getAttribute(name);

                //System.out.println(name + "= [" + psmlValue + "] in psml");
                //System.out.println(name + "= [" + regValue + "] in registry");

                // New value for this parameter exists
                if (newValue != null)
                {
                    //System.out.println(name + "= [" + newValue + "] in request");
                    // New value differs from registry - record it in psml
                    if (!regValue.equals(newValue)
                        || !psmlValue.equals(newValue))
                    {
                        instance.setAttribute(name, newValue);
                        psmlValue = newValue;
                        //System.out.println("setting attribute for [" + name + "] to [" + newValue + "]");
                    }
                    madePsChange = true;
                }
                // Remove duplicate parameters from psml
                if (psmlValue != null && psmlValue.equals(regValue))
                {
                    //System.out.println("removing attribute for [" + name + "]");
                    instance.removeAttribute(name);
                    madePsChange = true;
                }

            }
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

    {
       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

    * @author <a href="mailto:sweaver@rippe.com">Scott Weaver</a>
    */
    public void setAttribute(String attrName, String value, Context context)
        throws PortalPersistenceException
    {
        PortletInstance instance = getPortletInstance(context);
        instance.setAttribute(attrName, value);
        PersistenceManager.store(instance);
    }
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

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

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.