Пример #1
0
 /**
  * create an user as owner of the givent project
  *
  * @param project
  * @param string
  * @param string2
  * @return
  */
 public User User(Project project, String name, String login) {
   // add a owner
   User owner = new User(new UserPK(ctx.getCustomerId()), name, login);
   UserServiceBaseImpl.getInstance().store(ctx, owner);
   AccessRight ownerRight = new AccessRight(Role.OWNER, owner.getId().getUserId(), null);
   customer.getAccessRights().add(ownerRight);
   AppContext ownerCtx = new AppContext.Builder(ctx.getCustomerId(), owner).build();
   CustomerServiceBaseImpl.getInstance().store(ownerCtx, customer);
   return owner;
 }
Пример #2
0
 public Project Project(
     String name, String dbUrl, String dbUser, String dbPassword, String[] dbSchemas) {
   ProjectPK pk = new ProjectPK(ctx.getCustomerId(), getNewID(name));
   Project project = new Project(pk, name);
   project.setDbUrl(dbUrl);
   project.setDbUser(dbUser);
   project.setDbPassword(dbPassword);
   project.setDbSchemas(Arrays.asList(dbSchemas));
   project = ProjectServiceBaseImpl.getInstance().store(ctx, project);
   return project;
 }
Пример #3
0
 /**
  * @deprecated
  * @param name
  * @param expression
  * @return
  */
 public Project Project(String name, Expression expression) {
   ProjectPK pk = new ProjectPK(ctx.getCustomerId(), getNewID());
   Project project = new Project(pk, name);
   project = ProjectServiceBaseImpl.getInstance().store(ctx, project);
   return project;
 }