Package org.apache.jetspeed.om.profile

Examples of org.apache.jetspeed.om.profile.Entry


            }
        }

        for (int i=0; i < portlets.getEntryCount(); i++)
        {
            Entry p = portlets.getEntry(i);
            Layout layout = p.getLayout();
            if (layout!=null)
            {
                try
                {
                    int pos = (int)layout.getPosition();
                    if (pos>=0)
                    {
                        plist.set(pos,p);
                    }
                    else
                    {
                        work.add(p);
                    }
                }
                catch (Exception e)
                {
                    layout.setPosition(-1);
                    work.add(p);
                }
            }
            else
            {
                work.add(p);
            }
        }

        Iterator i = work.iterator();
        for(int idx=0;idx < plist.size(); idx++)
        {
            if (plist.get(idx)==null)
            {
                if (i.hasNext())
                {
                    plist.set(idx,i.next());
                }
                else
                {
                    plist.remove(idx);
                }
            }
        }

        Map titles = new HashMap();
        i = plist.iterator();
        while(i.hasNext())
        {
            Object obj = i.next();

            if (obj instanceof Portlets)
            {
                Portlets entry = (Portlets)obj;
                if ((entry.getMetaInfo()!=null)&&(entry.getMetaInfo().getTitle()!=null))
                {
                    titles.put(entry.getId(),entry.getMetaInfo().getTitle());
                }
            }
            else
            {
                Entry entry = (Entry)obj;
                if ((entry.getMetaInfo()!=null)&&(entry.getMetaInfo().getTitle()!=null))
                {
           titles.put(entry.getId(), entry.getMetaInfo().getTitle());
                }
                else
                {
                    RegistryEntry pentry = Registry.getEntry(Registry.PORTLET,entry.getParent());

                    if (pentry!=null)
                    {
            titles.put(entry.getId(), pentry.getTitle());
                    }
                }
            }
        }
