Package org.davinci.server.user

Examples of org.davinci.server.user.IUser


        throw e;
      }
    }

    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
      IUser user = null;
      try {
          if (!initialized) {
              initialize();
          }
 
View Full Code Here


  protected URL _getResource(String path) {
    URL url = super._getResource(path);
    if (url != null) {
      return url;
    }
    IUser user = null;
    IPath ipath = new Path(path);
    if (ipath.segment(0).equals(contextPathSegment)) {
       ipath = ipath.removeFirstSegments(1);
    }
    if (ipath.segment(0).equals("maqetta")) {
      if (ipath.segment(1).equals("user")) {
         ipath = ipath.removeFirstSegments(2);
        String userName = ipath.segment(0);
        try {
          user = userManager.getUser(userName);
        } catch (UserException e) {
          // TODO surface error up the stack
          e.printStackTrace();
          return null;
        } catch (IOException e) {
          // TODO surface error up the stack
          e.printStackTrace();
          return null;
        }
        ipath = ipath.removeFirstSegments(1);
        if (ipath.segment(0).equals("ws") && ipath.segment(1).equals("workspace")) {
          ipath = ipath.removeFirstSegments(2);
        }
      } else {
        user = userManager.getSingleUser();
      }
      int removecount = 0;
      if (ipath.segment(0).equals(".review")) {
        removecount = 4;
      } else {
        removecount = user.getResource(ipath.segment(0)+"/.project") == null ? 1 : 2;
      }
      ILibInfo[] projectLibs = user.getLibs(ipath.segment(0));
      url = scanSrcLibs(ipath, removecount, projectLibs);
      if (url != null) {
        return url;
      }
    }
    IVResource resource = user.getResource(ipath.toString());
    if (resource != null) {
      try {
        if (logger.isLoggable(Level.FINEST)) {
          logger.logp(Level.FINEST, getClass().getName(), "_getResource", "resource ["+path +"] loaded from project");
        }
View Full Code Here

      throws IOException {
    Comment comment = extractComment(req);
   
    IUserManager userManager = ServerManager.getServerManager().getUserManager();
    String designerName = comment.getDesignerId();
    IUser designer = null;
    try {
      if(ServerManager.LOCAL_INSTALL && IDavinciServerConstants.LOCAL_INSTALL_USER.equalsIgnoreCase(designerName)) {
        designer = userManager.getUser(IDavinciServerConstants.LOCAL_INSTALL_USER);
      } else {
        designer = userManager.getUser(designerName);
      }
    } catch (UserException e) {
      errorString = "Failure getting user for 'designer'. Reason: " + e.getMessage();
      theLogger.severe((String) errorString);
      return;
    }
   
    //Set up project based on designer
    DavinciProject project = new DavinciProject();
    project.setOwnerId(designer.getUserID());
    comment.setProject(project);

    comment.setEmail(user.getPerson().getEmail());

    IDesignerUser du = ReviewManager.getReviewManager()
View Full Code Here

        if (this.maxUsers > 0 && this.usersCount >= this.maxUsers) {
            throw new UserException(UserException.MAX_USERS);
        }
        IPerson person = this.personManager.addPerson(userName, password, email);
        if (person != null) {
            IUser user = newUser(person, this.baseDirectory.newInstance(this.baseDirectory, userName));
          //  users.put(userName, user);
            //File userDir = user.getUserDirectory();
            //userDir.mkdir();
            //File settingsDir = user.getSettingsDirectory();
           // settingsDir.mkdir();
            try {
        user.createProject(IDavinciServerConstants.DEFAULT_PROJECT);
      } catch (IOException e) {
        throw new UserException(e);
      }
           
            this.usersCount++;
View Full Code Here

     */
    public boolean isValidUser(String userName) throws UserException, IOException {
        if (ServerManager.LOCAL_INSTALL && IDavinciServerConstants.LOCAL_INSTALL_USER.equals(userName)) {
            return true;
        }
        IUser user = getUser(userName);
        return user != null;
    }
View Full Code Here

TOP

Related Classes of org.davinci.server.user.IUser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.