/** * Returns the locale.<p> * * @return the locale */ public String getLocale() { return m_context.getLocale().toString(); }
/** * Creates a content access bean based on a Resource, using the current request context locale.<p> * * @param cms the OpenCms context of the current user * @param resource the resource to create the content from */ public CmsJspContentAccessBean(CmsObject cms, CmsResource resource) { this(cms, cms.getRequestContext().getLocale(), resource); }
/** * Returns the current locale.<p> * * @return the current locale */ public Locale getLocale() { return getRequestContext().getLocale(); }
/** * Creates a new context bean using the OpenCms context of the current user.<p> * * The current request context locale is used.<p> * * @param cms the OpenCms context of the current user * @param content the content to access, must contain Object of type {@link CmsResource} */ public CmsJspContentLoadBean(CmsObject cms, List<CmsResource> content) { this(cms, cms.getRequestContext().getLocale(), content); }
/** * Creates a content access bean based on a Resource, using the current request context locale.<p> * * @param cms the OpenCms context of the current user * @param resource the resource to create the content from */ public CmsJspContentAccessBean(CmsObject cms, CmsResource resource) { this(cms, cms.getRequestContext().getLocale(), resource); }
/** * Converts a list of {@link CmsResource} objects to a list of {@link CmsJspContentAccessBean} objects, * using the current request context locale.<p> * * @param cms the current OpenCms user context * @param resources a list of of {@link CmsResource} objects that should be converted * * @return a list of {@link CmsJspContentAccessBean} objects created from the given {@link CmsResource} objects */ public static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, List<CmsResource> resources) { return convertResourceList(cms, cms.getRequestContext().getLocale(), resources); }
/** * Creates a replace html tag Thread.<p> * * @param session the current session * @param cms the current cms object * @param settings the settings needed to perform the operation. */ public CmsSearchReplaceThread(HttpSession session, CmsObject cms, CmsSearchReplaceSettings settings) { super(cms, "searchAndReplace"); initHtmlReport(cms.getRequestContext().getLocale()); m_settings = settings; }
/** * Converts a list of {@link CmsResource} objects to a list of {@link CmsJspContentAccessBean} objects, * using the current request context locale.<p> * * @param cms the current OpenCms user context * @param resources a list of of {@link CmsResource} objects that should be converted * * @return a list of {@link CmsJspContentAccessBean} objects created from the given {@link CmsResource} objects */ public static List convertResourceList(CmsObject cms, List resources) { return convertResourceList(cms, cms.getRequestContext().getLocale(), resources); }
/** * Constructor.<p> * * @param cms the cms context * @param cloneInfo the clone module information */ protected CmsCloneModuleThread(CmsObject cms, CmsCloneModuleInfo cloneInfo) { super(cms, cloneInfo.getName()); m_cloneInfo = cloneInfo; initHtmlReport(cms.getRequestContext().getLocale()); }
/** * Returns the localized name of the role object.<p> * * @return the localized name of the role object */ public String getName() { return m_role.getName(getCms().getRequestContext().getLocale()); }
/** * Creates an Thread to remove the publish locks.<p> * * @param cms the current OpenCms context object * @param resources a list of resource names */ public CmsRemovePubLocksThread(CmsObject cms, List resources) { super(cms, Messages.get().getBundle().key(Messages.GUI_DB_PUBLOCKS_THREAD_NAME_0)); m_resources = new ArrayList(resources); initHtmlReport(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); }
/** * Gets a message from the message bundle.<p> * * @param key the message key * @param args the message parameters * * @return the message from the message bundle */ protected String getMessage(String key, String... args) { return Messages.get().getBundle(m_cms.getRequestContext().getLocale()).key(key, args); }
/** * Creates a repair XML content resources thread.<p> * * @param cms the current cms context * @param settings the settings needed to perform the repair operation */ public CmsXmlContentRepairThread(CmsObject cms, CmsXmlContentRepairSettings settings) { super(cms, Messages.get().getBundle().key(Messages.GUI_XMLCONTENTREPAIR_THREAD_NAME_0)); initHtmlReport(cms.getRequestContext().getLocale()); m_settings = settings; }
/** * Internal action method.<p> * * @param label the label to look up * @param req the current request * @return String the value of the selected label */ public static String wpLabelTagAction(String label, ServletRequest req) { CmsObject cms = CmsFlexController.getCmsObject(req); CmsMessages messages = OpenCms.getWorkplaceManager().getMessages(cms.getRequestContext().getLocale()); return messages.key(label); }
/** * Creates a repair XML content resources thread.<p> * * @param cms the current cms context * @param settings the settings needed to perform the repair operation */ public CmsXmlContentRepairThread(CmsObject cms, CmsXmlContentRepairSettings settings) { super(cms, Messages.get().getBundle().key(Messages.GUI_XMLCONTENTREPAIR_THREAD_NAME_0)); initHtmlReport(cms.getRequestContext().getLocale()); m_settings = settings; }
/** * Checks that the session is not finished, and throws an exception otherwise.<p> * * @throws CmsUgcException if the session is finished */ private void checkNotFinished() throws CmsUgcException { if (m_finished) { String message = Messages.get().container(Messages.ERR_FORM_SESSION_ALREADY_FINISHED_0).key( getCmsObject().getRequestContext().getLocale()); throw new CmsUgcException(CmsUgcConstants.ErrorCode.errInvalidAction, message); } }
/** * Throws an error if the edit resource is already set.<p> * * @throws CmsUgcException if the edit resource is already set */ private void checkEditResourceNotSet() throws CmsUgcException { if (m_editResource != null) { String message = Messages.get().container(Messages.ERR_CANT_EDIT_MULTIPLE_CONTENTS_IN_SESSION_0).key( getCmsObject().getRequestContext().getLocale()); throw new CmsUgcException(CmsUgcConstants.ErrorCode.errInvalidAction, message); } }