Examples of MutablePortletEntity


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

    JSEntities entities = portlet.getEntities();
    Iterator it = entities.iterator();
    while (it.hasNext())
    {
      JSEntity entity = (JSEntity)it.next();
      MutablePortletEntity portletEntity = entityAccess.getPortletEntity(entity.getId());
      if (portletEntity == null)
      {
        portletEntity = entityAccess.newPortletEntityInstance(pd, entity.getId());
        try
        {
View Full Code Here

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

       
        MutablePortletApplication app = portletRegistry.getPortletApplication(TEST_PORTLET_APP_NAME);
       
        PortletDefinition portlet = (PortletDefinition) app.getPortletDefinitionList().iterator().next();
       
        MutablePortletEntity entity = entityAccess.newPortletEntityInstance(portlet);
        entity.setId("testEnity");
       
        entityAccess.storePortletEntity(entity);
       
       
       
View Full Code Here

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

    public void testWindowAccess() throws Exception
    {
        List windows = new ArrayList();
        ContentFragment f1 = new ContentFragmentImpl((Fragment) fragMock.proxy(), new HashMap());
        MutablePortletEntity entity = (MutablePortletEntity) entityMock.proxy();
        CompositeWindowList windowList = (CompositeWindowList) windowListMock.proxy();
        entityAccessMock.expects(new InvokeAtLeastOnceMatcher()).method("getPortletEntityForFragment")
                .withAnyArguments().will(new ReturnStub(entity));
        fragMock.expects(new InvokeAtLeastOnceMatcher()).method("getId").withNoArguments()
                .will(new ReturnStub("frag1"));
View Full Code Here

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

    public void testWindowAccess() throws Exception
    {
        List windows = new ArrayList();
        ContentFragment f1 = new ContentFragmentImpl((Fragment) fragMock.proxy(), new HashMap());
        MutablePortletEntity entity = (MutablePortletEntity) entityMock.proxy();
        CompositeWindowList windowList = (CompositeWindowList) windowListMock.proxy();
        entityAccessMock.expects(new InvokeAtLeastOnceMatcher()).method("getPortletEntityForFragment")
                .withAnyArguments().will(new ReturnStub(entity));
        fragMock.expects(new InvokeAtLeastOnceMatcher()).method("getId").withNoArguments()
                .will(new ReturnStub("frag1"));
View Full Code Here

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

    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)
        {
            portletEntity = newPortletEntityInstance(pd);
            if (portletEntity == null)
            {
                throw new PortletEntityNotGeneratedException("Failed to create Portlet Entity for "
                        + fragment.getName());
            }
        }
        else
        {
            String msg = "Failed to retrieve Portlet Definition for " + fragment.getName();
            logger.warn(msg);
            portletEntity = new PortletEntityImpl(fragment);
            fragment.overrideRenderedContent(msg);
        }

        portletEntity.setId(entityKey.toString());

        return portletEntity;
    }
View Full Code Here

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

    protected MutablePortletEntity getPortletEntity(ObjectID id, ContentFragment fragment) throws PortletEntityNotStoredException
    {
        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)
            {
                //Indication that the fragment has changed the portlet it references.
                if(fragment != null && !portletUniqueName.equals(fragment.getName()))
View Full Code Here

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

      }
      JSEntities entities = new JSEntities();

      while (list.hasNext())
      {
        MutablePortletEntity entity = (MutablePortletEntity) list
            .next();
        JSEntity jsEntity = exportEntityPref(entity);
        if (jsEntity != null)
          entities.add(jsEntity);
View Full Code Here

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

    JSEntities entities = portlet.getEntities();
    Iterator it = entities.iterator();
    while (it.hasNext())
    {
      JSEntity entity = (JSEntity)it.next();
      MutablePortletEntity portletEntity = entityAccess.getPortletEntity(entity.getId());
      if (portletEntity == null)
      {
        portletEntity = entityAccess.newPortletEntityInstance(pd, entity.getId());
        try
        {
View Full Code Here

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

    private PortletWindow createPortletWindow(ContentFragment fragment, String principal) throws FailedToCreateWindowException, PortletEntityNotStoredException
    {       
        PortletWindow portletWindow = new PortletWindowImpl(fragment.getId());
        boolean temporaryWindow = false;
               
        MutablePortletEntity portletEntity = entityAccessor.getPortletEntityForFragment(fragment, principal);
        if (portletEntity == null)
        {
            log.info("No portlet entity defined for fragment ID "+fragment.getId()+" attempting to auto-generate...");
            try
            {
View Full Code Here

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

      }
      JSEntities entities = new JSEntities();

      while (list.hasNext())
      {
        MutablePortletEntity entity = (MutablePortletEntity) list
            .next();
        JSEntity jsEntity = exportEntityPref(entity);
        if (jsEntity != null)
          entities.add(jsEntity);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.