Package org.apache.cocoon.portal.coplet

Examples of org.apache.cocoon.portal.coplet.CopletInstanceData


     * @return The coplet instance data
     * @throws SAXException If an errors occurs or the instance data is not available
     */
    protected CopletInstanceData getCopletInstanceData()
    throws SAXException {
        CopletInstanceData cid = this.getCopletInstanceData(null);
        if ( cid == null ) {
            throw new SAXException("Could not find coplet instance data for the current pipeline.");
        }
        return cid;
    }
View Full Code Here


        }
        if (copletId == null) {
            throw new SAXException("copletId must be passed as parameter or in the object model within the parent context.");
        }

        CopletInstanceData object = this.getPortalService().getComponentManager().getProfileManager().getCopletInstanceData( copletId );
           
        return object;
    }
View Full Code Here

            String expression = attr.getValue(SELECT_ATTR);
            if (expression == null) {
                throw new ProcessingException("Attribute "+SELECT_ATTR+" must be spcified.");
            }

            CopletInstanceData cid = this.getCopletInstanceData();

            JXPathContext jxpathContext = JXPathContext.newContext( cid );
            Object object = jxpathContext.getValue(expression);

            if (object == null) {
                throw new ProcessingException("Could not find value for expression "+expression);
            }

        } else if (name.equals(LINK_ELEM)) {

            final LinkService linkService = this.getPortalService().getComponentManager().getLinkService();
            final String format = attr.getValue("format");
            AttributesImpl newAttrs = new AttributesImpl();
            newAttrs.setAttributes(attr);
            newAttrs.removeAttribute("format");

            if ( attr.getValue("href") != null ) {
                final CopletInstanceData cid = this.getCopletInstanceData();
                ChangeCopletInstanceAspectDataEvent event = new ChangeCopletInstanceAspectDataEvent(cid, null, null);

                String value = linkService.getLinkURI(event);
                if (value.indexOf('?') == -1) {
                    value = value + '?' + attr.getValue("href");
                } else {
                    value = value + '&' + attr.getValue("href");
                }
                newAttrs.removeAttribute("href");
                this.output(value, format, newAttrs );
            } else {
                final String path = attr.getValue("path");
                final String value = attr.getValue("value");

                newAttrs.removeAttribute("path");
                newAttrs.removeAttribute("value");

                JXPathEvent event = null;
                if ( attr.getValue("layout") != null ) {
                    newAttrs.removeAttribute("layout");
                    final String layoutId = attr.getValue("layout");
                    Object layout = this.getPortalService().getComponentManager().getProfileManager().getPortalLayout(null, layoutId);
                    if ( layout != null ) {
                        event = new JXPathEvent(layout, path, value);
                    }
                } else {
                    String copletId = attr.getValue("coplet");
                    newAttrs.removeAttribute("coplet");
                    final CopletInstanceData cid = this.getCopletInstanceData(copletId);
                    if ( cid != null ) {
                        event = new CopletJXPathEvent(cid, path, value);
                    }
                }
                if ( this.insideLinks ) {
View Full Code Here

                    int index = attr.getIndex(this.attributeName);
                    String link = attr.getValue(index);

                    // if attribute found that contains a link
                    if (link != null) {
                        CopletInstanceData cid = this.getCopletInstanceData(attr.getValue("coplet"));                      
                        LinkService linkService = this.getPortalService().getComponentManager().getLinkService();
       
                        // create event link
                        CopletLinkEvent event = new CopletLinkEvent(cid, link);
                        String eventLink = linkService.getLinkURI(event);
   
                        // insert event link
                        attr.setValue(index, eventLink);
                    }
                }
               
                String eventLink = null;
                DocumentFragment fragment = null;
                               
                // process element that contains link
                if (this.elementName != null && name.equals(this.elementName)) {
                    String link = this.endTextRecording();

                    CopletInstanceData cid = this.getCopletInstanceData();                      
                    LinkService linkService = this.getPortalService().getComponentManager().getLinkService();

                    // create event link
                    CopletLinkEvent event = new CopletLinkEvent(cid, link);
                    eventLink = linkService.getLinkURI(event);
View Full Code Here

        AttributesImpl newAttributes = new AttributesImpl(attributes);
        newAttributes.removeAttribute("href");
        newAttributes.removeAttribute("external");
        String link = attributes.getValue("href");

        CopletInstanceData cid = this.getCopletInstanceData();
        link = this.getLink((String)cid.getTemporaryAttribute(this.attributeName), link);

        newAttributes.addCDATAAttribute("path", this.jxPath);
        newAttributes.addCDATAAttribute("value", link);
        newAttributes.addCDATAAttribute("coplet", cid.getId());
        newAttributes.addCDATAAttribute("format", "html-link");
        this.xmlConsumer.startPrefixMapping("coplet", CopletTransformer.NAMESPACE_URI);
        this.xmlConsumer.startElement(CopletTransformer.NAMESPACE_URI,
                                      CopletTransformer.LINK_ELEM,
                                      "coplet:" + CopletTransformer.LINK_ELEM,
View Full Code Here

    throws SAXException {
        AttributesImpl newAttributes = new AttributesImpl(attributes);
        newAttributes.removeAttribute("action");
        String link = attributes.getValue("action");

        CopletInstanceData cid = this.getCopletInstanceData();
        link = this.getLink((String)cid.getTemporaryAttribute(this.attributeName), link);

        newAttributes.addCDATAAttribute("path", this.jxPath);
        newAttributes.addCDATAAttribute("value", link);
        newAttributes.addCDATAAttribute("coplet", cid.getId());
        newAttributes.addCDATAAttribute("format", "html-form");
        if ( newAttributes.getIndex("method") == -1 ) {
            newAttributes.addCDATAAttribute("method", "POST");
        }
View Full Code Here

        String portalAction = null;
        String portalEvent = null;

        // if attribute found that contains a link
        if (link != null) {
            CopletInstanceData cid = this.getCopletInstanceData(attributes.getValue("coplet"));
            // create event link
            CopletLinkEvent event = new CopletLinkEvent(cid, link);
            String eventLink = this.getPortalService().getComponentManager().getLinkService().getLinkURI(event);

            //form elements need hidden inputs to change request parameters
View Full Code Here

     * @return The coplet instance data
     * @throws SAXException If an errors occurs or the instance data is not available
     */
    protected CopletInstanceData getCopletInstanceData()
    throws SAXException {
        CopletInstanceData cid = this.getCopletInstanceData(null);
        if ( cid == null ) {
            throw new SAXException("Could not find coplet instance data for the current pipeline.");
        }
        return cid;
    }
View Full Code Here

        }
        if (copletId == null) {
            throw new SAXException("copletId must be passed as parameter or in the object model within the parent context.");
        }

        CopletInstanceData object = this.getPortalService().getComponentManager().getProfileManager().getCopletInstanceData( copletId );
           
        return object;
    }
View Full Code Here

     */
    PortletURLProviderImpl(PortalService service, String eventData) {
        this.linkService = service.getComponentManager().getLinkService();
        PortletURLConverter urlConverter = new PortletURLConverter(eventData);
        String copletId = urlConverter.getPortletId();
        CopletInstanceData cid = service.getComponentManager().getProfileManager()
            .getCopletInstanceData(copletId);
        this.portletWindow = (PortletWindow)cid.getTemporaryAttribute("window");
        this.mode = urlConverter.getMode();
        this.state = urlConverter.getState();
        this.action = urlConverter.isAction();
        this.parameters = urlConverter.getParameters();
        this.clearParameters = false;
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.coplet.CopletInstanceData

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.