View Full Code Here


                }

                // try explicit entry position
                for(int i=0; i < set.getEntryCount(); i++)
                {
                    Entry p = set.getEntry(i);
                    Layout layout = p.getLayout();

                    if ((layout!=null) && (layout.getPosition() != -1))
                    {
                        int lpos = (int)layout.getPosition();
View Full Code Here

                // try explicit entry position
                for(int i=0; i < set.getEntryCount(); i++)
                {
                    if ((targetLayout!=null) && (baseLayout!=null)) break;

                    Entry p = set.getEntry(i);
                    Layout layout = p.getLayout();
                    if ((layout!=null)&&(layout.getPosition()!=-1))
                    {
                        int lpos = (int)layout.getPosition();
                        if ((baseLayout == null) && (lpos==position))
                        {
                            baseLayout = layout;
                        }

                        if ((targetLayout == null) && (lpos==target))
                        {
                            targetLayout = layout;
                        }
                    }
                }

                //else use implicit position
                if (baseLayout == null)
                {
                    if (position < set.getPortletsCount())
                    {
                        Portlets p = set.getPortlets(position);
                        if (p.getLayout()==null)
                        {
                            p.setLayout(new PsmlLayout());
                        }
                        baseLayout=p.getLayout();
                    }

                    if (position < set.getEntryCount())
                    {
                        Entry p = set.getEntry(position);
                        if (p.getLayout()==null)
                        {
                            p.setLayout(new PsmlLayout());
                        }
                        baseLayout=p.getLayout();
                    }
                }

                if (targetLayout == null)
                {
                    if (target < set.getPortletsCount())
                    {
                        Portlets p = set.getPortlets(target);
                        if (p.getLayout()==null)
                        {
                            p.setLayout(new PsmlLayout());
                        }
                        targetLayout=p.getLayout();
                    }

                    if (target < set.getEntryCount())
                    {
                        Entry p = set.getEntry(target);
                        if (p.getLayout()==null)
                        {
                            p.setLayout(new PsmlLayout());
                        }
                        targetLayout=p.getLayout();
                    }
                }

                //we should now have found both baseLayout and targetLayout, swap
                //their positions using explicit positioning
View Full Code Here

        for (Iterator eit = portlets.getEntriesIterator(); eit.hasNext();)
        {
            try
            {

                Entry psmlEntry = (Entry) eit.next();
                PortletEntry entry =
                    (PortletEntry) Registry.getEntry(Registry.PORTLET, psmlEntry.getParent());

                if (entry != null)
                {
                    Portlet p = PortletFactory.getPortlet(psmlEntry);

                    if (p != null)
                    {
                        Map constraints = getParameters(psmlEntry.getLayout());
                        int position = getPosition(psmlEntry.getLayout());

                        PortletControl control = getControl(psmlEntry.getControl(), entry);

                        set.addPortlet(
                            initControl(control, p),
                            controller.getConstraints(constraints),
                            position);
                    }
                }
                else
                {
                    logger.error(
                        " The portlet "
                            + psmlEntry.getParent()
                            + " does not exist in the Registry ");
                    continue;
                }
            }
            catch (JetspeedException e)
View Full Code Here

            }
        }

        for (int i=0; i < portlets.getEntryCount(); i++)
        {
            Entry p = portlets.getEntry(i);
            Layout layout = p.getLayout();
            if (layout!=null)
            {
                try
                {
                    int pos = (int)layout.getPosition();
                    if (pos>=0)
                    {
                        plist.set(pos,p);
                    }
                    else
                    {
                        work.add(p);
                    }
                }
                catch (Exception e)
                {
                    layout.setPosition(-1);
                    work.add(p);
                }
            }
            else
            {
                work.add(p);
            }
        }

        Iterator i = work.iterator();
        for(int idx=0;idx < plist.size(); idx++)
        {
            if (plist.get(idx)==null)
            {
                if (i.hasNext())
                {
                    plist.set(idx,i.next());
                }
                else
                {
                    plist.remove(idx);
                }
            }
        }

        Map titles = new HashMap();
        i = plist.iterator();
        while(i.hasNext())
        {
            Object obj = i.next();

            if (obj instanceof Portlets)
            {
                Portlets entry = (Portlets)obj;
                if ((entry.getMetaInfo()!=null)&&(entry.getMetaInfo().getTitle()!=null))
                {
                    titles.put(entry.getId(),entry.getMetaInfo().getTitle());
                }
            }
            else
            {
                Entry entry = (Entry)obj;
                if ((entry.getMetaInfo()!=null)&&(entry.getMetaInfo().getTitle()!=null))
                {
           titles.put(entry.getId(), entry.getMetaInfo().getTitle());
                }
                else
                {
                    RegistryEntry pentry = Registry.getEntry(Registry.PORTLET,entry.getParent());

                    if (pentry!=null)
                    {
            titles.put(entry.getId(), pentry.getTitle());
                    }
                }
            }
        }
View Full Code Here

                }

                // try explicit entry position
                for(int i=0; i < set.getEntryCount(); i++)
                {
                    Entry p = set.getEntry(i);
                    Layout layout = p.getLayout();

                    if ((layout!=null) && (layout.getPosition() != -1))
                    {
                        int lpos = (int)layout.getPosition();
View Full Code Here

                // try explicit entry position
                for(int i=0; i < set.getEntryCount(); i++)
                {
                    if ((targetLayout!=null) && (baseLayout!=null)) break;

                    Entry p = set.getEntry(i);
                    Layout layout = p.getLayout();
                    if ((layout!=null)&&(layout.getPosition()!=-1))
                    {
                        int lpos = (int)layout.getPosition();
                        if ((baseLayout == null) && (lpos==position))
                        {
                            baseLayout = layout;
                        }

                        if ((targetLayout == null) && (lpos==target))
                        {
                            targetLayout = layout;
                        }
                    }
                }

                //else use implicit position
                if (baseLayout == null)
                {
                    if (position < set.getPortletsCount())
                    {
                        Portlets p = set.getPortlets(position);
                        if (p.getLayout()==null)
                        {
                            p.setLayout(new PsmlLayout());
                        }
                        baseLayout=p.getLayout();
                    }

                    if (position < set.getEntryCount())
                    {
                        Entry p = set.getEntry(position);
                        if (p.getLayout()==null)
                        {
                            p.setLayout(new PsmlLayout());
                        }
                        baseLayout=p.getLayout();
                    }
                }

                if (targetLayout == null)
                {
                    if (target < set.getPortletsCount())
                    {
                        Portlets p = set.getPortlets(target);
                        if (p.getLayout()==null)
                        {
                            p.setLayout(new PsmlLayout());
                        }
                        targetLayout=p.getLayout();
                    }

                    if (target < set.getEntryCount())
                    {
                        Entry p = set.getEntry(target);
                        if (p.getLayout()==null)
                        {
                            p.setLayout(new PsmlLayout());
                        }
                        targetLayout=p.getLayout();
                    }
                }

                //we should now have found both baseLayout and targetLayout, swap
                //their positions using explicit positioning
View Full Code Here

        // First let's add all the Entries in the current level
        Iterator eItr = portlets.getEntriesIterator();
        while(eItr.hasNext())
        {
            Object obj =  eItr.next();
            Entry entry = (Entry)obj;
            Portlet portlet = PortletFactory.getPortlet(entry);
            entries.add(new JetspeedPortletInstance(portlet, profile));
        }
       
        //Now if there are child levels, drill down recursively
View Full Code Here

    /**
     * @see PortletInstance#getAttribute()
     */
    public String getAttribute(String name, String dftValue)
    {
        Entry entry = getEntry();

        if (entry == null)
        {
            return dftValue;
        }
        Parameter attr = entry.getParameter(name);
        if (attr != null)
        {
            return attr.getValue();
        }
        else
View Full Code Here

    /**
     * @see PortletInstance#getAttribute()
     */
    public String getAttribute(String name)
    {
        Entry entry = getEntry();

        if (entry == null)
        {
            return "";
        }
        Parameter attr = entry.getParameter(name);
        if (attr != null)
        {
            return attr.getValue();
        }
        else
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.profile.Entry

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.