Examples of LinkService


Examples of org.apache.cocoon.portal.LinkService

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

                    // if attribute found that contains a link
                    if (link != null) {
                        LinkService linkService = null;
                        try {
                            linkService = (LinkService)this.manager.lookup(LinkService.ROLE);
       
                            // create event link
                            LinkEvent event = new LinkEvent(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();

                    LinkService linkService = null;
                    try {
                        linkService = (LinkService)this.manager.lookup(LinkService.ROLE);
       
                        // create event link
                        LinkEvent event = new LinkEvent(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.LinkService

     */
    public String toString() {
        PortalService service = null;
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            LinkService linkService = service.getComponentManager().getLinkService();
           
            //TODO - secure
            return linkService.getLinkURI(this);
           
        } catch (ServiceException se) {
            throw new CascadingRuntimeException("Unable to lookup portal service.", se);
        } finally {
            this.manager.release(service);
View Full Code Here

Examples of org.apache.cocoon.portal.LinkService

     */
    public String toString(Event additionalEvent) {
        PortalService service = null;
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            LinkService linkService = service.getComponentManager().getLinkService();
           
            //TODO - secure
            List l = new ArrayList();
            l.add(additionalEvent);
            l.add(this);
            return linkService.getLinkURI(l);
           
        } catch (ServiceException se) {
            throw new CascadingRuntimeException("Unable to lookup portal service.", se);
        } finally {
            this.manager.release(service);
View Full Code Here

Examples of org.apache.cocoon.portal.LinkService

            e = new ChangeAspectDataEvent( owner, aspectName, data );
        }
        if ( this.requestParameterName != null ) {
            e.setRequestParameterName( this.requestParameterName );
        }
        LinkService service = null;
        try {
            service = (LinkService)this.manager.lookup(LinkService.ROLE);
            service.addEventToLink( e );
        } catch (ServiceException ce) {
            throw new CascadingRuntimeException("Unable to lookup link service.", ce);
        } finally {
            this.manager.release( service );
        }
View Full Code Here

Examples of org.apache.cocoon.portal.LinkService

        } else if (name.equals(LINK_ELEM)) {
            PortalService portalService = null;
            try {
                portalService = (PortalService)this.manager.lookup(PortalService.ROLE);

                final LinkService linkService = portalService.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;
                    if ( attr.getValue("layout") != null ) {
                        newAttrs.removeAttribute("layout");
                        final String layoutId = attr.getValue("layout");
                        Object layout = portalService.getComponentManager().getProfileManager().getPortalLayout(null, layoutId);
                        event = new JXPathEvent(layout, path, value);
                    } else {
                        String copletId = attr.getValue("coplet");
                        newAttrs.removeAttribute("coplet");
                        final CopletInstanceData cid = this.getCopletInstanceData(copletId);
                        event = new CopletJXPathEvent(cid, path, value);
                    }
                    if ( this.insideLinks ) {
                        this.collectedEvents.add(event);
                    } else {
                        final String href = linkService.getLinkURI(event);
                        this.output(href, format, newAttrs );
                    }
                }
            } catch (ServiceException e) {
                throw new SAXException("Error getting portal service.", e);
View Full Code Here

Examples of org.apache.cocoon.portal.LinkService

            this.insideLinks = false;
            final String format = (String)this.stack.pop();
            PortalService portalService = null;
            try {
                portalService = (PortalService)this.manager.lookup(PortalService.ROLE);
                final LinkService linkService = portalService.getComponentManager().getLinkService();
               
                final String href = linkService.getLinkURI(this.collectedEvents);
                final AttributesImpl newAttrs = new AttributesImpl();
                this.output(href, format, newAttrs );
            } catch (ServiceException e) {
                throw new SAXException("Error getting portal service.", e);
            } finally {
View Full Code Here

Examples of org.apache.cocoon.portal.LinkService

            e = new ChangeAspectDataEvent( owner, aspectName, data );
        }
        if ( this.requestParameterName != null ) {
            e.setRequestParameterName( this.requestParameterName );
        }
        LinkService service = null;
        try {
            service = (LinkService)this.manager.lookup(LinkService.ROLE);
            service.addEventToLink( e );
        } catch (ServiceException ce) {
            throw new CascadingRuntimeException("Unable to lookup link service.", ce);
        } finally {
            this.manager.release( service );
        }
View Full Code Here

Examples of org.apache.cocoon.portal.LinkService

                    String link = attr.getValue(index);

                    // if attribute found that contains a link
                    if (link != null) {
                        CopletInstanceData cid = this.getCopletInstanceData();                      
                        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 (ServiceException 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 (ServiceException e) {
                        throw new SAXException(e);
                    } finally {
                        this.manager.release(linkService);
                    }
View Full Code Here

Examples of org.apache.cocoon.portal.LinkService

        String portalEvent = null;

        // if attribute found that contains a link
        if (link != null) {
            CopletInstanceData cid = this.getCopletInstanceData();
            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 =
                        eventLink.indexOf("cocoon-portal-action=")
View Full Code Here

Examples of org.apache.cocoon.portal.LinkService

                    String link = attr.getValue(index);

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