cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl JXPathEvent.java
Date Thu, 11 Dec 2003 09:41:35 GMT
cziegeler    2003/12/11 01:41:35

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/transformation
                        CopletTransformer.java
               src/blocks/portal/java/org/apache/cocoon/portal/event/impl
                        JXPathEvent.java
  Log:
  Adding possibility to create layout events
  Fixing Event
  
  Revision  Changes    Path
  1.7       +10 -3     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/CopletTransformer.java
  
  Index: CopletTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/CopletTransformer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CopletTransformer.java	11 Dec 2003 09:30:16 -0000	1.6
  +++ CopletTransformer.java	11 Dec 2003 09:41:35 -0000	1.7
  @@ -57,9 +57,9 @@
   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.CopletInstanceEvent;
   import org.apache.cocoon.portal.event.impl.ChangeCopletInstanceAspectDataEvent;
   import org.apache.cocoon.portal.event.impl.CopletJXPathEvent;
  +import org.apache.cocoon.portal.event.impl.JXPathEvent;
   import org.apache.cocoon.xml.AttributesImpl;
   import org.apache.commons.jxpath.JXPathContext;
   import org.xml.sax.Attributes;
  @@ -161,7 +161,14 @@
                       final String path = attr.getValue("path");
                       final String value = attr.getValue("value");
                       
  -                    CopletInstanceEvent event = new CopletJXPathEvent(cid, path, value);
  +                    JXPathEvent event;
  +                    if ( attr.getValue("layout") != null ) {
  +                        final String layoutId = attr.getValue("layout");
  +                        Object layout = portalService.getComponentManager().getProfileManager().getPortalLayout(null,
layoutId);
  +                        event = new JXPathEvent(layout, path, value);
  +                    } else {
  +                        event = new CopletJXPathEvent(cid, path, value);
  +                    }
                       newAttrs.addCDATAAttribute("href", linkService.getLinkURI(event));
                   }
               } catch (ServiceException e) {
  
  
  
  1.2       +2 -4      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/JXPathEvent.java
  
  Index: JXPathEvent.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/JXPathEvent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JXPathEvent.java	11 Dec 2003 09:30:16 -0000	1.1
  +++ JXPathEvent.java	11 Dec 2003 09:41:35 -0000	1.2
  @@ -50,8 +50,6 @@
   */
   package org.apache.cocoon.portal.event.impl;
   
  -import org.apache.cocoon.portal.coplet.CopletInstanceData;
  -
   /**
    * This events changes the value of an instance
    *
  @@ -80,7 +78,7 @@
           return value;
       }
   
  -    public JXPathEvent(CopletInstanceData target, String path, Object value) {
  +    public JXPathEvent(Object target, String path, Object value) {
           super( target );
           this.path = path;
           this.value = value;
  
  
  

Mime
View raw message