Package org.apache.jetspeed.om.registry

Examples of org.apache.jetspeed.om.registry.PortletEntry


    {
        try
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
            if (portletEntry != null)
            {
                String[] mediaTypes =
                    rundata.getParameters().getStrings("media_type");
                if (mediaTypes != null && mediaTypes.length > 0)
                {
                    for (int i = 0; i < mediaTypes.length; i++)
                    {
                        String mediaType = mediaTypes[i];
                        portletEntry.removeMediaType(mediaType);
                    }

                    Registry.addEntry(Registry.PORTLET, portletEntry);
                    clearUserData(rundata);
                }
View Full Code Here


    {
        try
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
            if (portletEntry != null)
            {
                Registry.removeEntry(Registry.PORTLET, portletName);
                clearUserData(rundata);
View Full Code Here

    {
        try
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
            if (portletEntry != null)
            {
                String parameterName =
                    rundata.getParameters().getString("parameter_name");
                if (parameterName != null && parameterName.length() > 0)
                {
                    String parameterValue =
                        rundata.getParameters().getString("parameter_value");
                    String description =
                        rundata.getParameters().getString("description");
                    String title = rundata.getParameters().getString("title");
                    String securityRole =
                        rundata.getParameters().getString("security_role");
                    String securityRef =
                        rundata.getParameters().getString("security_ref");
                    boolean isHidden =
                        rundata.getParameters().getBoolean("is_hidden", false);
                    boolean isCachedOnName =
                        rundata.getParameters().getBoolean(
                            "cached_on_name",
                            false);
                    boolean isCachedOnValue =
                        rundata.getParameters().getBoolean(
                            "cached_on_value",
                            false);

                    BaseCachedParameter parameter = new BaseCachedParameter();
                    parameter.setName(parameterName);
                    parameter.setValue(parameterValue);
                    parameter.setHidden(isHidden);
                    parameter.setCachedOnName(isCachedOnName);
                    parameter.setCachedOnValue(isCachedOnValue);
                    parameter.setDescription(description);
                    parameter.setTitle(title);

                    if (securityRole != null && securityRole.length() > 0)
                    {
                        BaseSecurity paramSecurity = new BaseSecurity();
                        paramSecurity.setRole(securityRole);
                        parameter.setSecurity(paramSecurity);
                    }

                    if (securityRef != null && securityRef.length() > 0)
                    {
                        BaseSecurityReference paramSecurityRef =
                            new BaseSecurityReference();
                        paramSecurityRef.setParent(securityRef);
                        parameter.setSecurityRef(paramSecurityRef);
                    }

                    portletEntry.addParameter(parameter);

                    Registry.addEntry(Registry.PORTLET, portletEntry);

                    clearUserData(rundata);
                }
View Full Code Here

    {
        try
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
            if (portletEntry != null)
            {
                String[] parameters =
                    rundata.getParameters().getStrings("update_parameter_name");
                if (parameters != null && parameters.length > 0)
                {
                    for (int i = 0; i < parameters.length; i++)
                    {
                        String parameterName = parameters[i];
                        String parameterValue =
                            rundata.getParameters().getString(
                                parameterName + ".parameter_value");
                        String description =
                            rundata.getParameters().getString(
                                parameterName + ".description");
                        String title =
                            rundata.getParameters().getString(
                                parameterName + ".title");
                        String securityRole =
                            rundata.getParameters().getString(
                                parameterName + ".security_role");
                        String securityRef =
                            rundata.getParameters().getString(
                                parameterName + ".security_ref");
                        boolean isHidden =
                            rundata.getParameters().getBoolean(
                                parameterName + ".is_hidden",
                                false);
                        boolean isCachedOnName =
                            rundata.getParameters().getBoolean(
                                parameterName + ".cached_on_name",
                                false);
                        boolean isCachedOnValue =
                            rundata.getParameters().getBoolean(
                                parameterName + ".cached_on_value",
                                false);

                        BaseCachedParameter parameter =
                            new BaseCachedParameter();
                        parameter.setName(parameterName);
                        parameter.setValue(parameterValue);
                        parameter.setHidden(isHidden);
                        parameter.setCachedOnName(isCachedOnName);
                        parameter.setCachedOnValue(isCachedOnValue);
                        parameter.setDescription(description);
                        parameter.setTitle(title);

                        if (securityRole != null && securityRole.length() > 0)
                        {
                            BaseSecurity paramSecurity = new BaseSecurity();
                            paramSecurity.setRole(securityRole);
                            parameter.setSecurity(paramSecurity);
                        }

                        if (securityRef != null && securityRef.length() > 0)
                        {
                            BaseSecurityReference paramSecurityRef =
                                new BaseSecurityReference();
                            paramSecurityRef.setParent(securityRef);
                            parameter.setSecurityRef(paramSecurityRef);
                        }

                        portletEntry.addParameter(parameter);
                    }

                    Registry.addEntry(Registry.PORTLET, portletEntry);
                    clearUserData(rundata);
                }
View Full Code Here

    {
        try
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
            if (portletEntry != null)
            {
                String[] parameters =
                    rundata.getParameters().getStrings("update_parameter_name");
                if (parameters != null && parameters.length > 0)
                {
                    for (int i = 0; i < parameters.length; i++)
                    {
                        String parameterName = parameters[i];
                        String parameterValue =
                            rundata.getParameters().getString(
                                parameterName + ".parameter_value");

                        BaseCachedParameter parameter =
                            (
                                BaseCachedParameter) portletEntry
                                    .getCachedParameter(
                                parameterName);
                        parameter.setValue(parameterValue);
                    }
View Full Code Here

    {
        try
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
            if (portletEntry != null)
            {
                String[] parameters =
                    rundata.getParameters().getStrings("parameter_name");
                if (parameters != null && parameters.length > 0)
                {
                    for (int i = 0; i < parameters.length; i++)
                    {
                        String parameterName = parameters[i];
                        portletEntry.removeParameter(parameterName);
                    }

                    Registry.addEntry(Registry.PORTLET, portletEntry);
                    clearUserData(rundata);
                }
View Full Code Here

        context.put("action", "portlets.CustomizeAction");

        if (p==null) return;

        // retrieve the portlet parameters
        PortletEntry entry = (PortletEntry)Registry.getEntry(Registry.PORTLET,p.getName());
        // save the entry in the session
        Vector params = new Vector();
        Iterator i = entry.getParameterNames();

        while(i.hasNext())
        {
            String name = (String)i.next();
            Parameter param = entry.getParameter(name);

            // filter some "system" and hidden parameters
            if (  (!param.isHidden()) && (name.charAt(0)!='_') )
            {
                // check the user role
                if (JetspeedSecurity.checkPermission((JetspeedUser)rundata.getUser(), new PortalResource( entry, param), JetspeedSecurity.PERMISSION_CUSTOMIZE))
                {
                    params.add(entry.getParameter(name));
                }
            }
        }

        // get the customization state for this page
View Full Code Here

           int pnamesIndex = 0;
           //Go through all the portlets on this page and figure out which ones have been
           //checked and which ones unchecked and accordingly update the userSelectionMap
           for (int portletIndex = start; portletIndex < end; portletIndex++)
           {
               PortletEntry entry = (PortletEntry) portlets.get(portletIndex);
               if (pnames != null
                   && pnamesIndex < pnames.length
                   && pnames[pnamesIndex].equals(entry.getName()))
               {
                    userSelections.put(entry.getName(), entry);
                    pnamesIndex++;
               }
               else
               {
                    userSelections.remove(entry.getName());
               }
           }
           PortletSessionState.setAttribute(rundata, USER_SELECTIONS, userSelections);
           /*
           Iterator it = userSelections.keySet().iterator();          
View Full Code Here

            int cc;
            Entry usedEntry;
                                         
            for (int i = 0; i < pnames.length; i++)
            {
                PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, pnames[i]);

                // add only new portlets!
                if ((entry != null) && (portlets != null))
                {
               
View Full Code Here

                   
        Iterator i = Registry.get(Registry.PORTLET).listEntryNames();
       
        while (i.hasNext())
        {
            PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET,
                                                                 (String) i.next());
           
            Iterator medias;
            //Make a master portlet list, we will eventually us this to build a category list
            allPortlets.add(entry);
            // MODIFIED: Selection now takes care of the specified mediatype!
            if (JetspeedSecurity.checkPermission((JetspeedUser) data.getUser(),
                                                 new PortalResource(entry),
                                                 JetspeedSecurity.PERMISSION_VIEW)
              && ((!entry.isHidden())
                && (!entry.getType().equals(PortletEntry.TYPE_ABSTRACT))
                && entry.hasMediaType(mediaType)))
            {
                medias = entry.listMediaTypes();
//                Logme.now ("MediaTypes for entry: "+entry.getName()+"  type = "+entry.getType());
//                while (medias.hasNext())
//                {
//                  Logme.now ((String)medias.next());
//                }
// 
                // Filter by category
                String filterCat = (Stringdata.getUser().getTemp("filter_category");
                if (filterCat == null || (filterCat.equals("All Portlets") || entry.hasCategory(filterCat)))
                {               
                    list.add(entry);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.registry.PortletEntry

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.