Examples of ElementContainer


Examples of org.apache.ecs.ElementContainer

                }

            }

            ElementContainer content = new ElementContainer();

            //content.addElement( this.getStatus() );
            //content.addElement( this.getFeedCount() );
            content.addElement( table );
            //content.addElement( this.getForm() );

            return content;

        } catch ( Throwable t ) {
View Full Code Here

Examples of org.apache.ecs.ElementContainer

    }
   
    /**
    */
    public synchronized ConcreteElement postArticle( String provider, RunData rundata ) {
        ElementContainer ec = new ElementContainer();

        ParameterParser params = rundata.getParameters();       
       
        String topic = params.getString( "topic", "" );
        String title = params.getString( "title", "" );
        String link  = params.getString( "link", "" );
        String description  = params.getString( "description", "" );
       
        //create the JCM item
        Item item = new Item();
        item.setTopic( topic );
        item.setTitle( title );
        item.setLink( link );
        item.setDescription( description );
       

        Content content = null;
        try {
            content = this.getContentMarkup( this.getURL( provider ) ).getContent();


            //BEGIN reorg of the item list so that the new entry begins at the top
            Vector v = new Vector();
           
            Item[] items = content.getChannel().getItem();
           
            for ( int i = 0; i < items.length; ++i ) {
                v.addElement( items[i] );
            }

            v.insertElementAt( item, 0 );
           
            //now build this into a new array
           
            Item[] newItems = new Item[ v.size() ];
            v.copyInto( newItems );
           
            content.getChannel().removeAllItem();
           
            //now go through all the new items and add those
            for ( int i = 0; i < newItems.length; ++i ) {
                content.getChannel().addItem( newItems[i] );
            }

            //END reorg of the item list so that the new entry begins at the top           
           
            //save the portlet markup after you have made the changes.
            this.getContentMarkup( this.getURL( provider ) ).save();

        } catch ( Throwable t ) {
            logger.error("Throwable", t);
            return new StringElement( "Can't use this provider: " + t.getMessage() );
        }
       
        ec.addElement( "Your article '" + title + "' has been posted within '" + topic + "'" );
       
        return ec;
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

    /**
    Get a list of providers an provide a form for them.
    */
    public ConcreteElement getProviders( RunData rundata ) {
       
        ElementContainer root = new ElementContainer();
       
        root.addElement( new P().addElement( "Select a content provider: " ) );

        Vector v = JetspeedResources.getVector( JetspeedResources.CONTENT_PROVIDER_LIST_KEY );
       
        for ( int i = 0; i < v.size(); ++i ) {
           
            String provider = (String)v.elementAt( i );
           
            String title = JetspeedResources.getString( "content.provider." + provider + ".title" );

            DynamicURI uri = new DynamicURI( rundata );
            uri.addQueryData( rundata.getParameters() );
            uri.addQueryData( PROVIDER_NAME_KEY, provider );

            P row = new P().addElementnew A( uri.toString() ).addElement( title ) )
                           .addElement( " ( " )
                           .addElement( new A( this.getBookmarklet( provider, rundata ) ).addElement( "Bookmarklet" ) )
                           .addElement( " ) " );
                          
            root.addElement( row );
           
           
        }
       
        return root;
View Full Code Here

Examples of org.apache.ecs.ElementContainer

    public ConcreteElement getContent(RunData rundata)
    {
        Portlet portlet = getPortlet();
        if (portlet == null)
        {
            return new ElementContainer();
        }
       
        // Check to see if the portlet allows view
        // If the current security context disallows view,
        // do not display the portlet OR the control decorator
View Full Code Here

Examples of org.apache.ecs.ElementContainer

            logger.error(message, e);

            return new StringElement(message);
        }

        return new ElementContainer();
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

       @return ConcreteElement object, including the complete ECS code for rendering
       the html page.
    */       
    public ConcreteElement getHTMLContent( RunData rundata ) {
        //embed this here
        ElementContainer base = new ElementContainer();

        //the overall portlet...
        Table t = new Table()
            .setBgColor( this.getColor() )
            .setBorder(0)
            .setCellPadding(1)
            .setCellSpacing(0)
            .setWidth( getWidth() )
            .setAlign( "center" );


        ConcreteElement[] options = this.getPortletOptions( rundata );

        TR finalTitle = new TR()
            .setBgColor( this.getTitleColor() )
            .addElement( new TD()
                .setBgColor( this.getTitleColor() )
                .setNoWrap( true )
                .setWidth("100%")
                .setVAlign("middle")
                .addElement( new B()
                    .addElement( getPortlet().getTitle() )
                    .addElement("  ") ) );

        if ( options.length > 0 ) {

            ElementContainer alloptions = new ElementContainer();
            for (int i = 0; i < options.length; ++i) {
                alloptions.addElement( options[i] );
            }

            finalTitle.addElement( new TD()
                .setBgColor( this.getTitleColor() )
                .setNoWrap( true )
View Full Code Here

Examples of org.apache.ecs.ElementContainer

       @param rundata  RunData object from Turbine.
       @return ConcreteElement object, including the complete ECS code for rendering
       the html page.
    */  
    public ConcreteElement getWMLContent( RunData rundata ) {
        ElementContainer ec = new ElementContainer();
        try {
            ec.addElement(new org.apache.ecs.wml.P()
                .addElement(
                            new org.apache.ecs.wml.A(
                                                     URILookup.getURI( URILookup.TYPE_HOME,
                                                                       URILookup.SUBTYPE_MAXIMIZE,
                                                                       getName(),
View Full Code Here

Examples of org.apache.ecs.ElementContainer

    /**
    */
    protected ConcreteElement getContent( PortletSet set, RunData data )
    {
        return new ElementContainer();
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

    /**
    */
    protected ConcreteElement getWMLContent( PortletSet set, RunData data )
    {
        return new ElementContainer();
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

    /**
    */
    protected ConcreteElement getHTMLContent( PortletSet set, RunData data )
    {
        return new ElementContainer();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.