Examples of CopletLinkEvent


Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

     * the coplet instance data for further handling in the ProxyTransformer.
     * There is a special CopletLinkEvent with the uri "createNewCopletInstance", which is the
     * trigger to create a new instance of the one that is the target of the event.
     */
    public void handleCopletLinkEvent(Event e) {
        CopletLinkEvent event = (CopletLinkEvent) e;
        super.handleCopletLinkEvent(event);
        CopletInstanceData coplet = (CopletInstanceData) event.getTarget();
        String link = event.getLink();

        if ("createNewCopletInstance".equals(link)) {
            try {
                createNewInstance(coplet);
            }
            catch (ProcessingException ex) {
                getLogger().error("Could not create new coplet instance", ex);
            }
        }
        else {
            // this is a normal link event, so save the url in the instance data
            // for ProxyTransformer
            coplet.setAttribute(ProxyTransformer.LINK, event.getLink());
        }
    }
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

            LinkService linkService = null;
            try {
                linkService =
                    (LinkService) this.manager.lookup(LinkService.ROLE);
                // create event link
                CopletLinkEvent event = new CopletLinkEvent(cid, link);
                String eventLink = linkService.getLinkURI(event);

                //form elements need hidden inputs to change request parameters
                if (formSpecialTreatment) {
                    int begin =
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

                        LinkService linkService = null;
                        try {
                            linkService = (LinkService)this.manager.lookup(LinkService.ROLE);
       
                            // create event link
                            CopletLinkEvent event = new CopletLinkEvent(cid, link);
                            String eventLink = linkService.getLinkURI(event);
       
                            // insert event link
                            attr.setValue(index, eventLink);
                        } catch (ComponentException e) {
                            throw new SAXException(e);
                        } finally {
                            this.manager.release(linkService);
                        }
                    }
                }
               
                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 = null;
                    try {
                        linkService = (LinkService)this.manager.lookup(LinkService.ROLE);
       
                        // create event link
                        CopletLinkEvent event = new CopletLinkEvent(cid, link);
                        eventLink = linkService.getLinkURI(event);
                    } catch (ComponentException e) {
                        throw new SAXException(e);
                    } finally {
                        this.manager.release(linkService);
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

     */
    public void handleCopletInstanceEvent(CopletInstanceEvent e) {
        super.handleCopletInstanceEvent(e);
       
        if ( e instanceof CopletLinkEvent ) {
            CopletLinkEvent event = (CopletLinkEvent) e;
            CopletInstanceData coplet = (CopletInstanceData) event.getTarget();
            String link = event.getLink();
   
            if ("createNewCopletInstance".equals(link)) {
                try {
                    createNewInstance(coplet);
                } catch (ProcessingException ex) {
                    getLogger().error("Could not create new coplet instance", ex);
                }
            } else {
                // this is a normal link event, so save the url in the instance data
                // for ProxyTransformer
                String linkValue = event.getLink();
                Boolean addParams = (Boolean)this.getConfiguration(coplet, "appendParameters", Boolean.FALSE);
                if ( addParams.booleanValue() ) {
                    final StringBuffer uri = new StringBuffer(event.getLink());
                    boolean hasParams = (uri.toString().indexOf("?") != -1);
                   
                    // append parameters - if any
                    final Map objectModel = ContextHelper.getObjectModel(this.context);
                    final Request r = ObjectModelHelper.getRequest(objectModel);
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

     */
    public void handleCopletInstanceEvent(CopletInstanceEvent e) {
        super.handleCopletInstanceEvent(e);
       
        if ( e instanceof CopletLinkEvent ) {
            CopletLinkEvent event = (CopletLinkEvent) e;
            CopletInstanceData coplet = (CopletInstanceData) event.getTarget();
            String link = event.getLink();
   
            if ("createNewCopletInstance".equals(link)) {
                try {
                    createNewInstance(coplet);
                } catch (ProcessingException ex) {
                    getLogger().error("Could not create new coplet instance", ex);
                }
            } else {
                // this is a normal link event, so save the url in the instance data
                // for ProxyTransformer
                String linkValue = event.getLink();
                Boolean addParams = (Boolean)this.getConfiguration(coplet, "appendParameters", Boolean.FALSE);
                if ( addParams.booleanValue() ) {
                    final StringBuffer uri = new StringBuffer(event.getLink());
                    boolean hasParams = (uri.toString().indexOf("?") != -1);
                   
                    // append parameters - if any
                    final Map objectModel = ContextHelper.getObjectModel(this.context);
                    final Request r = ObjectModelHelper.getRequest(objectModel);
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

                    if (link != null) {
                        CopletInstanceData cid = this.getCopletInstanceData(attr.getValue("coplet"));
                        LinkService linkService = this.portalService.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.portalService.getComponentManager().getLinkService();

                    // create event link
                    CopletLinkEvent event = new CopletLinkEvent(cid, link);
                    eventLink = linkService.getLinkURI(event);
                } else {
                    fragment = this.endRecording();
                }
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

        // 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.portalService.getComponentManager().getLinkService().getLinkURI(event);

            //form elements need hidden inputs to change request parameters
            if (formSpecialTreatment) {
                int begin =
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

     */
    public void handleCopletInstanceEvent(Event e) {
        super.handleCopletInstanceEvent(e);
       
        if ( e instanceof CopletLinkEvent ) {
            CopletLinkEvent event = (CopletLinkEvent) e;
            CopletInstanceData coplet = (CopletInstanceData) event.getTarget();
            String link = event.getLink();
   
            if ("createNewCopletInstance".equals(link)) {
                try {
                    createNewInstance(coplet);
                }
                catch (ProcessingException ex) {
                    getLogger().error("Could not create new coplet instance", ex);
                }
            }
            else {
                // this is a normal link event, so save the url in the instance data
                // for ProxyTransformer
                coplet.setAttribute(ProxyTransformer.LINK, event.getLink());
            }
        }
    }
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

                    if (link != null) {
                        CopletInstanceData cid = this.getCopletInstanceData();                      
                        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);
                } else {
                    fragment = this.endRecording();
                }
               
View Full Code Here

Examples of org.apache.cocoon.portal.event.impl.CopletLinkEvent

        // if attribute found that contains a link
        if (link != null) {
            CopletInstanceData cid = this.getCopletInstanceData();
            // 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
            if (formSpecialTreatment) {
                int begin =
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.