001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software GmbH, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.module; 029 030import org.opencms.configuration.CmsVfsConfiguration; 031import org.opencms.configuration.CmsWorkplaceConfiguration; 032import org.opencms.configuration.I_CmsConfigurationParameterHandler; 033import org.opencms.configuration.I_CmsXmlConfiguration; 034import org.opencms.db.CmsExportPoint; 035import org.opencms.file.types.I_CmsResourceType; 036import org.opencms.main.CmsLog; 037import org.opencms.util.CmsDateUtil; 038import org.opencms.util.CmsStringUtil; 039import org.opencms.workplace.CmsWorkplace; 040import org.opencms.workplace.explorer.CmsExplorerTypeSettings; 041 042import java.text.ParseException; 043import java.util.ArrayList; 044import java.util.Collections; 045import java.util.HashMap; 046import java.util.Iterator; 047import java.util.List; 048import java.util.Map; 049import java.util.SortedMap; 050 051import org.apache.commons.digester.Digester; 052import org.apache.commons.logging.Log; 053 054import org.dom4j.Document; 055import org.dom4j.DocumentHelper; 056import org.dom4j.Element; 057 058/** 059 * Adds the XML handler rules for import and export of a single module.<p> 060 * 061 * @since 6.0.0 062 */ 063public class CmsModuleXmlHandler { 064 065 /** The "name" attribute. */ 066 public static final String A_NAME = "name"; 067 068 /** The "version" attribute. */ 069 public static final String A_VERSION = "version"; 070 071 /** The node name for the authoremail node. */ 072 public static final String N_AUTHOREMAIL = "authoremail"; 073 074 /** The node name for the authorname node. */ 075 public static final String N_AUTHORNAME = "authorname"; 076 077 /** The node name for the class node. */ 078 public static final String N_CLASS = "class"; 079 080 /** The node name for the datecreated node. */ 081 public static final String N_DATECREATED = "datecreated"; 082 083 /** The node name for the date installed node. */ 084 public static final String N_DATEINSTALLED = "dateinstalled"; 085 086 /** The node name for the dependencies node. */ 087 public static final String N_DEPENDENCIES = "dependencies"; 088 089 /** The node name for the dependency node. */ 090 public static final String N_DEPENDENCY = "dependency"; 091 092 /** The node name for the description node. */ 093 public static final String N_DESCRIPTION = "description"; 094 095 /** The node name for the group node. */ 096 public static final String N_GROUP = "group"; 097 098 /** The node name for a module. */ 099 public static final String N_MODULE = "module"; 100 101 /** The node name for the name node. */ 102 public static final String N_NAME = "name"; 103 104 /** The node name for the nicename node. */ 105 public static final String N_NICENAME = "nicename"; 106 107 /** The "param" node name for generic parameters. */ 108 public static final String N_PARAM = "param"; 109 110 /** The node name for the parameters node. */ 111 public static final String N_PARAMETERS = "parameters"; 112 113 /** The node name for the resources node. */ 114 public static final String N_RESOURCES = "resources"; 115 116 /** The node name for the user installed node. */ 117 public static final String N_USERINSTALLED = "userinstalled"; 118 119 /** The node name for the version node. */ 120 public static final String N_VERSION = "version"; 121 122 /** The log object for this class. */ 123 private static final Log LOG = CmsLog.getLog(CmsModuleXmlHandler.class); 124 125 /** The list of dependencies for a module. */ 126 private List<CmsModuleDependency> m_dependencies; 127 128 /** The explorer type settings. */ 129 private List<CmsExplorerTypeSettings> m_explorerTypeSettings; 130 131 /** The list of export points for a module. */ 132 private List<CmsExportPoint> m_exportPoints; 133 134 /** The generated module. */ 135 private CmsModule m_module; 136 137 /** Indicates if the module was an old (5.0.x) style module. */ 138 private boolean m_oldModule; 139 140 /** The module parameters. */ 141 private Map<String, String> m_parameters; 142 143 /** The list of resources for a module. */ 144 private List<String> m_resources; 145 146 /** The list of additional resource types. */ 147 private List<I_CmsResourceType> m_resourceTypes; 148 149 /** 150 * Public constructor, will be called by digester during import.<p> 151 */ 152 public CmsModuleXmlHandler() { 153 154 m_exportPoints = new ArrayList<CmsExportPoint>(); 155 m_dependencies = new ArrayList<CmsModuleDependency>(); 156 m_resources = new ArrayList<String>(); 157 m_parameters = new HashMap<String, String>(); 158 m_resourceTypes = new ArrayList<I_CmsResourceType>(); 159 m_explorerTypeSettings = new ArrayList<CmsExplorerTypeSettings>(); 160 } 161 162 /** 163 * Adds the XML digester rules for a single module.<p> 164 * 165 * @param digester the digester to add the rules to 166 */ 167 public static void addXmlDigesterRules(Digester digester) { 168 169 // add class generation rule 170 digester.addObjectCreate("*/" + N_MODULE, CmsModuleXmlHandler.class); 171 digester.addSetNext("*/" + N_MODULE, "setModule"); 172 173 // add rules for base module information 174 digester.addCallMethod("*/" + N_MODULE, "createdModule", 11); 175 digester.addCallParam("*/" + N_MODULE + "/" + N_NAME, 0); 176 digester.addCallParam("*/" + N_MODULE + "/" + N_NICENAME, 1); 177 digester.addCallParam("*/" + N_MODULE + "/" + N_GROUP, 2); 178 digester.addCallParam("*/" + N_MODULE + "/" + N_CLASS, 3); 179 digester.addCallParam("*/" + N_MODULE + "/" + N_DESCRIPTION, 4); 180 digester.addCallParam("*/" + N_MODULE + "/" + N_VERSION, 5); 181 digester.addCallParam("*/" + N_MODULE + "/" + N_AUTHORNAME, 6); 182 digester.addCallParam("*/" + N_MODULE + "/" + N_AUTHOREMAIL, 7); 183 digester.addCallParam("*/" + N_MODULE + "/" + N_DATECREATED, 8); 184 digester.addCallParam("*/" + N_MODULE + "/" + N_USERINSTALLED, 9); 185 digester.addCallParam("*/" + N_MODULE + "/" + N_DATEINSTALLED, 10); 186 187 // add rules for module dependencies 188 digester.addCallMethod("*/" + N_MODULE + "/" + N_DEPENDENCIES + "/" + N_DEPENDENCY, "addDependency", 2); 189 digester.addCallParam( 190 "*/" + N_MODULE + "/" + N_DEPENDENCIES + "/" + N_DEPENDENCY, 191 0, 192 I_CmsXmlConfiguration.A_NAME); 193 digester.addCallParam("*/" + N_MODULE + "/" + N_DEPENDENCIES + "/" + N_DEPENDENCY, 1, A_VERSION); 194 195 // add rules for the module export points 196 digester.addCallMethod("*/" 197 + N_MODULE 198 + "/" 199 + I_CmsXmlConfiguration.N_EXPORTPOINTS 200 + "/" 201 + I_CmsXmlConfiguration.N_EXPORTPOINT, "addExportPoint", 2); 202 digester.addCallParam("*/" 203 + N_MODULE 204 + "/" 205 + I_CmsXmlConfiguration.N_EXPORTPOINTS 206 + "/" 207 + I_CmsXmlConfiguration.N_EXPORTPOINT, 0, I_CmsXmlConfiguration.A_URI); 208 digester.addCallParam("*/" 209 + N_MODULE 210 + "/" 211 + I_CmsXmlConfiguration.N_EXPORTPOINTS 212 + "/" 213 + I_CmsXmlConfiguration.N_EXPORTPOINT, 1, I_CmsXmlConfiguration.A_DESTINATION); 214 215 // add rules for the module resources 216 digester.addCallMethod( 217 "*/" + N_MODULE + "/" + N_RESOURCES + "/" + I_CmsXmlConfiguration.N_RESOURCE, 218 "addResource", 219 1); 220 digester.addCallParam( 221 "*/" + N_MODULE + "/" + N_RESOURCES + "/" + I_CmsXmlConfiguration.N_RESOURCE, 222 0, 223 I_CmsXmlConfiguration.A_URI); 224 225 // add rules for the module parameters 226 digester.addCallMethod( 227 "*/" + N_MODULE + "/" + N_PARAMETERS + "/" + I_CmsXmlConfiguration.N_PARAM, 228 "addParameter", 229 2); 230 digester.addCallParam( 231 "*/" + N_MODULE + "/" + N_PARAMETERS + "/" + I_CmsXmlConfiguration.N_PARAM, 232 0, 233 I_CmsXmlConfiguration.A_NAME); 234 digester.addCallParam("*/" + N_MODULE + "/" + N_PARAMETERS + "/" + I_CmsXmlConfiguration.N_PARAM, 1); 235 236 // generic <param> parameter rules 237 digester.addCallMethod( 238 "*/" + I_CmsXmlConfiguration.N_PARAM, 239 I_CmsConfigurationParameterHandler.ADD_PARAMETER_METHOD, 240 2); 241 digester.addCallParam("*/" + I_CmsXmlConfiguration.N_PARAM, 0, I_CmsXmlConfiguration.A_NAME); 242 digester.addCallParam("*/" + I_CmsXmlConfiguration.N_PARAM, 1); 243 244 // add resource type rules from VFS 245 CmsVfsConfiguration.addResourceTypeXmlRules(digester); 246 247 // add explorer type rules from workplace 248 CmsWorkplaceConfiguration.addExplorerTypeXmlRules(digester); 249 250 // finally add all rules for backward compatibility with OpenCms 5.0 251 addXmlDigesterRulesForVersion5Modules(digester); 252 } 253 254 /** 255 * Generates a detached XML element for a module.<p> 256 * 257 * @param module the module to generate the XML element for 258 * 259 * @return the detached XML element for the module 260 */ 261 public static Element generateXml(CmsModule module) { 262 263 Document doc = DocumentHelper.createDocument(); 264 265 Element moduleElement = doc.addElement(N_MODULE); 266 267 moduleElement.addElement(N_NAME).setText(module.getName()); 268 if (!module.getName().equals(module.getNiceName())) { 269 moduleElement.addElement(N_NICENAME).addCDATA(module.getNiceName()); 270 } else { 271 moduleElement.addElement(N_NICENAME); 272 } 273 if (CmsStringUtil.isNotEmpty(module.getGroup())) { 274 moduleElement.addElement(N_GROUP).setText(module.getGroup()); 275 } 276 if (CmsStringUtil.isNotEmpty(module.getActionClass())) { 277 moduleElement.addElement(N_CLASS).setText(module.getActionClass()); 278 } else { 279 moduleElement.addElement(N_CLASS); 280 } 281 if (CmsStringUtil.isNotEmpty(module.getDescription())) { 282 moduleElement.addElement(N_DESCRIPTION).addCDATA(module.getDescription()); 283 } else { 284 moduleElement.addElement(N_DESCRIPTION); 285 } 286 moduleElement.addElement(N_VERSION).setText(module.getVersion().toString()); 287 if (CmsStringUtil.isNotEmpty(module.getAuthorName())) { 288 moduleElement.addElement(N_AUTHORNAME).addCDATA(module.getAuthorName()); 289 } else { 290 moduleElement.addElement(N_AUTHORNAME); 291 } 292 if (CmsStringUtil.isNotEmpty(module.getAuthorEmail())) { 293 moduleElement.addElement(N_AUTHOREMAIL).addCDATA(module.getAuthorEmail()); 294 } else { 295 moduleElement.addElement(N_AUTHOREMAIL); 296 } 297 if (module.getDateCreated() != CmsModule.DEFAULT_DATE) { 298 moduleElement.addElement(N_DATECREATED).setText(CmsDateUtil.getHeaderDate(module.getDateCreated())); 299 } else { 300 moduleElement.addElement(N_DATECREATED); 301 } 302 303 if (CmsStringUtil.isNotEmpty(module.getUserInstalled())) { 304 moduleElement.addElement(N_USERINSTALLED).setText(module.getUserInstalled()); 305 } else { 306 moduleElement.addElement(N_USERINSTALLED); 307 } 308 if (module.getDateInstalled() != CmsModule.DEFAULT_DATE) { 309 moduleElement.addElement(N_DATEINSTALLED).setText(CmsDateUtil.getHeaderDate(module.getDateInstalled())); 310 } else { 311 moduleElement.addElement(N_DATEINSTALLED); 312 } 313 Element dependenciesElement = moduleElement.addElement(N_DEPENDENCIES); 314 for (int i = 0; i < module.getDependencies().size(); i++) { 315 CmsModuleDependency dependency = module.getDependencies().get(i); 316 dependenciesElement.addElement(N_DEPENDENCY).addAttribute( 317 I_CmsXmlConfiguration.A_NAME, 318 dependency.getName()).addAttribute(A_VERSION, dependency.getVersion().toString()); 319 } 320 Element exportpointsElement = moduleElement.addElement(I_CmsXmlConfiguration.N_EXPORTPOINTS); 321 for (int i = 0; i < module.getExportPoints().size(); i++) { 322 CmsExportPoint point = module.getExportPoints().get(i); 323 exportpointsElement.addElement(I_CmsXmlConfiguration.N_EXPORTPOINT).addAttribute( 324 I_CmsXmlConfiguration.A_URI, 325 point.getUri()).addAttribute(I_CmsXmlConfiguration.A_DESTINATION, point.getConfiguredDestination()); 326 } 327 Element resourcesElement = moduleElement.addElement(N_RESOURCES); 328 for (int i = 0; i < module.getResources().size(); i++) { 329 String resource = module.getResources().get(i); 330 resourcesElement.addElement(I_CmsXmlConfiguration.N_RESOURCE).addAttribute( 331 I_CmsXmlConfiguration.A_URI, 332 resource); 333 } 334 Element parametersElement = moduleElement.addElement(N_PARAMETERS); 335 SortedMap<String, String> parameters = module.getParameters(); 336 if (parameters != null) { 337 List<String> names = new ArrayList<String>(parameters.keySet()); 338 Collections.sort(names); 339 for (String name : names) { 340 String value = parameters.get(name).toString(); 341 Element paramNode = parametersElement.addElement(I_CmsXmlConfiguration.N_PARAM); 342 paramNode.addAttribute(I_CmsXmlConfiguration.A_NAME, name); 343 paramNode.addText(value); 344 } 345 } 346 347 // add resource types 348 List<I_CmsResourceType> resourceTypes = module.getResourceTypes(); 349 if (resourceTypes.size() > 0) { 350 Element resourcetypesElement = moduleElement.addElement(CmsVfsConfiguration.N_RESOURCETYPES); 351 CmsVfsConfiguration.generateResourceTypeXml(resourcetypesElement, resourceTypes, true); 352 } 353 354 List<CmsExplorerTypeSettings> explorerTypes = module.getExplorerTypes(); 355 if (explorerTypes.size() > 0) { 356 Element explorerTypesElement = moduleElement.addElement(CmsWorkplaceConfiguration.N_EXPLORERTYPES); 357 CmsWorkplaceConfiguration.generateExplorerTypesXml(explorerTypesElement, explorerTypes, true); 358 } 359 360 // return the modules node 361 moduleElement.detach(); 362 return moduleElement; 363 } 364 365 /** 366 * Generates a (hopefully) valid Java class name from an invalid class name.<p> 367 * 368 * All invalid characters are replaced by an underscore "_". 369 * This is for example used to make sure old (5.0) modules can still be imported, 370 * by converting the name to a valid class name.<p> 371 * 372 * @param className the class name to make valid 373 * 374 * @return a valid Java class name from an invalid class name 375 */ 376 public static String makeValidJavaClassName(String className) { 377 378 StringBuffer result = new StringBuffer(className.length()); 379 int length = className.length(); 380 boolean nodot = true; 381 for (int i = 0; i < length; i++) { 382 char ch = className.charAt(i); 383 if (nodot) { 384 if (ch == '.') { 385 // ignore, remove 386 } else if (Character.isJavaIdentifierStart(ch)) { 387 nodot = false; 388 result.append(ch); 389 } else { 390 result.append('_'); 391 } 392 } else { 393 if (ch == '.') { 394 nodot = true; 395 result.append(ch); 396 } else if (Character.isJavaIdentifierPart(ch)) { 397 nodot = false; 398 result.append(ch); 399 } else { 400 result.append('_'); 401 } 402 } 403 } 404 return result.toString(); 405 } 406 407 /** 408 * Adds the digester rules for OpenCms version 5 modules.<p> 409 * 410 * @param digester the digester to add the rules to 411 */ 412 private static void addXmlDigesterRulesForVersion5Modules(Digester digester) { 413 414 // mark method 415 digester.addCallMethod("*/" + N_MODULE + "/author", "setOldModule"); 416 417 // base module information 418 digester.addCallParam("*/" + N_MODULE + "/author", 6); 419 digester.addCallParam("*/" + N_MODULE + "/email", 7); 420 digester.addCallParam("*/" + N_MODULE + "/creationdate", 8); 421 422 // dependencies 423 digester.addCallParam("*/" + N_MODULE + "/dependencies/dependency/name", 0); 424 digester.addCallParam("*/" + N_MODULE + "/dependencies/dependency/minversion", 1); 425 426 // export points 427 digester.addCallMethod("*/" + N_MODULE + "/exportpoint", "addExportPoint", 2); 428 digester.addCallParam("*/" + N_MODULE + "/exportpoint/source", 0); 429 digester.addCallParam("*/" + N_MODULE + "/exportpoint/destination", 1); 430 431 // parameters 432 digester.addCallMethod("*/" + N_MODULE + "/parameters/para", "addParameter", 2); 433 digester.addCallParam("*/" + N_MODULE + "/parameters/para/name", 0); 434 digester.addCallParam("*/" + N_MODULE + "/parameters/para/value", 1); 435 } 436 437 /** 438 * Adds a module dependency to the current module.<p> 439 * 440 * @param name the module name of the dependency 441 * @param version the module version of the dependency 442 */ 443 public void addDependency(String name, String version) { 444 445 CmsModuleVersion moduleVersion = new CmsModuleVersion(version); 446 447 CmsModuleDependency dependency = new CmsModuleDependency(name, moduleVersion); 448 m_dependencies.add(dependency); 449 450 if (LOG.isDebugEnabled()) { 451 LOG.debug(Messages.get().getBundle().key(Messages.LOG_ADD_MOD_DEPENDENCY_2, name, version)); 452 } 453 } 454 455 /** 456 * Adds an explorer type setting object to the list of type settings.<p> 457 * 458 * Adds the type setting as well to a map with the resource type name as key. 459 * 460 * @param settings the explorer type settings 461 */ 462 public void addExplorerTypeSetting(CmsExplorerTypeSettings settings) { 463 464 settings.setAddititionalModuleExplorerType(true); 465 m_explorerTypeSettings.add(settings); 466 } 467 468 /** 469 * Adds an export point to the module configuration.<p> 470 * 471 * @param uri the export point uri 472 * @param destination the export point destination 473 */ 474 public void addExportPoint(String uri, String destination) { 475 476 CmsExportPoint point = new CmsExportPoint(uri, destination); 477 m_exportPoints.add(point); 478 if (CmsLog.INIT.isInfoEnabled()) { 479 CmsLog.INIT.info(Messages.get().getBundle().key( 480 Messages.INIT_ADD_EXPORT_POINT_2, 481 point.getUri(), 482 point.getConfiguredDestination())); 483 } 484 } 485 486 /** 487 * Adds a module parameter to the module configuration.<p> 488 * 489 * @param key the parameter key 490 * @param value the parameter value 491 */ 492 public void addParameter(String key, String value) { 493 494 if (CmsStringUtil.isNotEmpty(key)) { 495 key = key.trim(); 496 } 497 if (CmsStringUtil.isNotEmpty(value)) { 498 value = value.trim(); 499 } 500 m_parameters.put(key, value); 501 if (LOG.isDebugEnabled()) { 502 LOG.debug(Messages.get().getBundle().key(Messages.LOG_ADD_MOD_PARAM_KEY_2, key, value)); 503 } 504 } 505 506 /** 507 * Adds a resource to the list module resources.<p> 508 * 509 * @param resource a resources uri in the OpenCms VFS 510 */ 511 public void addResource(String resource) { 512 513 if (LOG.isDebugEnabled()) { 514 LOG.debug(Messages.get().getBundle().key(Messages.LOG_ADD_MOD_RESOURCE_1, resource)); 515 } 516 m_resources.add(resource); 517 } 518 519 /** 520 * Adds a new resource type to the internal list of loaded resource types.<p> 521 * 522 * @param resourceType the resource type to add 523 * 524 * @see I_CmsResourceType#ADD_RESOURCE_TYPE_METHOD 525 */ 526 public void addResourceType(I_CmsResourceType resourceType) { 527 528 resourceType.setAdditionalModuleResourceType(true); 529 m_resourceTypes.add(resourceType); 530 } 531 532 /** 533 * Created a new module from the provided parameters.<p> 534 * 535 * @param name the name of this module, usually looks like a java package name 536 * @param niceName the "nice" display name of this module 537 * @param group the group of the module 538 * @param actionClass the (optional) module action class name 539 * @param description the description of this module 540 * @param version the version of this module 541 * @param authorName the name of the author of this module 542 * @param authorEmail the email of the module author 543 * @param dateCreated the date this module was created by the author 544 * @param userInstalled the name of the user who uploaded this module 545 * @param dateInstalled the date this module was uploaded 546 */ 547 public void createdModule( 548 String name, 549 String niceName, 550 String group, 551 String actionClass, 552 String description, 553 String version, 554 String authorName, 555 String authorEmail, 556 String dateCreated, 557 String userInstalled, 558 String dateInstalled) { 559 560 String moduleName; 561 562 if (!CmsStringUtil.isValidJavaClassName(name)) { 563 // ensure backward compatibility with old (5.0) module names 564 LOG.error(Messages.get().getBundle().key(Messages.LOG_INVALID_MOD_NAME_IMPORTED_1, name)); 565 moduleName = makeValidJavaClassName(name); 566 LOG.error(Messages.get().getBundle().key(Messages.LOG_CORRECTED_MOD_NAME_1, moduleName)); 567 } else { 568 moduleName = name; 569 } 570 571 // parse the module version 572 CmsModuleVersion moduleVersion = new CmsModuleVersion(version); 573 574 // parse date created 575 long moduleDateCreated = CmsModule.DEFAULT_DATE; 576 if (dateCreated != null) { 577 try { 578 moduleDateCreated = CmsDateUtil.parseHeaderDate(dateCreated); 579 } catch (ParseException e) { 580 // noop 581 } 582 } 583 584 // parse date installed 585 long moduleDateInstalled = CmsModule.DEFAULT_DATE; 586 if (dateInstalled != null) { 587 try { 588 moduleDateInstalled = CmsDateUtil.parseHeaderDate(dateInstalled); 589 } catch (ParseException e1) { 590 // noop 591 } 592 } 593 594 if (m_oldModule) { 595 // make sure module path is added to resources for "old" (5.0.x) modules 596 String modulePath = CmsWorkplace.VFS_PATH_MODULES + name + "/"; 597 m_resources.add(modulePath); 598 } 599 600 // now create the module 601 m_module = new CmsModule( 602 moduleName, 603 niceName, 604 group, 605 actionClass, 606 description, 607 moduleVersion, 608 authorName, 609 authorEmail, 610 moduleDateCreated, 611 userInstalled, 612 moduleDateInstalled, 613 m_dependencies, 614 m_exportPoints, 615 m_resources, 616 m_parameters); 617 618 // store module name in the additional resource types 619 List<I_CmsResourceType> moduleResourceTypes = new ArrayList<I_CmsResourceType>(m_resourceTypes.size()); 620 for (Iterator<I_CmsResourceType> i = m_resourceTypes.iterator(); i.hasNext();) { 621 I_CmsResourceType resType = i.next(); 622 resType.setModuleName(moduleName); 623 moduleResourceTypes.add(resType); 624 } 625 // set the additional resource types; 626 m_module.setResourceTypes(moduleResourceTypes); 627 628 // set the additional explorer types 629 m_module.setExplorerTypes(m_explorerTypeSettings); 630 } 631 632 /** 633 * Returns the generated module.<p> 634 * 635 * @return the generated module 636 */ 637 public CmsModule getModule() { 638 639 return m_module; 640 } 641 642 /** 643 * Sets the current imported module to an old (5.0.x) style module. 644 */ 645 public void setOldModule() { 646 647 m_oldModule = true; 648 if (LOG.isDebugEnabled()) { 649 LOG.debug(Messages.get().getBundle().key(Messages.LOG_OLD_MODULE_IMPORTED_0)); 650 } 651 } 652}