Examples of IUser


Examples of org.davinci.server.user.IUser

        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,null);
         
            //File userDir = user.getUserDirectory();
            //userDir.mkdir();
            //File settingsDir = user.getSettingsDirectory();
           // settingsDir.mkdir();
            user.createProject(IDavinciServerConstants.DEFAULT_PROJECT);
            this.usersCount++;
            return user;
        }
        return null;
    }
View Full Code Here

Examples of org.davinci.server.user.IUser

    return null;
  }

    @Override
  public boolean isValidUserByEmail(String email) throws UserException {
        IUser user = getUserByEmail(email);
        return user != null;
  }
View Full Code Here

Examples of org.davinci.server.user.IUser

   * javax.servlet.http.HttpServlet#doPut(javax.servlet.http.HttpServletRequest
   * , javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    IUser user = null;
    try {
      user = ServerManager.getServerManager().getUserManager().getUser(req);
      if(user==null){
        resp.sendError(HttpServletResponse.SC_FORBIDDEN);
        return;
      }
      String path = getPathInfo(req);
      if (path == null) {
        theLogger.warning("DavinciPageServlet:doPut getPathInfo returned Null for user: " + user.getUserID());
        resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        return;
      }
      boolean isWorkingCopy = (path.indexOf(IDavinciServerConstants.WORKING_COPY_EXTENSION) > -1);
      if ( isWorkingCopy ) {
        path = path.substring(0, path.indexOf(IDavinciServerConstants.WORKING_COPY_EXTENSION));
      }
      IVResource file = user.getResource(path);
      if (file == null) {
        theLogger.warning("DavinciPageServlet:doPut user.getResource("+path+") returned Null for user: " + user.getUserID());
        resp.sendError(HttpServletResponse.SC_NOT_FOUND);
        return;
      }
      /* user is trying to save over a library path */
      if ( file.isVirtual() ) {
        file = user.createResource(path, file.isDirectory());
        if(file.isDirectory())
          file.mkdir();
        else
           file.createNewInstance();
      }
View Full Code Here

Examples of org.davinci.server.user.IUser

    return req.getPathInfo();
  }
 
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    IUser user = null;
    try {
      if ( serverManager == null ) {
        initialize();
      }
      String previewParam = req.getParameter(IDavinciServerConstants.PREVIEW_PARAM);
View Full Code Here

Examples of org.davinci.server.user.IUser

  }
 
  public IDesignerUser getDesignerUser(String name) throws IOException {
    IDesignerUser designer = designerUsers.get(name);
    if (designer == null) {
      IUser user;
      try {
        user = ServerManager.getServerManager().getUserManager().getUser(name);
      } catch (UserException e) {
        throw new RuntimeException(e);
      }
View Full Code Here

Examples of org.davinci.server.user.IUser

    }
    theLogger.info(log);
  }

  protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    IUser user = null;
      try {
        resp.setCharacterEncoding("utf-8");
          if (!initialized) {
              initialize();
          }
View Full Code Here

Examples of org.davinci.server.user.IUser

      }
    }

    private IUser checkLogin(HttpServletRequest req, HttpServletResponse resp, CommandDescriptor commandDescriptor) throws IOException {

        IUser user = ServerManager.getServerManager().getUserManager().getUser(req);
        if (user == null) {
            if (!ServerManager.LOCAL_INSTALL &&!commandDescriptor.isNoLogin()) {
                    resp.sendError(HttpServletResponse.SC_UNAUTHORIZED);
                    return null;
            }
View Full Code Here

Examples of org.davinci.server.user.IUser

        return user;
    }

    @Override
    protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws IOException {
      IUser user = null;
      try {
          if (!initialized) {
              initialize();
          }
          String pathInfo = req.getPathInfo();
View Full Code Here

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

Examples of org.davinci.server.user.IUser

  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
TOP
Copyright © 2018 www.massapi.com. 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.