cziegeler    2004/02/09 01:27:25

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/transformation
                        NewEventLinkTransformer.java
  Log:
  Fixing component handling
  
  Revision  Changes    Path
  1.5       +13 -17    
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/NewEventLinkTransformer.java
  
  Index: NewEventLinkTransformer.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/NewEventLinkTransformer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NewEventLinkTransformer.java      10 Dec 2003 17:02:04 -0000      1.4
  +++ NewEventLinkTransformer.java      9 Feb 2004 09:27:25 -0000       1.5
  @@ -53,7 +53,7 @@
   import java.util.Stack;
   
   import org.apache.avalon.framework.service.ServiceException;
  -import org.apache.cocoon.portal.LinkService;
  +import org.apache.cocoon.portal.PortalService;
   import org.apache.cocoon.portal.coplet.CopletInstanceData;
   import org.apache.cocoon.portal.event.impl.CopletLinkEvent;
   import org.xml.sax.Attributes;
  @@ -141,12 +141,11 @@
        *          or an unknown element within the namespaces in encountered.
        * @see 
org.apache.cocoon.transformation.AbstractSAXTransformer#startTransformingElement(String,
 String, String, Attributes)
        */
  -    public void startTransformingElement(
  -        String uri,
  -        String name,
  -        String raw,
  -        Attributes attributes)
  -        throws SAXException {
  +    public void startTransformingElement(String uri,
  +                                         String name,
  +                                         String raw,
  +                                         Attributes attributes)
  +    throws SAXException {
           if (!EVENT_ELEM.equals(name)) {
               throw new SAXException("Unknown element encountered: " + name);
           }
  @@ -177,8 +176,7 @@
   
           if (attributes instanceof AttributesImpl) {
               newAttributes = (AttributesImpl) attributes;
  -        }
  -        else {
  +        } else {
               newAttributes = new AttributesImpl(attributes);
           }
   
  @@ -209,13 +207,12 @@
           // if attribute found that contains a link
           if (link != null) {
               CopletInstanceData cid = this.getCopletInstanceData();
  -            LinkService linkService = null;
  +            PortalService portalService = null;
               try {
  -                linkService =
  -                    (LinkService) this.manager.lookup(LinkService.ROLE);
  +                portalService = (PortalService) 
this.manager.lookup(PortalService.ROLE);
                   // create event link
                   CopletLinkEvent event = new CopletLinkEvent(cid, link);
  -                String eventLink = linkService.getLinkURI(event);
  +                String eventLink = 
portalService.getComponentManager().getLinkService().getLinkURI(event);
   
                   //form elements need hidden inputs to change request 
parameters
                   if (formSpecialTreatment) {
  @@ -247,9 +244,8 @@
               }
               catch (ServiceException e) {
                   throw new SAXException(e);
  -            }
  -            finally {
  -                this.manager.release(linkService);
  +            } finally {
  +                this.manager.release(portalService);
               }
           }
   
  
  
  

Reply via email to