Package org.apache.pluto.om.entity

Examples of org.apache.pluto.om.entity.PortletEntity


            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
            // USER_INFO only available (!=null) for authenticated user)
            if (null != context && getUserPrincipal() != null)
            {
                String entityID = "--NULL--";
                PortletEntity entity = portletWindow.getPortletEntity();
                if (entity != null)
                {
                    entityID = entity.getId().toString();
                }
                PortletApplicationDefinition portletAppDef = entity.getPortletDefinition()
                        .getPortletApplicationDefinition();

                if (null != portletAppDef)
                {
                    value = context.getUserInfoMap(portletAppDef.getId());
View Full Code Here


     * @return The PortletEntity represented by the current fragment.
     * @throws Exception
     */
    public PortletEntity getPortletEntity(ContentFragment f) throws Exception
    {
        PortletEntity portletEntity = windowAccess.getPortletWindow(f).getPortletEntity();
        // This API hits the DB: PortletEntity portletEntity = entityAccess.getPortletEntityForFragment(f);
        if (portletEntity == null)
        {
            try
            {
View Full Code Here

        {
            throw new FailedToRetrievePortletWindow("Portlet Window creation failed for fragment: "
                                                    + fragment.getId() + ", " + fragment.getName());
        }

        PortletEntity portletEntity = portletWindow.getPortletEntity();
        ((MutablePortletEntity)portletEntity).setFragment(fragment);
       
        ((PortletWindowImpl) portletWindow).setInstantlyRendered(fragment.isInstantlyRendered());

        return portletWindow;
View Full Code Here

      Iterator      entities = entityAccess.getPortletEntities(portletDefinition)
                           .iterator();

      while (entities.hasNext())
      {
        PortletEntity entity = (PortletEntity) entities.next();

        if (purgeEntityInfo)
        {
          try
          {
            entityAccess.removePortletEntity(entity);
          }
          catch (PortletEntityNotDeletedException e)
          {
            String msg = "Failed to delete Portlet Entity " + entity.getId();
            log.error(msg, e);
            throw new RegistryException(msg, e);
          }
        }
View Full Code Here

        pref.addValue(newValue);
    }
   
    protected final void doRemovePref(ActionRequest request, ActionResponse response) throws PortletException
    {
        PortletEntity entity = getPortletEntity(request);
        String prefString= request.getParameter("selectedPref");
        String prefName = prefString.split("::")[1];
        ((PreferenceSetComposite)entity.getPreferenceSet()).remove(prefName);
       
    }
View Full Code Here

       
    }
   
    protected final void doUpdateValue(ActionRequest request, ActionResponse response) throws PortletException
    {
        PortletEntity entity = getPortletEntity(request);
        String prefString= request.getParameter("selectedPref");
        String updatedValue = request.getParameter("selectedPrefValue");
        if(updatedValue.trim().length() == 0)
        {
            throw new PortletException("Preference values cannot be empty.");
        }
        String[] info = prefString.split("::");
        String prefName = info[1];
        int valueIndex = Integer.parseInt(info[2]);
        PreferenceComposite pref = (PreferenceComposite) entity.getPreferenceSet().get(prefName);
        pref.setValueAt(valueIndex, updatedValue);
    }
View Full Code Here

        pref.setValueAt(valueIndex, updatedValue);
    }
   
    protected final void doRemoveValue(ActionRequest request, ActionResponse response) throws PortletException
    {
        PortletEntity entity = getPortletEntity(request);
        String prefString= request.getParameter("selectedPref");
        String updatedValue = request.getParameter("selectedPrefValue");
        String[] info = prefString.split("::");
        String prefName = info[1];
        int valueIndex = Integer.parseInt(info[2]);
        PreferenceComposite pref = (PreferenceComposite) entity.getPreferenceSet().get(prefName);
        pref.removeValueAt(valueIndex);
    }
View Full Code Here

    {
        String title = null;
        RequestContext requestContext = (RequestContext) request
                .getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
       
        PortletEntity entity = window.getPortletEntity();
        if (entity != null && entity.getPortletDefinition() != null)
        {
            title = requestContext.getPreferedLanguage(
                    entity.getPortletDefinition()).getTitle();
        }

        if (title == null && entity.getPortletDefinition() != null)
        {
            title = entity.getPortletDefinition().getName();
        }
        else if (title == null)
        {
            title = "Invalid portlet entity " + entity.getId();
        }
       
        return title;
    }
View Full Code Here

      Iterator      entities = entityAccess.getPortletEntities(portletDefinition)
                           .iterator();

      while (entities.hasNext())
      {
        PortletEntity entity = (PortletEntity) entities.next();

        if (purgeEntityInfo)
        {
          try
          {
            entityAccess.removePortletEntity(entity);
          }
          catch (PortletEntityNotDeletedException e)
          {
            String msg = "Failed to delete Portlet Entity " + entity.getId();
            log.error(msg, e);
            throw new RegistryException(msg, e);
          }
        }
View Full Code Here

        {
            throw new FailedToRetrievePortletWindow("Portlet Window creation failed for fragment: "
                                                    + fragment.getId() + ", " + fragment.getName());
        }

        PortletEntity portletEntity = portletWindow.getPortletEntity();
        ((MutablePortletEntity)portletEntity).setFragment(fragment);

        return portletWindow;
    }
View Full Code Here

TOP

Related Classes of org.apache.pluto.om.entity.PortletEntity

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.