Package org.apache.jetspeed.portal

Examples of org.apache.jetspeed.portal.PortletConfig


    /**
    Init this Portlet, set it's title, description, etc.
    */
    public void init() throws PortletException {

        PortletConfig config = this.getPortletConfig();
       
        provider = config.getInitParameter( PROVIDER_NAME_KEY );
       
        if ( provider == null ) {
            throw new PortletException( "You need to specify " + PROVIDER_NAME_KEY );
        }

View Full Code Here


    /**
    */
    public void init() throws PortletException
    {

        PortletConfig config = this.getPortletConfig();

        this.setTitle( "Applications" );
        this.setDescription( "A list of Applications that are installed within Jetspeed" );

        logger.info( "Jetspeed: initializing the ApplicationsPortlet: BEGIN " );
View Full Code Here

    {
 
        if (initDone) // Why is init called more than once per portlet?
            return;

        PortletConfig config = this.getPortletConfig();
       
        try
        {
            rewriter = new HTMLRewriter();

            // fetch username and password for HTTP Basic Autentication
            username = config.getInitParameter("username");
            password = config.getInitParameter("password");
           
            contentStale = true;
            initDone = true;
        }
        catch (Exception e)
View Full Code Here

    @param data the RunData object for the request
    @return the content to be displayed to the user-agent
    */
    public ConcreteElement getContent( RunData data )
    {
        PortletConfig config = this.getPortletConfig();
       
        if (contentStale == true)
            return getWebPageContent(data, config);
       
        if (null == getExpirationMillis())
View Full Code Here

    @param data the RunData object for the request
    @return the content to be displayed to the user-agent
    */
    public ConcreteElement getContent(RunData data)
    {
        PortletConfig config = this.getPortletConfig();

        if (contentStale == true)
            return getWebClippedContent(data, config);

        if (null == getExpirationMillis())
View Full Code Here

    public void init() throws PortletException {
 
        if (initDone) // Why is init called more than once per portlet?
            return;

        PortletConfig config = this.getPortletConfig();
       
        try
        {
            //FIXME: HTMLRewriter should take a Reader, and work
            rewriter = new HTMLRewriter(
                    ! config.getInitParameter("dont_remove_script","no")
                        .equalsIgnoreCase("yes"),
                    ! config.getInitParameter("dont_remove_style","no")
                        .equalsIgnoreCase("yes"),
                    ! config.getInitParameter("dont_remove_noscript","no")
                        .equalsIgnoreCase("yes"),
                    ! config.getInitParameter("dont_remove_meta","no")
                        .equalsIgnoreCase("yes"),
                    ! config.getInitParameter("dont_remove_applet","no")
                        .equalsIgnoreCase("yes"),
                    ! config.getInitParameter("dont_remove_object","no")
                        .equalsIgnoreCase("yes"),
                    ! config.getInitParameter("dont_remove_head","no")
                        .equalsIgnoreCase("yes"),
                    ! config.getInitParameter("dont_remove_onsomething","no")
                        .equalsIgnoreCase("yes"),
                    config.getInitParameter("open_in_popup","no")
                        .equalsIgnoreCase("yes")
                        );

            // fetch username and password for HTTP Basic Autentication
            username = config.getInitParameter("username");
            password = config.getInitParameter("password");
           
            contentStale = true;
            initDone = true;
        } catch (Exception e) {
            logger.info("Exception occurred:" + e.toString());
View Full Code Here

    @param data the RunData object for the request
    @return the content to be displayed to the user-agent
    */
    public ConcreteElement getContent( RunData data )
    {
        PortletConfig config = this.getPortletConfig();
       
        if (contentStale == true)
            return getWebPageContent(data, config);
       
        if (null == getExpirationMillis())
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;           
        }

        // form the key from the current request's portal page profile
        // and the portlet id in the config
        pc = (PortletConfig)config;

        StringBuffer handle = new StringBuffer(256);
        handle.append(pc.getPageId());
        handle.append('/');
        handle.append(pc.getPortletId());

        return handle.toString();  

    }   // getHandle
View Full Code Here

            return;
        }               

          
        PortletConfig portletConf = portlet.getPortletConfig();
        Integer colObj = portletConf.getConstraints().getColumn();
        Integer rowObj = portletConf.getConstraints().getRow();

        int col = (colObj!=null)?colObj.intValue():0;
        int row = (rowObj!=null)?rowObj.intValue():0;
       
        if ( col + 1 > this.getColumn() ) {
View Full Code Here

        ElementContainer base = new ElementContainer();

        try
        {
        PortletSet portlets = getPortlets();
        PortletConfig pc = portlets.getPortletConfig();

        // first get the number of columns and rows to display
        Enumeration en = portlets.getPortlets();
     
        //see if any or the Portlets you want to add have a larger column or
        //row number than that defined in PSML
        while ( en.hasMoreElements() ) {

            Portlet portlet = (Portlet)en.nextElement();

            calculateControllerLayout( portlet );
           
        }

        setWidth( pc.getLayout( "width", getWidth() ) );

        int rows = getRow();
        int cols = getColumn();

        if (0 == rows || 0 == cols)
            return base; // empty container

        Table t = new Table()
                       .setWidth( this.getWidth() )
                       .setCellPadding( this.getPadding() )
                       .setAlign("center");

        base.addElement( t );

        ElementContainer[][] elements = new ElementContainer[rows][cols];

        for( int i = 0; i < rows; i++ )  {
            for ( int j = 0 ; j < cols; j++ ) {
                elements[i][j]=new ElementContainer();
            }
        }

        // populate the elements array
        en = portlets.getPortlets();
        while (en.hasMoreElements() ) {

            Portlet p = (Portlet)en.nextElement();
            PortletConfig pConf = p.getPortletConfig();

            Integer colObj = pConf.getConstraints().getColumn();
            Integer rowObj = pConf.getConstraints().getRow();
            int colnum = (colObj!=null)?colObj.intValue():0;
            int rownum = (rowObj!=null)?rowObj.intValue():0;

            elements[rownum % rows][colnum % cols]
                .addElement( p.getContent( rundata ) );
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.