/** * Returns the name of the default workspace. * * @return default workspace name */ public String getDefaultWorkspaceName() { return repository.getConfig().getDefaultWorkspaceName(); }
/** * Returns the name of the default workspace. * * @return default workspace name */ public String getDefaultWorkspaceName() { return repository.getConfig().getDefaultWorkspaceName(); }
/** * Get the root/system session for a workspace * @param workspaceName if the workspaceName equals null the default namespace is taken * @return Session the rootSession * @throws RepositoryException */ public Session getRootSession(String workspaceName) throws RepositoryException { if (workspaceName == null) { workspaceName = super.repConfig.getDefaultWorkspaceName(); } return (getWorkspaceInfo(workspaceName)).getRootSession(); }
/** * @see AccessControlProviderFactory#init(Session) */ public void init(Session securitySession) throws RepositoryException { secWorkspaceName = securitySession.getWorkspace().getName(); if (securitySession instanceof SessionImpl) { defaultWorkspaceName = ((RepositoryImpl) securitySession.getRepository()).getConfig().getDefaultWorkspaceName(); } // else: unable to determine default workspace name }
/** * @see AccessControlProviderFactory#init(Session) */ public void init(Session securitySession) throws RepositoryException { secWorkspaceName = securitySession.getWorkspace().getName(); if (securitySession instanceof SessionImpl) { defaultWorkspaceName = ((RepositoryImpl) securitySession.getRepository()).getConfig().getDefaultWorkspaceName(); } // else: unable to determine default workspace name }
wspNames.remove(repConfig.getDefaultWorkspaceName());
wspNames.remove(repConfig.getDefaultWorkspaceName());
/** * Initialize startup workspaces. Base implementation will initialize the * default workspace. Derived classes may initialize their own startup * workspaces <b>after</b> having called the base implementation. * * @throws RepositoryException if an error occurs */ protected void initStartupWorkspaces() throws RepositoryException { String wspName = repConfig.getDefaultWorkspaceName(); String secWspName = null; SecurityManagerConfig smc = repConfig.getSecurityConfig().getSecurityManagerConfig(); if (smc != null) { secWspName = smc.getWorkspaceName(); } try { (wspInfos.get(wspName)).initialize(); if (secWspName != null && !wspInfos.containsKey(secWspName)) { createWorkspace(secWspName); log.info("created system workspace: {}", secWspName); } } catch (RepositoryException e) { // if default workspace failed to initialize, shutdown again log.error("Failed to initialize workspace '" + wspName + "'", e); log.error("Unable to start repository, forcing shutdown..."); shutdown(); throw e; } }
/** * Initialize startup workspaces. Base implementation will initialize the * default workspace. Derived classes may initialize their own startup * workspaces <b>after</b> having called the base implementation. * * @throws RepositoryException if an error occurs */ protected void initStartupWorkspaces() throws RepositoryException { String wspName = repConfig.getDefaultWorkspaceName(); String secWspName = null; SecurityManagerConfig smc = repConfig.getSecurityConfig().getSecurityManagerConfig(); if (smc != null) { secWspName = smc.getWorkspaceName(); } try { (wspInfos.get(wspName)).initialize(); if (secWspName != null && !wspInfos.containsKey(secWspName)) { createWorkspace(secWspName); log.info("created system workspace: {}", secWspName); } } catch (RepositoryException e) { // if default workspace failed to initialize, shutdown again log.error("Failed to initialize workspace '" + wspName + "'", e); log.error("Unable to start repository, forcing shutdown..."); shutdown(); throw e; } }
public static IndexReader getReader(RepositoryContext ctx) throws RepositoryException, IOException { RepositoryImpl repo = ctx.getRepository(); SearchManager searchMgr = repo.getSearchManager(ctx.getRepositoryConfig().getDefaultWorkspaceName()); if (searchMgr == null) { return null; } QueryHandler handler = searchMgr.getQueryHandler(); SearchIndex index = (SearchIndex) handler; return index.getIndexReader(); }
public static IndexReader getReader(RepositoryContext ctx) throws RepositoryException, IOException { RepositoryImpl repo = ctx.getRepository(); SearchManager searchMgr = repo.getSearchManager(ctx.getRepositoryConfig().getDefaultWorkspaceName()); if (searchMgr == null) { return null; } QueryHandler handler = searchMgr.getQueryHandler(); SearchIndex index = (SearchIndex) handler; return index.getIndexReader(); }
workspaceName = repConfig.getDefaultWorkspaceName();
workspaceName = repConfig.getDefaultWorkspaceName();
String workspaceName = getConfig().getDefaultWorkspaceName(); if (smc != null && smc.getWorkspaceName() != null) { workspaceName = smc.getWorkspaceName();
String workspaceName = getConfig().getDefaultWorkspaceName(); if (smc != null && smc.getWorkspaceName() != null) { workspaceName = smc.getWorkspaceName();
@Override protected void setUp() throws Exception { super.setUp(); RepositoryConfig rc = ((RepositoryImpl) superuser.getRepository()).getConfig(); String workspaceName = rc.getSecurityConfig().getSecurityManagerConfig().getWorkspaceName(); if (workspaceName == null) { workspaceName = rc.getDefaultWorkspaceName(); } securitySession = getHelper().getSuperuserSession(workspaceName); }
assertFalse(subject == ((SessionImpl) s3).getSubject()); assertEquals(subject, ((SessionImpl) s3).getSubject()); assertEquals(((RepositoryImpl) sImpl.getRepository()).getConfig().getDefaultWorkspaceName(), s3.getWorkspace().getName()); } finally { s3.logout();
getSystemSearchManager(repConfig.getDefaultWorkspaceName()); virtNTMgr.setSession(getSystemSession(repConfig.getDefaultWorkspaceName()));
getSystemSearchManager(repConfig.getDefaultWorkspaceName()); virtNTMgr.setSession(getSystemSession(repConfig.getDefaultWorkspaceName()));
private void assertRepositoryConfiguration(RepositoryConfig config) throws ConfigurationException { assertEquals(DIR.getPath(), config.getHomeDir()); assertEquals("default", config.getDefaultWorkspaceName()); assertEquals( new File(DIR, "workspaces").getPath(),