Package org.apache.pluto.om.portlet

Examples of org.apache.pluto.om.portlet.PortletDefinition


    /**
     * @see java.util.Collection#remove(java.lang.Object)
     */
    public boolean remove(Object o)
    {
        PortletDefinition pd = (PortletDefinition) o;       
        return innerCollection.remove(pd);
    }
View Full Code Here


                  //set selected tab to portlets tab
                  if(pa != null)
                  {
                      //TODO:  do we need to look up the pdef?  Could we just pass the child name into setAttribute?
                      String pdefName = child.getName().substring(pa.getName().length() + 2); //remove pa prefix
                      PortletDefinition pdef = pa.getPortletDefinitionByName(pdefName);
                      actionRequest.getPortletSession().setAttribute(PortletApplicationResources.REQUEST_SELECT_PORTLET, pdef.getName(), PortletSession.APPLICATION_SCOPE);
                      actionRequest.getPortletSession().setAttribute(PortletApplicationResources.REQUEST_SELECT_TAB, new TabBean("pa_portlets"), PortletSession.APPLICATION_SCOPE);
                  }
            }
            else
            {
View Full Code Here

   
    protected final void doCreate(ActionRequest request, ActionResponse response) throws PortletException
    {
        try
        {
            PortletDefinition pd = getPortletDefintion(request);
            String newId = request.getParameter("newEntityId");
            PortletEntity entity = null;
           
            if(newId != null)
            {
View Full Code Here

        {
          String layoutName = frag.getName();
          if ( layoutName != null && layoutName.length() > 0 )
          {
            // logic below is copied from org.apache.jetspeed.portlets.MultiColumnPortlet
            PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( layoutName );
                   
            ParameterSet paramSet = portletDef.getInitParameterSet();
            Parameter sizesParam = paramSet.get( "sizes" );
            String sizesParamVal = ( sizesParam == null ) ? null : sizesParam.getValue();
            if ( sizesParamVal != null && sizesParamVal.length() > 0 )
            {
              fragSizes.put( frag.getId(), sizesParamVal );
              //log.info( "GetPageAction settings sizes for " + frag.getId() + " to " + sizesParamVal);
            }
            else
            {
              Parameter colsParam = paramSet.get( "columns" );
              String colsParamVal = ( colsParam == null ) ? null : colsParam.getValue();
              if ( colsParamVal != null && colsParamVal.length() > 0 )
              {
                int cols = 0;
                try
                {
                  cols = Integer.parseInt( colsParamVal );
                }
                catch ( NumberFormatException ex )
                {
                }
                if ( cols < 1 )
                {
                  cols = 2;
                }
                switch (cols)
                      {
                        case 1: sizesParamVal = "100%"; break;
                        case 2: sizesParamVal = "50%,50%"; break;
                        case 3: sizesParamVal = "34%,33%,33%"; break;
                        default: sizesParamVal = "50%,50%"; break;
                      }
                fragSizes.put( frag.getId(), sizesParamVal );
                //log.info( "GetPageAction defaulting sizes for " + frag.getId() + " to " + sizesParamVal);
              }
            }
          }
        }
        List childFragments = frag.getFragments();
        if ( childFragments != null )
        {
          Iterator childFragIter = childFragments.iterator();
          while ( childFragIter.hasNext() )
          {
            Fragment childFrag = (Fragment)childFragIter.next();
                    retrieveFragmentSpecialProperties( requestContext, childFrag, fragSizes, portletIcons );
          }
        }
      }
        else if ( portletIcons != null && "portlet".equals( frag.getType() ) )
        {   // get portlet icon and locale specific portlet display name
            String portletName = frag.getName();
            if ( portletName != null && portletName.length() > 0 )
            {
                PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( portletName );
               
                if ( portletDef != null && portletIcons != null )
                {
                    ParameterSet paramSet = portletDef.getInitParameterSet();
                    Parameter iconParam = paramSet.get( "portlet-icon" );
                    String iconParamVal = ( iconParam == null ) ? null : iconParam.getValue();
                    if ( iconParamVal != null && iconParamVal.length() > 0 )
                    {
                        portletIcons.put( frag.getId(), iconParamVal );
View Full Code Here

                    ClassLoader currentContextClassLoader = Thread.currentThread().getContextClassLoader();

                    Iterator portletDefinitions = pa.getPortletDefinitions().iterator();
                    while (portletDefinitions.hasNext())
                    {
                        PortletDefinition pd = (PortletDefinition) portletDefinitions.next();
                        String pdId = pd.getId().toString();
                        Portlet portlet = (Portlet) portletCache.remove(pdId);
                        if (portlet != null)
                        {
                            try
                            {
View Full Code Here

            if(portletDefs != null && portletDefs.size() > 0)
            {
                Iterator pdItr = portletDefs.iterator();
                while(pdItr.hasNext())
                {
                    PortletDefinition pd = (PortletDefinition) pdItr.next();
                    Collection portletEntites = entityAccess.getPortletEntities(pd);
                    if(portletEntites != null && portletEntites.size() > 0)
                    {
                        Iterator peItr = portletEntites.iterator();
                        while(peItr.hasNext())
View Full Code Here

    Iterator portlets = pa.getPortletDefinitions().iterator();

    while (portlets.hasNext())
    {
      PortletDefinition portletDefinition = (PortletDefinition) portlets.next();
      Iterator      entities = entityAccess.getPortletEntities(portletDefinition)
                           .iterator();

      while (entities.hasNext())
      {
View Full Code Here

                    // Refer to org.apache.jetspeed.components.portletentity.PortletEntityImpl class
                   
                    curWindow = (PortletWindow)
                        CurrentWorkerContext.getAttribute(PortalReservedParameters.PORTLET_WINDOW_ATTRIBUTE);
                    PortletEntityImpl curEntity = (PortletEntityImpl) curWindow.getPortletEntity();
                    PortletDefinition oldPortletDefinition = curEntity.getPortletDefinition();
                    PortletDefinition curPortletDefinition = (PortletDefinition)
                        CurrentWorkerContext.getAttribute(PortalReservedParameters.PORTLET_DEFINITION_ATTRIBUTE);
                   
                    if (!oldPortletDefinition.getId().equals(curPortletDefinition.getId())) {
                        curEntity.setPortletDefinition(curPortletDefinition);
                    }
                }
            }
           
View Full Code Here

     *         PortletEntityNotGeneratedException
     */
    public MutablePortletEntity generateEntityFromFragment( ContentFragment fragment, String principal )
            throws PortletEntityNotGeneratedException
    {
        PortletDefinition pd = registry.getPortletDefinitionByUniqueName(fragment.getName());
        ObjectID entityKey = generateEntityKey(fragment, principal);
        MutablePortletEntity portletEntity = null;

        if (pd != null)
        {
View Full Code Here

        {
            throw new PortletEntityNotStoredException("Fragment and PortletEntity ids do not match, update skipped: " + fragment.getId() + " != " + portletEntity.getId() );
        }

        // update portlet definition from fragment
        PortletDefinition pd = registry.getPortletDefinitionByUniqueName(fragment.getName());
        if (pd != null)
        {
            ((PortletEntityImpl)portletEntity).setPortletDefinition(pd);
        }
        else
View Full Code Here

TOP

Related Classes of org.apache.pluto.om.portlet.PortletDefinition

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.