protected List<String> getInlineEditableMimeTypes() { if ((this.inlineEditableMimeTypes == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance()))) { this.inlineEditableMimeTypes = new ArrayList<String>(8); // get the create mime types list from the config ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance()); Config wizardCfg = svc.getConfig("Content Wizards"); if (wizardCfg != null) { ConfigElement typesCfg = wizardCfg.getConfigElement("create-mime-types"); if (typesCfg != null) { for (ConfigElement child : typesCfg.getChildren()) { String currentMimeType = child.getAttribute("name"); this.inlineEditableMimeTypes.add(currentMimeType); } } } } return this.inlineEditableMimeTypes; }
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
public void init() { lock.writeLock().lock(); try { // create shared connection LRU cache sharedConnections = new LinkedHashMap<String, CMISConnection>( sharedConnectionsCapacity, (int) Math.ceil(sharedConnectionsCapacity / 0.75) + 1, true) { private static final long serialVersionUID = 1; @Override protected boolean removeEldestEntry(Map.Entry<String, CMISConnection> eldest) { return size() > sharedConnectionsCapacity; } }; // create user connection LRU cache userConnections = new LinkedHashMap<String, CMISConnection>( userConnectionsCapacity, (int) Math.ceil(userConnectionsCapacity / 0.75) + 1, true) { private static final long serialVersionUID = 1; @Override protected boolean removeEldestEntry(Map.Entry<String, CMISConnection> eldest) { return size() > userConnectionsCapacity; } }; // get predefined server definitions CMISServersConfigElement cmisServersConfig = (CMISServersConfigElement) configService.getConfig("CMIS").getConfigElement("cmis-servers"); if (cmisServersConfig != null && cmisServersConfig.getServerDefinitions() != null) { servers = cmisServersConfig.getServerDefinitions(); } else { servers = new HashMap<String, CMISServer>(); } } finally { lock.writeLock().unlock(); } }