📄 jwmasettings.java
字号:
* * @param name the preferences view filename/URL ending as <tt>String</tt>. */ public void setPreferencesView(String name) { m_Properties.setProperty("jwma.view.preferences", name); }//setPreferencesView /** * Returns a <tt>String</tt> representing the firsttime view * filename/URL ending. * * @return the firsttime view filename/URL ending as <tt>String</tt>. */ public String getFirsttimeView() { return m_Properties.getProperty("jwma.view.firsttime"); }//getFirsttimeView /** * Sets the filename/URL ending for the firsttime view. * * @param name the firsttime view filename/URL ending as <tt>String</tt>. */ public void setFirsttimeView(String name) { m_Properties.setProperty("jwma.view.firsttime", name); }//setFirsttimeView /** * Returns a <tt>String</tt> representing the contacts view * filename/URL ending. * * @return the contacts view filename/URL ending as <tt>String</tt>. */ public String getContactsView() { return m_Properties.getProperty("jwma.view.contacts"); }//getContactsView /** * Sets the filename/URL ending for the contacts view. * * @param name the contacts view filename/URL ending as <tt>String</tt>. */ public void setContactsView(String name) { m_Properties.setProperty("jwma.view.contacts", name); }//setContactsView /** * Returns a <tt>String</tt> representing the contact view * filename/URL ending. * * @return the contact view filename/URL ending as <tt>String</tt>. */ public String getContactView() { return m_Properties.getProperty("jwma.view.contact"); }//getContactView /** * Sets the filename/URL ending for the contact view. * * @param name the contact view filename/URL ending as <tt>String</tt>. */ public void setContactView(String name) { m_Properties.setProperty("jwma.view.contact", name); }//setContactView /** * Returns a <tt>String</tt> representing the contact edit view * filename/URL ending. * * @return the contact edit view filename/URL ending as <tt>String</tt>. */ public String getContactEditView() { return m_Properties.getProperty("jwma.view.contactedit"); }//getContactEditView /** * Sets the filename/URL ending for the contact edit view. * * @param name the contact edit view filename/URL ending as <tt>String</tt>. */ public void setContactEditView(String name) { m_Properties.setProperty("jwma.view.contactedit", name); }//setContactEditView /** * Returns a <tt>String</tt> representing the contact group view * filename/URL ending. * * @return the contact group view filename/URL ending as <tt>String</tt>. */ public String getContactGroupView() { return m_Properties.getProperty("jwma.view.contactgroup"); }//getContactGroupView /** * Sets the filename/URL ending for the contact group view. * * @param name the contact group view filename/URL ending as <tt>String</tt>. */ public void setContactGroupView(String name) { m_Properties.setProperty("jwma.view.contactgroup", name); }//setContactGroupView /** * Returns a <tt>String</tt> representing the contact group edit view * filename/URL ending. * * @return the contact group edit view filename/URL ending as <tt>String</tt>. */ public String getContactGroupEditView() { return m_Properties.getProperty("jwma.view.contactgroupedit"); }//getContactGroupEditView /** * Sets the filename/URL ending for the contact group edit view. * * @param name the contact group edit view filename/URL ending as <tt>String</tt>. */ public void setContactGroupEditView(String name) { m_Properties.setProperty("jwma.view.contactgroupedit", name); }//setContactGroupEditView /** * Returns a <tt>String</tt> representing the admin preferences view * filename/URL ending. * * @return the admin preferences view filename/URL ending as <tt>String</tt>. */ public String getAdminPreferencesView() { return m_Properties.getProperty("jwma.view.admin.preferences"); }//getAdminPreferencesView /** * Sets the filename/URL ending for the admin preferences view. * * @param name the preferences view filename/URL ending as <tt>String</tt>. */ public void setAdminPreferencesView(String name) { m_Properties.setProperty("jwma.view.admin.preferences", name); }//setAdminPreferencesView /** * Returns a <tt>String</tt> representing the admin settings view * filename/URL ending. * * @return the admin settings view filename/URL ending as <tt>String</tt>. */ public String getAdminSettingsView() { return m_Properties.getProperty("jwma.view.admin.settings"); }//getAdminSettingsView /** * Sets the filename/URL ending for the admin settings view. * * @param name the admin settings view filename/URL ending as <tt>String</tt>. */ public void setAdminSettingsView(String name) { m_Properties.setProperty("jwma.view.admin.settings", name); }//setAdminSettingsView /** * Returns a <tt>String</tt> representing the admin login view * filename/URL ending. * * @return the admin login view filename/URL ending as <tt>String</tt>. */ public String getAdminLoginView() { return m_Properties.getProperty("jwma.view.admin.login"); }//getAdminLoginView /** * Sets the filename/URL ending for the admin login view. * * @param name the admin login view filename/URL ending as <tt>String</tt>. */ public void setAdminLoginView(String name) { m_Properties.setProperty("jwma.view.admin.login", name); }//setAdminLoginView /** * Returns a <tt>String</tt> representing the admin status view * filename/URL ending. * * @return the admin status view filename/URL ending as <tt>String</tt>. */ public String getAdminStatusView() { return m_Properties.getProperty("jwma.view.admin.status"); }//getAdminStatusView /** * Sets the filename/URL ending for the admin status view. * * @param name the admin status view filename/URL ending as <tt>String</tt>. */ public void setAdminStatusView(String name) { m_Properties.setProperty("jwma.view.admin.status", name); }//setAdminStatusView /** * Returns a <tt>String</tt> representing the admin menu view * filename/URL ending. * * @return the admin menu view filename/URL ending as <tt>String</tt>. */ public String getAdminMenuView() { return m_Properties.getProperty("jwma.view.admin.menu"); }//getAdminMenuView /** * Sets the filename/URL ending for the admin menu view. * * @param name the admin menu view filename/URL ending as <tt>String</tt>. */ public void setAdminMenuView(String name) { m_Properties.setProperty("jwma.view.admin.menu", name); }//setAdminMenuView /** * Returns a <tt>String</tt> representing the admin error view * filename/URL ending. * * @return the admin error view filename/URL ending as <tt>String</tt>. */ public String getAdminErrorView() { return m_Properties.getProperty("jwma.view.admin.error"); }//getAdminErrorView /** * Sets the filename/URL ending for the admin error view. * * @param name the admin error view filename/URL ending as <tt>String</tt>. */ public void setAdminErrorView(String name) { m_Properties.setProperty("jwma.view.admin.error", name); }//setAdminErrorView /*** END Views related ***********************************************/ /*** i18n related ****************************************************/ public String getSystemLanguage() { return m_Properties.getProperty("jwma.i18n.systemlanguage"); }//getSystemLanguage public void setSystemLanguage(String language) { m_Properties.setProperty("jwma.i18n.systemlanguage", language); }//setLanguageList public String[] getLanguageList() { return StringUtil.split(m_Properties.getProperty("jwma.i18n.languages"), ","); }//getLanguageList public void setLanguageList(String[] languages) { m_Properties.setProperty("jwma.i18n.languages", StringUtil.join(languages, ",")); }//setLanguageList /*** END i18n related ************************************************/ public String getPrefPersistencePluginClassName() { return m_Properties.getProperty("jwma.plugin.preferencespersistence"); }//getPrefPersistencePluginClassName public void setPrefPersistencePluginClassName(String classname) { m_Properties.setProperty("jwma.plugin.preferencespersistence", classname); }//setPrefPersistencePluginClassName public String getContactManagementPluginClassName() { return m_Properties.getProperty("jwma.plugin.contactmanagement"); }//getContactManagementPluginClassName public void setContactManagementPluginClassName(String classname) { m_Properties.setProperty("jwma.plugin.contactmanagement", classname); }//setContactManagementPluginClassName public String getRandomAppendPluginClassName() { return m_Properties.getProperty("jwma.plugin.randomappend"); }//getRandomAppendPluginClassName public void setRandomAppendPluginClassName(String classname) { m_Properties.setProperty("jwma.plugin.randomappend", classname); }//setRandomApendPluginClassName public String[] getCategories() { return StringUtil.split(m_Properties.getProperty("jwma.contacts.categories"), ","); }//getCategories public void setCategories(String[] cats) { m_Properties.setProperty("jwma.contacts.categories", StringUtil.join(cats, ",")); }//setCategories /** * Loads the properties file containing jwma's settings. */ public void load() throws JwmaException { try { FileInputStream in = new FileInputStream(m_PropFile); m_Properties.load(in); } catch (Exception ex) { throw new JwmaException( "jwma.settings.load.failed" ).setException(ex); } }//load /** * Saves the properties file containing jwma's settings. */ public void save() throws JwmaException { try { FileOutputStream out = new FileOutputStream(m_PropFile); //FIXME: Modification line as string for saving m_Properties.store(out, ""); } catch (Exception ex) { throw new JwmaException( "jwma.settings.save.failed" ).setException(ex); } }//save /** * Returns a <tt>String</tt> representing the settings file's * path. * * @return the settings file path as <tt>String</tt>. */ public String getPath() { return (m_WebInfDir + File.separator + ETC_DIR + File.separator + serviceproperties); }//getPath /** * Returns a <tt>String</tt> representing the settings file's * path. * * @return the settings file path as <tt>String</tt>. */ public String getDump() { StringWriter dump = new StringWriter(); m_Properties.list(new PrintWriter(dump)); return dump.toString(); }//getDump /** * Prepares for loading/saving the properties file * containing jwma's settings. */ private void prepare() throws JwmaException { try { m_PropFile = new File(m_WebInfDir + File.separator + ETC_DIR + File.separator + serviceproperties); m_Properties = new Properties(); m_PropFile.exists(); } catch (Exception ex) { throw new JwmaException( "jwma.settings.load.prepare" ).setException(ex); } }//prepare /** * Creates a <tt>JwmaSettings</tt> instance. * <p> * Requires the path to the directory where jwma's files and * folders reside. For the WAR the path should represent * the "WEB-INF" directory. * * @param path the path to the directory where jwma's files * and folders reside. */ public static JwmaSettings createJwmaSettings(String path) throws JwmaException { //create instance JwmaSettings settings = new JwmaSettings(path); settings.prepare(); settings.load(); return settings; }//createJwmaSettings /** * Defines a name of the static jwma direcory architecture. */ public static final String LOG_DIR = "logs"; public static final String ETC_DIR = "etc"; public static final String DATA_DIR = "data"; public static final String I18N_DIR = "i18n"; /** * Defines the name of jwma's user visible error messages file. */ public static final String ERROR_DESCRIPTION_FILE = "errormessages.properties"; /** * Defines the name of jwma's properties file. */ private static final String serviceproperties = "jwma.properties";}//class JwmaSettingsImpl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -