1 31 32 package org.opencms.main; 33 34 import org.opencms.db.CmsDefaultUsers; 35 import org.opencms.db.CmsLoginManager; 36 import org.opencms.db.CmsSqlManager; 37 import org.opencms.file.CmsObject; 38 import org.opencms.file.CmsResource; 39 import org.opencms.i18n.CmsLocaleManager; 40 import org.opencms.importexport.CmsImportExportManager; 41 import org.opencms.loader.CmsResourceManager; 42 import org.opencms.lock.CmsLockManager; 43 import org.opencms.module.CmsModuleManager; 44 import org.opencms.monitor.CmsMemoryMonitor; 45 import org.opencms.scheduler.CmsScheduleManager; 46 import org.opencms.search.CmsSearchManager; 47 import org.opencms.security.CmsRole; 48 import org.opencms.security.I_CmsPasswordHandler; 49 import org.opencms.security.I_CmsValidationHandler; 50 import org.opencms.site.CmsSiteManager; 51 import org.opencms.staticexport.CmsLinkManager; 52 import org.opencms.staticexport.CmsStaticExportManager; 53 import org.opencms.workplace.CmsWorkplaceManager; 54 import org.opencms.xml.CmsXmlContentTypeManager; 55 56 import java.util.List ; 57 import java.util.Map ; 58 import java.util.Set ; 59 60 import javax.servlet.http.HttpServletRequest ; 61 import javax.servlet.http.HttpServletResponse ; 62 63 import org.apache.commons.logging.Log; 64 65 99 public final class OpenCms { 100 101 102 public static final int RUNLEVEL_0_OFFLINE = 0; 103 104 105 public static final int RUNLEVEL_1_CORE_OBJECT = 1; 106 107 108 public static final int RUNLEVEL_2_INITIALIZING = 2; 109 110 111 public static final int RUNLEVEL_3_SHELL_ACCESS = 3; 112 113 114 public static final int RUNLEVEL_4_SERVLET_ACCESS = 4; 115 116 119 private OpenCms() { 120 121 } 123 124 129 public static void addCmsEventListener(I_CmsEventListener listener) { 130 131 OpenCmsCore.getInstance().getEventManager().addCmsEventListener(listener); 132 } 133 134 140 public static void addCmsEventListener(I_CmsEventListener listener, int[] eventTypes) { 141 142 OpenCmsCore.getInstance().getEventManager().addCmsEventListener(listener, eventTypes); 143 } 144 145 150 public static void fireCmsEvent(CmsEvent event) { 151 152 OpenCmsCore.getInstance().getEventManager().fireEvent(event); 153 } 154 155 163 public static void fireCmsEvent(int type, Map data) { 164 165 OpenCmsCore.getInstance().getEventManager().fireEvent(type, data); 166 } 167 168 175 public static List getDefaultFiles() { 176 177 return OpenCmsCore.getInstance().getDefaultFiles(); 178 } 179 180 185 public static CmsDefaultUsers getDefaultUsers() { 186 187 return OpenCmsCore.getInstance().getDefaultUsers(); 188 } 189 190 195 public static CmsEventManager getEventManager() { 196 197 return OpenCmsCore.getInstance().getEventManager(); 198 } 199 200 206 public static Set getExportPoints() { 207 208 return OpenCmsCore.getInstance().getExportPoints(); 209 } 210 211 217 public static CmsImportExportManager getImportExportManager() { 218 219 return OpenCmsCore.getInstance().getImportExportManager(); 220 } 221 222 227 public static CmsLinkManager getLinkManager() { 228 229 return OpenCmsCore.getInstance().getLinkManager(); 230 } 231 232 237 public static CmsLocaleManager getLocaleManager() { 238 239 return OpenCmsCore.getInstance().getLocaleManager(); 240 } 241 242 247 public static CmsLockManager getLockManager() { 248 249 return OpenCmsCore.getInstance().getLockManager(); 250 } 251 252 262 public static Log getLog(Object obj) { 263 264 return CmsLog.getLog(obj); 265 } 266 267 272 public static CmsLoginManager getLoginManager() { 273 274 return OpenCmsCore.getInstance().getLoginManager(); 275 } 276 277 282 public static CmsMemoryMonitor getMemoryMonitor() { 283 284 return OpenCmsCore.getInstance().getMemoryMonitor(); 285 } 286 287 292 public static CmsModuleManager getModuleManager() { 293 294 return OpenCmsCore.getInstance().getModuleManager(); 295 } 296 297 302 public static I_CmsPasswordHandler getPasswordHandler() { 303 304 return OpenCmsCore.getInstance().getPasswordHandler(); 305 } 306 307 312 public static CmsResourceManager getResourceManager() { 313 314 return OpenCmsCore.getInstance().getResourceManager(); 315 } 316 317 344 public static int getRunLevel() { 345 346 return OpenCmsCore.getInstance().getRunLevel(); 347 } 348 349 355 public static Object getRuntimeProperty(Object key) { 356 357 return OpenCmsCore.getInstance().getRuntimeProperty(key); 358 } 359 360 365 public static CmsScheduleManager getScheduleManager() { 366 367 return OpenCmsCore.getInstance().getScheduleManager(); 368 } 369 370 376 public static CmsSearchManager getSearchManager() { 377 378 return OpenCmsCore.getInstance().getSearchManager(); 379 } 380 381 386 public static CmsSessionManager getSessionManager() { 387 388 return OpenCmsCore.getInstance().getSessionManager(); 389 } 390 391 397 public static CmsSiteManager getSiteManager() { 398 399 return OpenCmsCore.getInstance().getSiteManager(); 400 } 401 402 407 public static CmsSqlManager getSqlManager() { 408 409 return OpenCmsCore.getInstance().getSqlManager(); 410 } 411 412 417 public static CmsStaticExportManager getStaticExportManager() { 418 419 return OpenCmsCore.getInstance().getStaticExportManager(); 420 } 421 422 427 public static CmsSystemInfo getSystemInfo() { 428 429 return OpenCmsCore.getInstance().getSystemInfo(); 430 } 431 432 439 public static List getSystemRoles() { 440 441 return CmsRole.getSystemRoles(); 442 } 443 444 449 public static CmsThreadStore getThreadStore() { 450 451 return OpenCmsCore.getInstance().getThreadStore(); 452 } 453 454 459 public static I_CmsValidationHandler getValidationHandler() { 460 461 return OpenCmsCore.getInstance().getValidationHandler(); 462 } 463 464 470 public static CmsWorkplaceManager getWorkplaceManager() { 471 472 return OpenCmsCore.getInstance().getWorkplaceManager(); 473 } 474 475 480 public static CmsXmlContentTypeManager getXmlContentTypeManager() { 481 482 return OpenCmsCore.getInstance().getXmlContentTypeManager(); 483 } 484 485 502 public static CmsObject initCmsObject(CmsObject cms) throws CmsException { 503 504 return OpenCmsCore.getInstance().initCmsObject(cms); 505 } 506 507 528 public static CmsObject initCmsObject(CmsObject adminCms, CmsContextInfo contextInfo) throws CmsException { 529 530 return OpenCmsCore.getInstance().initCmsObject(adminCms, contextInfo); 531 } 532 533 560 public static CmsObject initCmsObject(String user) throws CmsException { 561 562 return OpenCmsCore.getInstance().initCmsObject(user); 563 } 564 565 588 public static CmsResource initResource( 589 CmsObject cms, 590 String resourceName, 591 HttpServletRequest req, 592 HttpServletResponse res) throws CmsException { 593 594 return OpenCmsCore.getInstance().initResource(cms, resourceName, req, res); 595 } 596 597 602 public static void removeCmsEventListener(I_CmsEventListener listener) { 603 604 OpenCmsCore.getInstance().getEventManager().removeCmsEventListener(listener); 605 } 606 607 615 public static void setRuntimeProperty(Object key, Object value) { 616 617 OpenCmsCore.getInstance().setRuntimeProperty(key, value); 618 } 619 620 625 public static void writeConfiguration(Class clazz) { 626 627 OpenCmsCore.getInstance().writeConfiguration(clazz); 628 } 629 } | Popular Tags |