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)) {