[opencms-dev] Two Body Elements under Opencms6 Alpha

Sebastian Himberger sebastian.himberger at gmx.de
Wed Oct 27 17:18:41 CEST 2004


Hi,

Here's the Syntax (it's very simple i thought there were more options)

The * after the Elements name defines wether the element is enabled by 
default or not. * = enabled

Here's the Source (CmsDialogElements.java):

Line 171:
>             if (elements != null) {
>                 // elements are defined on template file, merge with available elements
>                 StringTokenizer T = new StringTokenizer(elements, ",");
>                 while (T.hasMoreTokens()) {
>                     String currentElement = T.nextToken();
>                     String niceName = null;
>                     boolean mandatory = false;
>                     int sepIndex = currentElement.indexOf("|");
>                     if (sepIndex != -1) {
>                         // nice name found for current element, extract it
>                         niceName = currentElement.substring(sepIndex + 1);
>                         currentElement = currentElement.substring(0, sepIndex);
>                     }
>                     if (currentElement.endsWith("*")) {
>                         // element is mandatory
>                         mandatory = true;
>                         currentElement = currentElement.substring(0, currentElement.length() - 1);
>                     }
>                                         
>                     CmsDialogElement element = new CmsDialogElement(currentElement, niceName, mandatory, true, false);
>                     if (result.contains(element)) {
>                         element.setExisting(true);
>                         result.remove(element);
>                     }
>                     result.add(element);
>                    
>                 }
>             }


HTH

Sebastian







More information about the opencms-dev mailing list