Package org.apache.jetspeed.om.common.portlet

Examples of org.apache.jetspeed.om.common.portlet.MutablePortletEntity


    public MutablePortletEntity getPortletEntity( ObjectID id )
    {
        Criteria c = new Criteria();
        c.addEqualTo("id", id.toString());
        Query q = QueryFactory.newQuery(PortletEntityImpl.class, c);
        MutablePortletEntity portletEntity = (MutablePortletEntity) getPersistenceBrokerTemplate().getObjectByQuery(q);
        if (portletEntity == null)
        {
            return null;
        }
        else
        {

            String portletUniqueName = portletEntity.getPortletUniqueName();
            PortletDefinitionComposite parentPortletDef = registry.getPortletDefinitionByUniqueName(portletUniqueName);
            if(parentPortletDef != null)
            {
                ((PortletEntityCtrl) portletEntity).setPortletDefinition(parentPortletDef);
                return (MutablePortletEntity) portletEntity;
            }
            else
            {
                logger.warn("No parent portlet definition could be located using unique name: "+portletUniqueName+
                            ".  Unless you plan on redploying this portlet definition, it is highly recommended "+
                            "that you delete the orphaned portlet entity with the id: "+portletEntity.getId());
                return (MutablePortletEntity) portletEntity;
            }
               
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.common.portlet.MutablePortletEntity

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.