protected void showModelList(VitroRequest vreq, ModelMaker maker, WhichService modelType) { vreq.setAttribute("modelType", modelType.toString()); if (modelType == CONTENT) { vreq.setAttribute("infoLine", "Main Store models"); } else { vreq.setAttribute("infoLine", "Configuration models"); } vreq.setAttribute("modelNames", maker.listModels().toList()); vreq.setAttribute("bodyAttr", "onLoad=\"init()\""); vreq.setAttribute("title", "Available Models"); vreq.setAttribute("bodyJsp", LIST_MODELS_JSP); }
@Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (!isAuthorizedToDisplayPage( request, response, SimplePermission.USE_ADVANCED_DATA_TOOLS_PAGES.ACTION)) { return; } VitroRequest vreq = new VitroRequest(request); ModelMaker maker = getModelMaker(vreq); WhichService modelType = getModelType(vreq); String actionStr = vreq.getParameter("action"); actionStr = (actionStr != null) ? actionStr : ""; if ("listModels".equals(actionStr)) { processListModelsRequest(vreq, maker, modelType); } else if ("configModels".equals(actionStr)) { processConfigModelsRequest(vreq); } else if ("contentModels".equals(actionStr)) { processContentModelsRequest(vreq); } else if ("createModel".equals(actionStr)) { processCreateModelRequest(vreq, maker, modelType); } else if ("removeModel".equals(actionStr)) { processRemoveModelRequest(vreq, maker, modelType); } else if ("loadRDFData".equals(actionStr)) { processLoadRDFDataRequest(vreq, maker); } else if ("cleanLiterals".equals(actionStr)) { processCleanLiteralsRequest(vreq); } else if ("outputModel".equals(actionStr)) { processOutputModelRequest(vreq, response); return; // don't attempt to display a JSP } else if ("clearModel".equals(actionStr)) { processClearModelRequest(vreq, maker, modelType); } else if ("attachModel".equals(actionStr)) { processAttachModelRequest(vreq, maker, modelType); } else if ("detachModel".equals(actionStr)) { processDetachModelRequest(vreq, maker, modelType); } else if ("renameBNodes".equals(actionStr)) { processRenameBNodesRequest(vreq, maker); } else if ("renameBNodesURISelect".equals(actionStr)) { processRenameBNodesURISelectRequest(vreq, maker); } else if ("smushSingleModel".equals(actionStr)) { processSmushSingleModelRequest(vreq); } else if ("csv2rdf".equals(actionStr)) { processCsv2rdfRequest(vreq); } else if ("processStrings".equals(actionStr)) { processProcessStringsRequest(vreq); } else if ("splitPropertyValues".equals(actionStr)) { processSplitPropertyValuesRequest(vreq); } else if ("subtractModels".equals(actionStr)) { processSubtractModelRequest(vreq); } else if ("executeWorkflow".equals(actionStr)) { processExecuteWorkflowRequest(vreq); } else if ("executeSparql".equals(actionStr)) { processExecuteSparqlRequest(vreq); } else if ("generateTBox".equals(actionStr)) { processGenerateTBoxRequest(vreq); } else if ("permanentURI".equals(actionStr)) { processPermanentURIRequest(vreq, maker); } else if ("mergeResources".equals(actionStr)) { processMergeResourceRequest(vreq); } else if ("renameResource".equals(actionStr)) { processRenameResourceRequest(vreq); } else if ("mergeResult".equals(actionStr)) { processMergeResultRequest(vreq, response); return; } else if ("dumpRestore".equals(actionStr)) { processDumpRestore(vreq, response); return; } else { request.setAttribute("title", "Ingest Menu"); request.setAttribute("bodyJsp", INGEST_MENU_JSP); } maker = getModelMaker(vreq); request.setAttribute("modelNames", maker.listModels().toList()); RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP); try { rd.forward(request, response); } catch (Exception e) { log.error(e, e); throw new ServletException(e); } }