cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/typeimpl AbstractDatatypeBuilder.java
Date Thu, 26 Jun 2003 15:34:40 GMT
bruno       2003/06/26 08:34:40

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/datatype/typeimpl
                        AbstractDatatypeBuilder.java
  Log:
  Added support for dynamic (non-cached) selection lists
  
  Revision  Changes    Path
  1.3       +13 -3     cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/typeimpl/AbstractDatatypeBuilder.java
  
  Index: AbstractDatatypeBuilder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/typeimpl/AbstractDatatypeBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractDatatypeBuilder.java	26 Jun 2003 09:11:24 -0000	1.2
  +++ AbstractDatatypeBuilder.java	26 Jun 2003 15:34:40 -0000	1.3
  @@ -89,10 +89,20 @@
       protected void buildSelectionList(Element datatypeElement, AbstractDatatype datatype)
throws Exception {
           Element selectionListElement = DomHelper.getChildElement(datatypeElement, Constants.WD_NS,
"selection-list");
           if (selectionListElement != null) {
  +            SelectionList selectionList;
               String src = selectionListElement.getAttribute("src");
  -            if (src.length() > 0)
  -                selectionListElement = readSelectionList(src);
  -            SelectionList selectionList = SelectionListBuilder.build(selectionListElement,
datatype);
  +            if (src.length() > 0) {
  +                boolean cache = DomHelper.getAttributeAsBoolean(selectionListElement, "cache",
true);
  +                if (cache) {
  +                    selectionListElement = readSelectionList(src);
  +                    selectionList = SelectionListBuilder.build(selectionListElement, datatype);
  +                } else {
  +                    selectionList = new DynamicSelectionList(datatype, src, componentManager);
  +                }
  +            } else {
  +                // selection list is defined inline
  +                selectionList = SelectionListBuilder.build(selectionListElement, datatype);
  +            }
               datatype.setSelectionList(selectionList);
           }
       }
  
  
  

Mime
View raw message