Exemplo n.º 1
0
 public Workspace findByNameAndOwner(String name, String userAccount) {
   assert userAccount != null;
   Workspace result;
   result = workspaceRepository.findByName(name, userAccount);
   assert result != null;
   return result;
 }
Exemplo n.º 2
0
  public void delete(String workspaceName, String username) {
    Assert.notNull(workspaceName);
    Assert.notNull(username);

    deleteReferences(workspaceName, username);

    Workspace ws = workspaceRepository.findByName(workspaceName, username);

    workspaceRepository.delete(ws);
  }
Exemplo n.º 3
0
  public void updateDemo(String demoWorkspaceName, String username) {

    Assert.notNull(demoWorkspaceName);
    Assert.notNull(username);

    Workspace demoWS = workspaceRepository.findByName(demoWorkspaceName, DEMO_MASTER);
    Workspace originWS = demoWS.getOrigin();

    demoWS.setLastMod(Calendar.getInstance().getTime());
    demoWS.setDescription(originWS.getDescription());
    updateVersion(originWS);
    demoWS.setWsVersion(originWS.getWsVersion());

    workspaceRepository.saveAndFlush(demoWS);
  }
Exemplo n.º 4
0
  public void updateLaunches(String workspaceName, String username) {

    Assert.notNull(workspaceName);
    Assert.notNull(username);

    Workspace ws = workspaceRepository.findByName(workspaceName, username);

    int l = ws.getLaunches();
    ws.setLaunches(l + 1);

    if (ws.getOrigin() != null && username.equals(DEMO_MASTER))
      updateLaunches(
          ws.getOrigin().getName(), ws.getOrigin().getOwner().getUserAccount().getUsername());

    workspaceRepository.saveAndFlush(ws);
  }
Exemplo n.º 5
0
 public boolean checkNameAvailability(String workspaceName, String username) {
   return (workspaceRepository.findByName(workspaceName, username) == null);
 }