Package org.davinci.server.user

Examples of org.davinci.server.user.IUser


 
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        if(serverManager==null)
            initialize();
        String previewParam = req.getParameter(IDavinciServerConstants.PREVIEW_PARAM);
        IUser user = ServerManager.getServerManager().getUserManager().getUser(req);
       
        /* orion adds an index.html to the path.  remove that and redirect if we encounter */
        String pathInfo =getPathInfo(req);
       
       
        if(pathInfo==null)   {
          resp.sendRedirect("./maqetta/");
          resp.getOutputStream().close();
          return;
        }

        theLogger.info("request: " + pathInfo + ", logged in=" + (user != null));

        if (pathInfo!=null && pathInfo.endsWith("/welcome")) {
            /* write the welcome page (may come from extension point) */
            writeWelcomePage(req, resp);
        }else if (user==null) {
                    resp.sendRedirect("./welcome");
        }else if(pathInfo==null || pathInfo.equals("") || pathInfo.equals("/") ){
         
          /* rebuild the users workspace before launching main page.  this is in case Orion changed the files under the covers */
          user.rebuildWorkspace();
          writeMainPage(req, resp);
      
        } else if (req.getParameter(IDavinciServerConstants.PREVIEW_PARAM)!=null) {
            handlePreview(req,resp);
        }else if (pathInfo.startsWith(IDavinciServerConstants.USER_URL)) {
View Full Code Here


         }
         return null;
    }

    public IUser newUser(IPerson person, IStorage baseDirectory) throws UserException {
       IUser user;
    try {
      user = new OrionUser(person);
    } catch (CoreException e) {
      throw new UserException(e);
    }
       if(init(person.getUserID())){
         try {
        user.createProject(IDavinciServerConstants.DEFAULT_PROJECT);
      } catch (IOException e) {
        throw new UserException(e);
      }
       }
       return user;
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,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

    return null;
  }

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

   * 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

    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

  }
 
  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

    }
    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

      }
    }

    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

        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

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.