public static void generateResourceTypeXml(
        Element startNode,
        List<I_CmsResourceType> resourceTypes,
        boolean module) {

        for (int i = 0; i < resourceTypes.size(); i++) {
            I_CmsResourceType resType = resourceTypes.get(i);
            // only add this resource type to the xml output, if it is no additional type defined
            // in a module
            if (resType.isAdditionalModuleResourceType() == module) {
                Element resourceType = startNode.addElement(N_TYPE).addAttribute(A_CLASS, resType.getClassName());
                // add type id and type name
                resourceType.addAttribute(A_NAME, resType.getTypeName());
                resourceType.addAttribute(A_ID, String.valueOf(resType.getTypeId()));
                // add resource mappings
                List<String> mappings = resType.getConfiguredMappings();
                if ((mappings != null) && (mappings.size() > 0)) {
                    Element mappingsNode = resourceType.addElement(N_MAPPINGS);
                    for (int j = 0; j < mappings.size(); j++) {
                        Element mapping = mappingsNode.addElement(N_MAPPING);
                        mapping.addAttribute(A_SUFFIX, mappings.get(j));
                    }
                }
                // add default properties
                List<CmsProperty> properties = resType.getConfiguredDefaultProperties();
                if (properties != null) {
                    if (properties.size() > 0) {
                        Element propertiesNode = resourceType.addElement(N_PROPERTIES);
                        Iterator<CmsProperty> p = properties.iterator();
                        while (p.hasNext()) {
                            CmsProperty property = p.next();
                            Element propertyNode = propertiesNode.addElement(N_PROPERTY);
                            propertyNode.addElement(N_NAME).addText(property.getName());
                            if (property.getStructureValue() != null) {
                                propertyNode.addElement(N_VALUE).addCDATA(property.getStructureValue());
                            }
                            if (property.getResourceValue() != null) {
                                propertyNode.addElement(N_VALUE).addAttribute(A_TYPE, CmsProperty.TYPE_SHARED).addCDATA(
                                    property.getResourceValue());
                            }
                        }
                    }
                }
                // add copy resources
                List<CmsConfigurationCopyResource> copyRes = resType.getConfiguredCopyResources();
                if ((copyRes != null) && (copyRes.size() > 0)) {
                    Element copyResNode = resourceType.addElement(N_COPY_RESOURCES);
                    Iterator<CmsConfigurationCopyResource> p = copyRes.iterator();
                    String adjustLinksFolder = resType.getAdjustLinksFolder();
                    if (adjustLinksFolder != null) {
                        copyResNode.addAttribute(A_ADJUST_LINKS_FOLDER, adjustLinksFolder);
                    }
                    while (p.hasNext()) {
                        CmsConfigurationCopyResource cRes = p.next();
                        Element cNode = copyResNode.addElement(N_COPY_RESOURCE);
                        cNode.addAttribute(A_SOURCE, cRes.getSource());
                        if (!cRes.isTargetWasNull()) {
                            cNode.addAttribute(A_TARGET, cRes.getTarget());
                        }
                        if (!cRes.isTypeWasNull()) {
                            cNode.addAttribute(A_TYPE, cRes.getTypeString());
                        }
                    }
                }
                // add optional parameters
                CmsParameterConfiguration configuration = resType.getConfiguration();
                if (configuration != null) {
                    List<String> ignore = null;
                    if ((resType instanceof CmsResourceTypeXmlContainerPage)) {
                        ignore = new ArrayList<String>(1);
                        ignore.add(CmsResourceTypeXmlContent.CONFIGURATION_SCHEMA);
                    }
                    configuration.appendToXml(resourceType, ignore);
                }
            }
        }
    }
public static void generateResourceTypeXml ( Element startNode , List < I_CmsResourceType > resourceTypes , boolean module ) { for ( int i = 0 ; i < resourceTypes . size ( ) ; i ++ ) { I_CmsResourceType resType = resourceTypes . get ( i ) ; if ( resType . isAdditionalModuleResourceType ( ) == module ) { Element resourceType = startNode . addElement ( N_TYPE ) . addAttribute ( A_CLASS , resType . getClassName ( ) ) ; resourceType . addAttribute ( A_NAME , resType . getTypeName ( ) ) ; resourceType . addAttribute ( A_ID , String . valueOf ( resType . getTypeId ( ) ) ) ; List < String > mappings = resType . getConfiguredMappings ( ) ; if ( ( mappings != null ) && ( mappings . size ( ) > 0 ) ) { Element mappingsNode = resourceType . addElement ( N_MAPPINGS ) ; for ( int j = 0 ; j < mappings . size ( ) ; j ++ ) { Element mapping = mappingsNode . addElement ( N_MAPPING ) ; mapping . addAttribute ( A_SUFFIX , mappings . get ( j ) ) ; } } List < CmsProperty > properties = resType . getConfiguredDefaultProperties ( ) ; if ( properties != null ) { if ( properties . size ( ) > 0 ) { Element propertiesNode = resourceType . addElement ( N_PROPERTIES ) ; Iterator < CmsProperty > p = properties . iterator ( ) ; while ( p . hasNext ( ) ) { CmsProperty property = p . next ( ) ; Element propertyNode = propertiesNode . addElement ( N_PROPERTY ) ; propertyNode . addElement ( N_NAME ) . addText ( property . getName ( ) ) ; if ( property . getStructureValue ( ) != null ) { propertyNode . addElement ( N_VALUE ) . addCDATA ( property . getStructureValue ( ) ) ; } if ( property . getResourceValue ( ) != null ) { propertyNode . addElement ( N_VALUE ) . addAttribute ( A_TYPE , CmsProperty . TYPE_SHARED ) . addCDATA ( property . getResourceValue ( ) ) ; } } } } List < CmsConfigurationCopyResource > copyRes = resType . getConfiguredCopyResources ( ) ; if ( ( copyRes != null ) && ( copyRes . size ( ) > 0 ) ) { Element copyResNode = resourceType . addElement ( N_COPY_RESOURCES ) ; Iterator < CmsConfigurationCopyResource > p = copyRes . iterator ( ) ; String adjustLinksFolder = resType . getAdjustLinksFolder ( ) ; if ( adjustLinksFolder != null ) { copyResNode . addAttribute ( A_ADJUST_LINKS_FOLDER , adjustLinksFolder ) ; } while ( p . hasNext ( ) ) { CmsConfigurationCopyResource cRes = p . next ( ) ; Element cNode = copyResNode . addElement ( N_COPY_RESOURCE ) ; cNode . addAttribute ( A_SOURCE , cRes . getSource ( ) ) ; if ( ! cRes . isTargetWasNull ( ) ) { cNode . addAttribute ( A_TARGET , cRes . getTarget ( ) ) ; } if ( ! cRes . isTypeWasNull ( ) ) { cNode . addAttribute ( A_TYPE , cRes . getTypeString ( ) ) ; } } } CmsParameterConfiguration configuration = resType . getConfiguration ( ) ; if ( configuration != null ) { List < String > ignore = null ; if ( ( resType instanceof CmsResourceTypeXmlContainerPage ) ) { ignore = new ArrayList < String > ( 1 ) ; ignore . add ( CmsResourceTypeXmlContent . CONFIGURATION_SCHEMA ) ; } configuration . appendToXml ( resourceType , ignore ) ; } } } }
Creates the xml output for resourcetype nodes.<p>

@param startNode the startnode to add all rescource types to
@param resourceTypes the list of resource types
@param module flag, signaling to add them module resource types or not