/** * Publishes the current project, printing messages to a shell report.<p> * * @param cms the cms request context * @return the publish history id of the published project * * @throws Exception if something goes wrong * * @see CmsShellReport */ public CmsUUID publishProject(CmsObject cms) throws Exception { return publishProject(cms, new CmsShellReport(cms.getRequestContext().getLocale())); }
/** * Publishes the current project, printing messages to a shell report.<p> * * @param cms the cms request context * @return the publish history id of the published project * * @throws Exception if something goes wrong * * @see CmsShellReport */ public CmsUUID publishProject(CmsObject cms) throws Exception { return publishProject(cms, new CmsShellReport(cms.getRequestContext().getLocale())); }
/** * Deletes the versions from the history tables that are older then the given number of versions.<p> * * @param versionsToKeep number of versions to keep, is ignored if negative * @param versionsDeleted number of versions to keep for deleted resources, is ignored if negative * @param timeDeleted deleted resources older than this will also be deleted, is ignored if negative * * @throws Exception if something goes wrong * * @see CmsObject#deleteHistoricalVersions( int, int, long, I_CmsReport) */ public void deleteHistoricalVersions(int versionsToKeep, int versionsDeleted, long timeDeleted) throws Exception { m_cms.deleteHistoricalVersions(versionsToKeep, versionsDeleted, timeDeleted, new CmsShellReport( m_cms.getRequestContext().getLocale())); }
/** * Publishes a single resource, printing messages to a shell report.<p> * * The siblings of the resource will not be published.<p> * * @param cms the cms request context * @param resourcename the name of the resource to be published * * @return the publish history id of the published project * * @throws Exception if something goes wrong * * @see CmsShellReport */ public CmsUUID publishResource(CmsObject cms, String resourcename) throws Exception { return publishResource(cms, resourcename, false, new CmsShellReport(cms.getRequestContext().getLocale())); }
/** * Publishes a single resource, printing messages to a shell report.<p> * * The siblings of the resource will not be published.<p> * * @param cms the cms request context * @param resourcename the name of the resource to be published * * @return the publish history id of the published project * * @throws Exception if something goes wrong * * @see CmsShellReport */ public CmsUUID publishResource(CmsObject cms, String resourcename) throws Exception { return publishResource(cms, resourcename, false, new CmsShellReport(cms.getRequestContext().getLocale())); }
/** * Rebuilds (if required creates) the given search index.<p> * * @param index name of the index to update * @throws Exception if something goes wrong * @see org.opencms.search.CmsSearchManager#rebuildIndex(String, org.opencms.report.I_CmsReport) */ public void rebuildIndex(String index) throws Exception { OpenCms.getSearchManager().rebuildIndex(index, new CmsShellReport(m_cms.getRequestContext().getLocale())); }
/** * Rebuilds (if required creates) all configured search indexes.<p> * * @throws Exception if something goes wrong * * @see org.opencms.search.CmsSearchManager#rebuildAllIndexes(org.opencms.report.I_CmsReport) */ public void rebuildAllIndexes() throws Exception { I_CmsReport report = new CmsShellReport(m_cms.getRequestContext().getLocale()); OpenCms.getSearchManager().rebuildAllIndexes(report); }
/** * Rebuilds (if required creates) all configured search indexes.<p> * * @throws Exception if something goes wrong * * @see org.opencms.search.CmsSearchManager#rebuildAllIndexes(org.opencms.report.I_CmsReport) */ public void rebuildAllIndexes() throws Exception { I_CmsReport report = new CmsShellReport(m_cms.getRequestContext().getLocale()); OpenCms.getSearchManager().rebuildAllIndexes(report); }
/** * Deletes a module.<p> * * @param moduleName the name of the module * @throws Exception if something goes wrong */ public void deleteModule(String moduleName) throws Exception { OpenCms.getModuleManager().deleteModule( m_cms, moduleName, false, new CmsShellReport(m_cms.getRequestContext().getLocale())); }
/** * Rebuilds (if required creates) the given search index.<p> * * @param index name of the index to update * @throws Exception if something goes wrong * @see org.opencms.search.CmsSearchManager#rebuildIndex(String, org.opencms.report.I_CmsReport) */ public void rebuildIndex(String index) throws Exception { OpenCms.getSearchManager().rebuildIndex(index, new CmsShellReport(m_cms.getRequestContext().getLocale())); }
/** * Deletes a module.<p> * * @param moduleName the name of the module * @throws Exception if something goes wrong */ public void deleteModule(String moduleName) throws Exception { OpenCms.getModuleManager().deleteModule( m_cms, moduleName, false, new CmsShellReport(m_cms.getRequestContext().getLocale())); }
/** * Imports a module.<p> * * @param importFile the absolute path of the import module file * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) */ public void importModule(String importFile) throws Exception { CmsImportParameters params = new CmsImportParameters(importFile, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * Imports a module.<p> * * @param importFile the absolute path of the import module file * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) */ public void importModule(String importFile) throws Exception { CmsImportParameters params = new CmsImportParameters(importFile, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * Publishes the current project, printing messages to a shell report.<p> * * @return the publish history id of the published project * * @throws Exception if something goes wrong * * @see CmsShellReport * * @deprecated use <code>{@link OpenCms#getPublishManager()}.{@link org.opencms.publish.CmsPublishManager#publishProject(CmsObject) publishProject(CmsObject)}</code> instead */ public CmsUUID publishProject() throws Exception { CmsUUID publishHistoryId = OpenCms.getPublishManager().publishProject( this, new CmsShellReport(m_context.getLocale())); OpenCms.getPublishManager().waitWhileRunning(); return publishHistoryId; }
/** * 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, org.opencms.report.I_CmsReport, CmsImportParameters) */ protected void importModuleFromDefault(String importFile) throws Exception { String fileName = getModuleFolder() + importFile; OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), new CmsImportParameters(fileName, "/", true)); }
/** * Replaces a module with another revision.<p> * * @param moduleName the name of the module * @param importFile the name of the import file * * @throws Exception if something goes wrong */ public void replaceModule(String moduleName, String importFile) throws Exception { if (OpenCms.getModuleManager().getModule(moduleName) != null) { OpenCms.getModuleManager().deleteModule( m_cms, moduleName, true, new CmsShellReport(m_cms.getRequestContext().getLocale())); } importModule(importFile); }
/** * Replaces a module with another revision.<p> * * @param moduleName the name of the module * @param importFile the name of the import file * @throws Exception if something goes wrong */ public void replaceModuleFromDefault(String moduleName, String importFile) throws Exception { if (OpenCms.getModuleManager().getModule(moduleName) != null) { OpenCms.getModuleManager().deleteModule( m_cms, moduleName, true, new CmsShellReport(m_cms.getRequestContext().getLocale())); } importModuleFromDefault(importFile); }
/** * Replaces a module with another revision.<p> * * @param moduleName the name of the module * @param importFile the name of the import file * @throws Exception if something goes wrong */ public void replaceModuleFromDefault(String moduleName, String importFile) throws Exception { if (OpenCms.getModuleManager().getModule(moduleName) != null) { OpenCms.getModuleManager().deleteModule( m_cms, moduleName, true, new CmsShellReport(m_cms.getRequestContext().getLocale())); } importModuleFromDefault(importFile); }
/** * Replaces a module with another revision.<p> * * @param moduleName the name of the module * @param importFile the name of the import file * * @throws Exception if something goes wrong */ public void replaceModule(String moduleName, String importFile) throws Exception { if (OpenCms.getModuleManager().getModule(moduleName) != null) { OpenCms.getModuleManager().deleteModule( m_cms, moduleName, true, new CmsShellReport(m_cms.getRequestContext().getLocale())); } importModule(importFile); }
/** * 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); }