public void createWorkspace(String name, String source) throws RepositoryException, RemoteException { if (source != null) { workspace.createWorkspace(name, source); } else { workspace.createWorkspace(name); } }
private void createWorkspace(final Workspace w, final String name) { try { w.createWorkspace(name); } catch (Exception e) { // ignore; } }
public void createWorkspace(String name) throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException { workspace.createWorkspace(name); }
public void createWorkspace(String name, String srcWorkspace) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException { workspace.createWorkspace(name, srcWorkspace); }
/** * {@inheritDoc} */ public void createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException { SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo); Workspace wsp = sInfo.getSession().getWorkspace(); if (srcWorkspaceName == null) { wsp.createWorkspace(name); } else { wsp.createWorkspace(name, srcWorkspaceName); } }
@Override public void createWorkspace(String name, String srcWorkspace) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException { getWrappedWorkspace().createWorkspace(name, srcWorkspace); }
public void execute() throws Exception { getDelegate().createWorkspace(name, srcWorkspace); } });
/** * {@inheritDoc} */ public void createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException { SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo); Workspace wsp = sInfo.getSession().getWorkspace(); if (srcWorkspaceName == null) { wsp.createWorkspace(name); } else { wsp.createWorkspace(name, srcWorkspaceName); } }
@Override public void createWorkspace(String name) throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException { getWrappedWorkspace().createWorkspace(name); }
public void execute() throws Exception { getDelegate().createWorkspace(name); } });
public void createWorkspace( String username, String password, String name) throws RepositoryException { Session session = localRepository.login( new SimpleCredentials(username, password.toCharArray())); try { session.getWorkspace().createWorkspace(name); } finally { session.logout(); } }
private Session createSession(String workspace) throws RepositoryException { try { return bundleHelper.getSession(workspace); } catch (NoSuchWorkspaceException e) { Session temp = bundleHelper.getSession(); temp.getWorkspace().createWorkspace(workspace); temp.logout(); return bundleHelper.getSession(workspace); } }
/** * @see DeltaVResource#addWorkspace(org.apache.jackrabbit.webdav.DavResource) */ @Override public void addWorkspace(DavResource workspace) throws DavException { Workspace wsp = getRepositorySession().getWorkspace(); String name = workspace.getDisplayName(); try { wsp.createWorkspace(name); } catch (RepositoryException e) { throw new JcrDavException(e); } }
protected void createWorkspace( String workspaceName ) throws Exception { Session session = repository.login(); try { session.getWorkspace().createWorkspace(workspaceName); } finally { session.logout(); } }
@Override public void createWorkspace(String repository, String logicalWorkspaceName) throws RepositoryException { for (WorkspaceMappingDefinition mapping : workspaceMapping.getWorkspaceMappings()) { Session session = getSystemSession(mapping.getLogicalWorkspaceName()); try { if (mapping.getRepositoryName().equals(repository)) { Workspace workspace = session.getWorkspace(); workspace.createWorkspace(logicalWorkspaceName); workspaceMapping.addWorkspaceMapping(new WorkspaceMappingDefinition(logicalWorkspaceName, repository, logicalWorkspaceName)); return; } } finally { session.logout(); } } throw new RepositoryException("Repository [" + repository + "] doesn't exist."); }
private String getAlternativeWorkspaceName() throws RepositoryException { String altWsp = null; String[] wsps = superuser.getWorkspace().getAccessibleWorkspaceNames(); if (wsps.length == 1) { superuser.getWorkspace().createWorkspace("tmp"); altWsp = "tmp"; } else { for (String name : wsps) { if (!name.equals(superuser.getWorkspace().getName())) { altWsp = name; break; } } } return altWsp; }
private String getAlternativeWorkspaceName() throws RepositoryException { String altWsp = null; String[] wsps = superuser.getWorkspace().getAccessibleWorkspaceNames(); if (wsps.length == 1) { superuser.getWorkspace().createWorkspace("tmp"); altWsp = "tmp"; } else { for (String name : wsps) { if (!name.equals(superuser.getWorkspace().getName())) { altWsp = name; break; } } } return altWsp; }
public void createWorkspace(String name, String srcWorkspace) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException { getActionHandler().beforeCreateWorkspace(name, srcWorkspace); getDelegate().createWorkspace(name, srcWorkspace); getActionHandler().afterCreateWorkspace(name, srcWorkspace); }
public void createWorkspace(String name) throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException { getActionHandler().beforeCreateWorkspace(name, null); getDelegate().createWorkspace(name); getActionHandler().afterCreateWorkspace(name, null); }
public void testWorkspaceCreationWithPrivilege() throws Exception { assertDefaultPrivileges(NameConstants.JCR_WORKSPACE_MANAGEMENT); assertPermission(Permission.WORKSPACE_MNGMT, false); modifyPrivileges(null, NameConstants.JCR_WORKSPACE_MANAGEMENT.toString(), true); // assert that permission have changed: assertPrivilege(NameConstants.JCR_WORKSPACE_MANAGEMENT, true); assertPermission(Permission.WORKSPACE_MNGMT, true); try { Workspace testWsp = getTestWorkspace(); testWsp.createWorkspace(getNewWorkspaceName(superuser.getWorkspace())); } finally { modifyPrivileges(null, NameConstants.JCR_WORKSPACE_MANAGEMENT.toString(), false); } assertPrivilege(NameConstants.JCR_WORKSPACE_MANAGEMENT, false); assertPermission(Permission.WORKSPACE_MNGMT, false); }