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

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


    root.addChild(portletApps);
   
    Iterator it = apps.iterator();
        while (it.hasNext())
        {
            MutablePortletApplication pa = (MutablePortletApplication)it.next();
            TreeControlNode appNode = new TreeControlNode(pa.getName(),
                                                          null,
                                                          pa.getName(),
                                                          PortletApplicationResources.PORTLET_URL,
                                                          null,
                                                          false,
                                                          "PA_APP_DOMAIN"  );
            portletApps.addChild(appNode);
           
            Iterator pdefIter = pa.getPortletDefinitionList().iterator();
            while (pdefIter.hasNext())
            {
                PortletDefinitionComposite portlet = (PortletDefinitionComposite) pdefIter.next();
                TreeControlNode portletNode = new TreeControlNode(pa.getName() + "::" + portlet.getName(),
                                                                  null,
                                                                  portlet.getDisplayNameText(locale),
                                                                  PortletApplicationResources.PORTLET_URL,
                                                                  null,
                                                                  false,
View Full Code Here


    {
        if (portlet == null)
            return null;
       
        // Do not display Jetspeed Layout Applications
        MutablePortletApplication pa = (MutablePortletApplication)portlet.getPortletApplicationDefinition();
        if (pa.isLayoutApplication())
            return null;
       
        // SECURITY filtering
        String uniqueName = pa.getName() + "::" + portlet.getName();
        if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
        {
            Parameter param = portlet.getInitParameterSet().get(PORTLET_ICON);
            String image;
            if (param != null)
View Full Code Here

            String addedKeys = request.getParameter("jsAddedKeys");
            String columns = request.getParameter("Columns");
            String rows = request.getParameter("Rows");
            String cats = request.getParameter("jsCats");
            String page = request.getParameter(JSPAGE);
            MutablePortletApplication pa = registry.getPortletApplication("j2-admin");
            String portletName = this.getPortletName();
            PortletDefinitionComposite portlet = (PortletDefinitionComposite) pa.getPortletDefinitionByName(portletName);
            boolean updated = updateNumericPref("Columns", columns, 10, portlet);
            updated = updated | updateNumericPref("Rows", rows, 100, portlet);
                       
            // process removes first
            if (!isEmpty(removes))
View Full Code Here

               
                if (portlet == null)
                    continue;
               
                // Do not display Jetspeed Layout Applications
                MutablePortletApplication pa = (MutablePortletApplication)portlet.getPortletApplicationDefinition();
                if (pa.isLayoutApplication())
                    continue;
                        
                // SECURITY filtering
                String uniqueName = pa.getName() + "::" + portlet.getName();
                if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
                {
                    String name = portlet.getDisplayNameText(locale);
                    if (name == null)
                    {
View Full Code Here

       
        String paName = (String)
            request.getPortletSession().getAttribute(PortletApplicationResources.PAM_CURRENT_PA,
                                             PortletSession.APPLICATION_SCOPE);
       
        MutablePortletApplication pa = registry.getPortletApplication(paName);
       
        if (null != pa)
        {
            request.setAttribute(VIEW_PA, new PortletApplicationBean(pa));
           
            String pdefName = (String) request.getPortletSession().getAttribute(PortletApplicationResources.REQUEST_SELECT_PORTLET, PortletSession.APPLICATION_SCOPE);
            PortletDefinitionComposite pdef = (PortletDefinitionComposite) pa.getPortletDefinitionByName(pdefName);
           
            request.setAttribute(VIEW_PD, pdef);
           
            request.setAttribute("tabs", paTabMap.values());
            request.setAttribute("portlet_tabs", pdTabMap.values());
View Full Code Here

        }
       
        String action = actionRequest.getParameter(PORTLET_ACTION);
        if(action != null)
        {
            MutablePortletApplication pa = registry.getPortletApplication(paName);
            if(isAppAction(action))
            {
                action = getAction(PORTLET_APP_ACTION_PREFIX, action);
               
                if(action.endsWith("metadata"))
                {
                    processMetadataAction(actionRequest, actionResponse, pa, null, action);
                }
                else if(action.endsWith("user_attribute"))
                {
                    processUserAttributeAction(actionRequest, actionResponse, pa, action);
                }
                else if(action.endsWith("edit_security_constraint"))
                {
                    processSecurityRef(actionRequest, actionResponse, pa, null, action);
                }
                searchEngine.update(pa);
            }
            else if(isPortletAction(action))
            {
                action = getAction(PORTLET_ACTION_PREFIX, action);
                String pdefName = (String) actionRequest.getPortletSession().getAttribute(PortletApplicationResources.REQUEST_SELECT_PORTLET, PortletSession.APPLICATION_SCOPE);
               
                try
                {
                    PortletDefinitionComposite pdef = (PortletDefinitionComposite) pa.getPortletDefinitionByName(pdefName);
                    if(action.endsWith("metadata"))
                    {
                        processMetadataAction(actionRequest, actionResponse, null, pdef, action);
                    }
                    else if(action.endsWith("portlet"))
View Full Code Here

        List list = new LinkedList();
        Iterator portlets = registry.getAllPortletDefinitions().iterator();
        while ( portlets.hasNext() )
        {
            PortletDefinitionComposite portlet = (PortletDefinitionComposite)portlets.next();
            MutablePortletApplication muta = (MutablePortletApplication)portlet.getPortletApplicationDefinition();
            String appName = muta.getName();
            if ( appName == null )
                continue;
            if ( ! appName.equals( "jetspeed-layouts" ) )
                continue;
View Full Code Here

        checkStarted();
        File webinf = new File (appRoot);
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();       
        DirectoryHelper dir = new DirectoryHelper(webinf);
        String appName = (contextName.startsWith("/")) ? contextName.substring(1) : contextName;
        MutablePortletApplication app = registry.getPortletApplicationByIdentifier(appName);
        if (app != null && app.getApplicationType() == MutablePortletApplication.LOCAL)
        {
            app.setApplicationType(MutablePortletApplication.INTERNAL);
            registry.updatePortletApplication(app);
        }
        startPA(contextName, dir, contextClassLoader, MutablePortletApplication.INTERNAL);
        // startInternal(contextName, warStruct, paClassLoader, true);       
    }
View Full Code Here

  {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
        try
        {
            MutablePortletApplication pa = null;
           
            try
            {
                pa = registry.getPortletApplication(paName);
            }
View Full Code Here

    {
      unregisterPortletApplication(oldPA, false);
      oldPA = null;
    }

    MutablePortletApplication pa     = null;
    boolean            registered = false;
    String            paName     = paWar.getPortletApplicationName();

    try
    {
      log.info("Loading portlet.xml...." + paName);
      pa = paWar.createPortletApp(paClassLoader);
      pa.setApplicationType(paType);

      // load the web.xml
      log.info("Loading web.xml...." + paName);
      MutableWebApplication wa = paWar.createWebApp();
      paWar.validate();

      if (paType == MutablePortletApplication.LOCAL)
      {
        wa.setContextRoot("<portal>");
      }
            else if (paType == MutablePortletApplication.INTERNAL)
            {
                // TODO: this is screwing up the PSML as its set all over the place to "jetspeed-layouts", not good
                wa.setContextRoot("/" + paName);               
            }

      pa.setWebApplicationDefinition(wa);
           
            // Make sure existing entities are refreshed with the most
            // recent PortletDefintion.
            Collection portletDefs = pa.getPortletDefinitions();
            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())
                        {
                            PortletEntityCtrl portletEntity = (PortletEntityCtrl) peItr.next();
                            portletEntity.setPortletDefinition(pd);
                        }
                    }
                }
            }
    }
    catch (Exception e)
    {
      String msg = "Failed to load portlet application for "
        + paWar.getPortletApplicationName();
      log.error(msg, e);
      throw new RegistryException(msg);
    }

    // register the portlet application
    try
    {
      registry.registerPortletApplication(pa);
      registered = true;
      log.info("Registered the portlet application " + paName);

      // add to search engine result
      this.updateSearchEngine(false, pa);
     
      // and add to the current node info
      nodeManager.addNode(new Long(pa.getId().toString()), pa.getName());
           
            // grant default permissions to portlet application
      grantDefaultPermissions(paName);
           
            if ( autoCreateRoles && roleManager != null && pa.getWebApplicationDefinition().getSecurityRoles() != null )
            {
                try
                {
                    Iterator rolesIter = pa.getWebApplicationDefinition().getSecurityRoles().iterator();
                    SecurityRole sr;
                    while ( rolesIter.hasNext() )
                    {
                        sr = (SecurityRole)rolesIter.next();
                        if ( !roleManager.roleExists(sr.getRoleName()) )
View Full Code Here

TOP

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

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.