Package org.apache.jetspeed.om.registry

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


     * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
     */
    protected void addParentInitParameters(PortletEntry entry, Map hash)
    {
        // Now map any parameters from the parent that the child does not have
        PortletEntry parent = getParentEntry(entry);
        if (parent != null)
        {
            Map parentMap = parent.getParameterMap();
            Iterator names = parent.getParameterNames();

            while (names.hasNext())
            {
                String key = (String) names.next();
                if (!hash.containsKey(key))
View Full Code Here


            org.apache.jetspeed.om.registry.Registry registry =
                Registry.get(Registry.PORTLET);
            Enumeration entries = registry.getEntries();
            while (entries.hasMoreElements())
            {
                PortletEntry regEntry = (PortletEntry) entries.nextElement();

                String regType = regEntry.getType();
                if (regType.equalsIgnoreCase("abstract"))
                {
                    parentSet.add(regEntry.getName());
                }
            }

            context.put("parents", parentSet);
            context.put(
                "securitys",
                CustomizeSetAction.buildList(rundata, Registry.SECURITY));
        }

        if (mode != null && mode.equals(SecurityConstants.PARAM_MODE_UPDATE))
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);

            String tab = rundata.getParameters().getString(TAB_PARAMETER);
            context.put("currentTab", tab);

            context.put(
                "securitys",
                CustomizeSetAction.buildList(rundata, Registry.SECURITY));

            context.put("entry", portletEntry);
           
            MediaTypeRegistry mediaTypeReg = (MediaTypeRegistry)Registry.get(Registry.MEDIA_TYPE);
            context.put("media_types", iteratorToCollection(mediaTypeReg.listEntryNames()));
           
            if(portletEntry.getType() != null && portletEntry.getType().equals("ref"))
            {
                PortletEntry parentEntry = (PortletEntry) Registry.getEntry(Registry.PORTLET, portletEntry.getParent());
                if(parentEntry == null)
                {
                    logger.error(this.getClass().getName() + ": Portlet " + portletName + " of type ref has no parent.  This portlet will not work properly.");
                }
                else
                {
                    Collection parentCategories = iteratorToCollection(parentEntry.listCategories());
                    context.put("parent_categories", parentCategories);
                   
                    Collection parentMediaTypes = iteratorToCollection(parentEntry.listMediaTypes());
                    context.put("parent_mediatypes", parentMediaTypes);
                }
            }
        }

        if (mode != null && mode.equals(SecurityConstants.PARAM_MODE_DELETE))
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(registry, portletName);

            context.put("entry", portletEntry);
        }
    }
View Full Code Here

        super.doInsert(rundata, context);
       
        String entryName =
               rundata.getParameters().getString(registryEntryName);
       
        PortletEntry portletEntry =
                        (PortletEntry) Registry.getEntry(registry, entryName);
        if (portletEntry == null)
        {
            String message = "Portlet entry " + entryName + " does not exist.  The portlet was not added to the registry.";
            logger.error(this.getClass().getName() + ": " + message);
           
            throw new IllegalStateException(message);
        }
        else
        {
            if(portletEntry.getType().equals("ref")) {
                PortletEntry parentEntry = (PortletEntry)Registry.getEntry(Registry.PORTLET, portletEntry.getParent());
               
                if(parentEntry == null)
                {
                    logger.error(this.getClass().getName() + ": Portlet " + entryName + " of type ref has no parent.  This portlet will not work properly.");
                }
View Full Code Here

    {
        try
        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
            if (portletEntry != null)
            {
                String categoryName =
                    rundata.getParameters().getString("category_name");
                if (categoryName != null && categoryName.length() > 0)
                {
                    String categoryGroup =
                        rundata.getParameters().getString(
                            "category_group",
                            "Jetspeed");
                    portletEntry.addCategory(categoryName, categoryGroup);

                    Registry.addEntry(registry, 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[] categories =
                    rundata.getParameters().getStrings("category_name");
                if (categories != null && categories.length > 0)
                {
                    for (int i = 0; i < categories.length; i++)
                    {
                        String categoryName = categories[i];
                        String categoryGroup =
                            rundata.getParameters().getString(
                                categoryName + ".category_group",
                                "Jetspeed");
                        portletEntry.removeCategory(
                            categoryName,
                            categoryGroup);
                    }

                    Registry.addEntry(registry, portletEntry);
View Full Code Here

     * @param portlet The jsp-based portlet that is being built.
     * @param rundata The turbine rundata context for this request.
     */
    protected void buildNormalContext(Portlet portlet, RunData rundata)
    {
        PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, portlet.getName());
        Iterator i = entry.getParameterNames();
        Hashtable qa = new Hashtable();

        while (i.hasNext())
        {
            String name = (String) i.next();
            Parameter param = entry.getParameter(name);
            if (param.isHidden() == false)
            {
                String title = param.getTitle();
                String value = portlet.getPortletConfig().getInitParameter(name);
                qa.put(title, value);
View Full Code Here

     * @param rundata The turbine rundata context for this request.
     */
    public void doEmail(RunData rundata, Portlet portlet)
    {
        StringBuffer emailBody = new StringBuffer();
        PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, portlet.getName());
        Iterator i = entry.getParameterNames();

        while (i.hasNext())
        {
            String name = (String) i.next();
            Parameter param = entry.getParameter(name);
            if (param.isHidden() == false)
            {
                String title = param.getTitle();
                String value = portlet.getPortletConfig().getInitParameter(name);
                value = value == null || value.length() == 0 ? "NOT PROVIDED" : value;
View Full Code Here

     * @param rundata
     */
    protected void buildNormalContext(Portlet portlet, Context context, RunData rundata)
    {

        PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, portlet.getName());
        context.put("can-search", canPerformAction(rundata, entry, entry.getParameter("can-search")));
        context.put("can-clone", canPerformAction(rundata, entry, entry.getParameter("can-clone")));
        context.put("can-import", canPerformAction(rundata, entry, entry.getParameter("can-import")));
        context.put("can-export", canPerformAction(rundata, entry, entry.getParameter("can-export")));
        context.put("can-import-all", canPerformAction(rundata, entry, entry.getParameter("can-import-all")));
        context.put("can-export-all", canPerformAction(rundata, entry, entry.getParameter("can-export-all")));
        context.put("can-add", canPerformAction(rundata, entry, entry.getParameter("can-add")));
        context.put("can-remove", canPerformAction(rundata, entry, entry.getParameter("can-remove")));

        String mode = rundata.getParameters().getString("mode", "browse");
        if (mode.equals("browse"))
        {
            this.setTemplate(rundata, PortletConfigState.getParameter(portlet, rundata, "template", "browser-psml"));
View Full Code Here

    /**
     */
    public boolean supportsType( MimeType mimeType )
    {
        PortletEntry entry = (PortletEntry)Registry.getEntry(Registry.PORTLET, getName() );
        String baseType = mimeType.toString();
        if (entry!=null)
        {
            Iterator i = entry.listMediaTypes();

            while(i.hasNext())
            {
                String name = (String)i.next();
                MediaTypeEntry media = (MediaTypeEntry)Registry.getEntry(Registry.MEDIA_TYPE, name);
View Full Code Here

        Collection c = new ArrayList();

        for (Iterator i = Registry.get(Registry.PORTLET).listEntryNames(); i.hasNext();)
        {
            PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, (String) i.next());
            if (!entry.getType().equals(PortletEntry.TYPE_ABSTRACT) && !entry.isHidden())
            {
                c.add(entry);
                //System.out.println("Will index [" + entry.getTitle() + "]");
            }
        }
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.