Package org.apache.jetspeed.portal

Examples of org.apache.jetspeed.portal.PortletConfig


        // first make sure we propagate init
        super.init();

        try
        {
            PortletConfig config = this.getPortletConfig();
            String param = null;

            param = config.getInitParameter(PARAM_SOURCE);
            if (param != null)
            {
                setSource(param);
            }

            param = config.getInitParameter(PARAM_WIDTH);
            if (param != null)
            {
                setWidth(param);
            }

            param = config.getInitParameter(PARAM_HEIGHT);
            if (param != null)
            {
                setHeight(param);
            }

            param = config.getInitParameter(PARAM_SCROLLING);
            if (param != null)
            {
                setScrolling(param);
            }

            param = config.getInitParameter(PARAM_FRAMEBORDER);
            if (param != null)
            {
                setFrameBorder(param);
            }

            param = config.getInitParameter(PARAM_STYLE);
            if (param != null)
            {
                setStyle(param);
            }

            param = config.getInitParameter(PARAM_NAME);
            if (param != null)
            {
                setFrameName(param);
            }

            param = config.getInitParameter(PARAM_REFRESH);
            if (param != null)
            {
                setRefresh(param);
            }

            param = config.getInitParameter(PARAM_MARGINWIDTH);
            if (param != null)
            {
                setMarginWidth(param);
            }

            param = config.getInitParameter(PARAM_MARGINHEIGHT);
            if (param != null)
            {
                setMarginHeight(param);
            }

            param = config.getInitParameter(PARAM_ALIGN);
            if (param != null)
            {
                setAlign(param);
            }
View Full Code Here


    /**
    */
    public void init() throws PortletException
    {
        PortletConfig pc = getPortletConfig();
        ConcreteElement myContent = null;
        try
        {
            screen = ( String ) pc.getInitParameter( SCREEN );
            //if it is null here it should be in the parameters
            if ( screen == null )
            {
                throw new IllegalArgumentException("Missing screen parameter");
            }

            //if it is still null something is wrong
            if ( screen == null )
            {
                throw new PortletException( "You need to specify a " + SCREEN + " parameter for this portlet" );
            }

            /* Save the parameters if any */
            String param = null;
            String value = null;
            java.util.Map dict = pc.getInitParameters();
            Iterator en = dict.keySet().iterator();
            int index = -1;
            String tParam = screen + ".param";
            String newParam = null;
            paramSet = new Hashtable();
View Full Code Here

     */
    public static Object getHandle(Object config)
    {
        //this implementation expects a PortletConfig object as its
        // configuration
        PortletConfig pc = null;

        if (!(config instanceof PortletConfig))
        {
            return null;

        }

        // By default, only take into account the init parameters
        pc = (PortletConfig)config;
        StringBuffer handle = new StringBuffer(256);

        if (pc.getURL()!=null && pc.isCachedOnURL())
        {
            handle.append(String.valueOf(pc.getURL().hashCode()));
        }

        Iterator i = pc.getInitParameterNames();
        while(i.hasNext())
        {
            String name = (String)i.next();
            String value = pc.getInitParameter(name);

            if (value!=null)
            {
                handle.append("|").append(name).append("-").append(value);
            }
View Full Code Here

    }

    /**
     */
    public void setDescription( String description ) {
        PortletConfig pc = getPortletConfig();
        if (pc==null) {
            pc = new BasePortletConfig();
            setPortletConfig(pc);
        }

        MetaData meta = pc.getMetainfo();
        if (meta==null) {
            meta = new MetaData();
            pc.setMetainfo(meta);
        }

        meta.setDescription(description);
    }
View Full Code Here

     * @param title Portlet title.
     */
    public void setTitle(String title)
    {

        PortletConfig pc = getPortletConfig();
        if (pc == null)
        {
            pc = new BasePortletConfig();
            setPortletConfig(pc);
        }

        MetaData meta = pc.getMetainfo();
        if (meta == null)
        {
            meta = new MetaData();
            pc.setMetainfo(meta);
        }

        meta.setTitle(title);
    }
View Full Code Here

      return getImage();
    }

    public void setImage( String image )
    {
        PortletConfig pc = getPortletConfig();
        if (pc==null) {
            pc = new BasePortletConfig();
            setPortletConfig(pc);
        }

        MetaData meta = pc.getMetainfo();
        if (meta==null) {
            meta = new MetaData();
            pc.setMetainfo(meta);
        }

        meta.setImage(image);
    }
View Full Code Here

        if (PortletEntry.TYPE_ABSTRACT.equals(regEntry.getType()))
        {
            throw new PortletException("PortletFactory: can't instanciate abstract registry entry: "+regEntry.getName());
        }
           
        PortletConfig pc = getPortletConfig(regEntry, entry.getId());

        // Set portlet config with values from PSML Entry
        pc.getInitParameters().putAll(getParameters(entry));
        pc.setPortletSkin( PortalToolkit.getSkin( entry.getSkin() ) );
        pc.setSecurityRef( getSecurityReference(entry, regEntry));

        return getPortlet( getClassname(regEntry), pc, entry.getId() );
    }
View Full Code Here

        if (PortletEntry.TYPE_ABSTRACT.equals(regEntry.getType()))
        {
            throw new PortletException("PortletFactory: can't instanciate abstract registry entry: "+name);
        }
           
        PortletConfig pc = getPortletConfig(regEntry, id);
       
        return getPortlet( getClassname(regEntry), pc, null );
    }
View Full Code Here

    protected PortletConfig getPortletConfig( PortletEntry portletEntry, String id)
    {
        Map map = new HashMap();
        map.putAll(portletEntry.getParameterMap());
       
        PortletConfig pc = new BasePortletConfig();
        pc.setName( portletEntry.getName() );
        addParentInitParameters(portletEntry, map);       
        pc.setInitParameters( map );
        pc.setMetainfo( getMetaData( portletEntry ) );
        pc.setURL( portletEntry.getURL() );
        pc.setCachedOnURL( portletEntry.isCachedOnURL() );
        //pc.setSecurityRef(portletEntry.getSecurityRef());
        pc.setSecurityRef(getSecurityReference(null, portletEntry));

        if (runDataService != null)
        {
            JetspeedRunData rundata = runDataService.getCurrentRunData();
            if (rundata != null)
            {
                Profile profile = rundata.getProfile();
                if (profile != null)
                {
                    pc.setPageId(profile.getId());
                }
            }
        }
        pc.setPortletId(id);

        return pc;
    }
View Full Code Here

   * The servlet/JSP will be invoked when the ECS tree is written
   * to the servlet output stream and add its output to the stream.
   */
  public ConcreteElement getContent(RunData rundata) {
  // !!! Need to check this - is this the right rundata object ? !!!
  PortletConfig pc = this.getPortletConfig();

  String servletURL = null;
  try {
    servletURL = (String) this.getPortletConfig().getInitParameter("url");
    return new EcsServletElement(rundata, servletURL);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.portal.PortletConfig

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.