/** * Returns the list of all uploadable zip files and uploadable folders available on the server.<p> * * @param includeFolders if true, the uploadable folders are included in the list * @return the list of all uploadable zip files and uploadable folders available on the server */ protected static List getFileListFromServer(boolean includeFolders) { List result = new ArrayList(); // get the RFS package export path String exportpath = OpenCms.getSystemInfo().getPackagesRfsPath(); File folder = new File(exportpath); // get a list of all files of the packages folder String[] files = folder.list(); for (int i = 0; i < files.length; i++) { File diskFile = new File(exportpath, files[i]); // check this is a file and ends with zip -> this is a database upload file if (diskFile.isFile() && diskFile.getName().endsWith(".zip")) { result.add(diskFile.getName()); } else if (diskFile.isDirectory() && includeFolders && (!diskFile.getName().equalsIgnoreCase(FOLDER_MODULES)) && ((new File(diskFile + File.separator + FILE_MANIFEST)).exists())) { // this is an unpacked package, add it to uploadable files result.add(diskFile.getName()); } } return result; }
/** * Parses a request of the form <code>multipart/form-data</code>. * * The result list will contain items of type <code>{@link FileItem}</code>. * If the request is not of type <code>multipart/form-data</code>, then <code>null</code> is returned.<p> * * @param request the HTTP servlet request to parse * * @return the list of <code>{@link FileItem}</code> extracted from the multipart request, * or <code>null</code> if the request was not of type <code>multipart/form-data</code> */ public static List<FileItem> readMultipartFileItems(HttpServletRequest request) { return readMultipartFileItems(request, OpenCms.getSystemInfo().getPackagesRfsPath()); }
String exportpath = OpenCms.getSystemInfo().getPackagesRfsPath(); exportpath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(exportpath + "modules"); File folder = new File(exportpath);
/** * * @see org.opencms.workplace.list.A_CmsListReport#initializeThread() */ @Override public I_CmsReportThread initializeThread() { String importFile = OpenCms.getSystemInfo().getPackagesRfsPath() + getParamFile(); boolean keepPermissions = Boolean.valueOf(getKeepPermissions()).booleanValue(); I_CmsReportThread importThread = new CmsDatabaseImportThread(getCms(), importFile, keepPermissions); return importThread; }
/** * @see org.opencms.workplace.administration.A_CmsImportFromHttp#actionCommit() */ @Override public void actionCommit() throws IOException, ServletException { try { copyFileToServer(OpenCms.getSystemInfo().getPackagesRfsPath()); } catch (CmsException e) { // error copying the file to the OpenCms server setException(e); return; } Map params = new HashMap(); params.put(PARAM_FILE, getParamImportfile()); params.put(PARAM_KEEPPERMISSIONS.toLowerCase(), getParamKeepPermissions()); // set style to display report in correct layout params.put(PARAM_STYLE, CmsToolDialog.STYLE_NEW); // set close link to get back to overview after finishing the import params.put(PARAM_CLOSELINK, CmsToolManager.linkForToolPath(getJsp(), "/database")); // redirect to the report output JSP getToolManager().jspForwardPage(this, CmsDatabaseImportFromServer.IMPORT_ACTION_REPORT, params); }
factory.setRepository(new File(OpenCms.getSystemInfo().getPackagesRfsPath())); ServletFileUpload fu = new ServletFileUpload(factory);
/** * @see org.opencms.workplace.CmsWidgetDialog#actionCommit() */ @Override public void actionCommit() throws IOException, ServletException { List errors = new ArrayList(); // create absolute RFS path and store it in dialog object String exportFileName = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf( OpenCms.getSystemInfo().getPackagesRfsPath() + File.separator + m_exportParams.getPath()); m_exportParams.setPath(exportFileName); setDialogObject(m_exportParams); Map params = new HashMap(); // set the name of this class to get dialog object in report params.put(CmsDatabaseExportReport.PARAM_CLASSNAME, this.getClass().getName()); // set style to display report in correct layout params.put(PARAM_STYLE, CmsToolDialog.STYLE_NEW); // set close link to get back to overview after finishing the import params.put(PARAM_CLOSELINK, CmsToolManager.linkForToolPath(getJsp(), "/database")); // redirect to the report output JSP getToolManager().jspForwardPage(this, EXPORT_ACTION_REPORT, params); // set the list of errors to display when saving failed setCommitErrors(errors); }
/** * * @see org.opencms.workplace.list.A_CmsListReport#initializeThread() */ @Override public I_CmsReportThread initializeThread() { String modulename = getParamModule(); String importpath = OpenCms.getSystemInfo().getPackagesRfsPath(); importpath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(importpath + "modules/" + modulename); I_CmsReportThread importThread = new CmsDatabaseImportThread(getCms(), importpath, true); return importThread; }
CmsModule module = null; try { String importpath = OpenCms.getSystemInfo().getPackagesRfsPath(); importpath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf( importpath + "modules/" + m_moduleupload);
/** * @see org.opencms.workplace.list.A_CmsListReport#initializeThread() */ @Override public I_CmsReportThread initializeThread() { String module = getParamModule(); String modulename = getParamModulename(); String importpath = OpenCms.getSystemInfo().getPackagesRfsPath(); importpath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(importpath + "modules/" + module); I_CmsReportThread replaceThread = new CmsModuleReplaceThread(getCms(), modulename, importpath); return replaceThread; }
OpenCms.getSystemInfo().getPackagesRfsPath() + File.separator)); if (!discFolder.exists()) { if (!discFolder.mkdir()) {
OpenCms.getSystemInfo().getPackagesRfsPath() + File.separator + CmsSystemInfo.FOLDER_MODULES); } catch (CmsException e) { CmsModule module = null; try { String importpath = OpenCms.getSystemInfo().getPackagesRfsPath(); importpath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf( importpath + "modules/" + getParamImportfile());
File temp = new File(OpenCms.getSystemInfo().getPackagesRfsPath()); if (temp.exists() || temp.mkdirs()) {
OpenCms.getSystemInfo().getPackagesRfsPath() + CmsSystemInfo.FOLDER_MODULES + moduleName
/** * Imports a module (zipfile) from the default module directory, * creating a temporary project for this.<p> * * @param importFile the name of the import module located in the default module directory * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) */ public void importModuleFromDefault(String importFile) throws Exception { String exportPath = OpenCms.getSystemInfo().getPackagesRfsPath(); String fileName = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf( exportPath + CmsSystemInfo.FOLDER_MODULES + importFile); CmsImportParameters params = new CmsImportParameters(fileName, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * Imports a module (zipfile) from the default module directory, * creating a temporary project for this.<p> * * @param importFile the name of the import module located in the default module directory * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) */ public void importModuleFromDefault(String importFile) throws Exception { String exportPath = OpenCms.getSystemInfo().getPackagesRfsPath(); String fileName = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf( exportPath + CmsSystemInfo.FOLDER_MODULES + importFile); CmsImportParameters params = new CmsImportParameters(fileName, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
OpenCms.getSystemInfo().getPackagesRfsPath() + CmsSystemInfo.FOLDER_MODULES + moduleName
OpenCms.getSystemInfo().getPackagesRfsPath() + CmsSystemInfo.FOLDER_MODULES + moduleName