Author: tmortagne Date: 2007-10-30 14:17:15 +0100 (Tue, 30 Oct 2007) New Revision: 5568
Modified: xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/rightsmanager/RightsManagerPluginApi.java Log: XWIKI-1826: Add get/set default ui to be able to change the default user interface to use for rights management. If no value found in xwiki.cfg 1.1 return "stable" and 1.2 return "new". Modified: xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/rightsmanager/RightsManagerPluginApi.java =================================================================== --- xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/rightsmanager/RightsManagerPluginApi.java 2007-10-30 09:31:59 UTC (rev 5567) +++ xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/rightsmanager/RightsManagerPluginApi.java 2007-10-30 13:17:15 UTC (rev 5568) @@ -52,6 +52,24 @@ public static final String CONTEXT_LASTEXCEPTION = "lastexception"; /** + * The name of the property in [EMAIL PROTECTED] com.xpn.xwiki.XWikiConfig} indicating the user interface + * to use for rights management. + */ + public static final String RIGHTS_UI_PROPERTY = "xwiki.rights.defaultui"; + + /** + * The value of the [EMAIL PROTECTED] #RIGHTS_UI_PROPERTY} that indicate to use the stable/basic user + * interface. + */ + public static final String RIGHTS_UI_VALUE_STABLE = "stable"; + + /** + * The value of the [EMAIL PROTECTED] #RIGHTS_UI_PROPERTY} that indicate to use the new experimental ajax + * user interface. + */ + public static final String RIGHTS_UI_VALUE_NEW = "new"; + + /** * Quote symbol. */ public static final String QUOTE = "\""; @@ -199,6 +217,25 @@ this.context.put(CONTEXT_LASTEXCEPTION, e); } + /** + * @return the user interface to use for rights management. Can be "stable" or "new". + */ + public String getDefaultUi() + { + return this.context.getWiki().getConfig().getProperty(RIGHTS_UI_PROPERTY, + RIGHTS_UI_VALUE_STABLE); + } + + /** + * Modify the user interface to use for rights management. + * + * @param ui "stable" or "new". + */ + public void setDefaultUi(String ui) + { + this.context.getWiki().getConfig().setProperty(RIGHTS_UI_PROPERTY, ui); + } + // Groups management /** _______________________________________________ notifications mailing list notifications@xwiki.org http://lists.xwiki.org/mailman/listinfo/notifications