Diverse Formatierungen und Dokumentation. Sprachumschaltung funktioniert jetzt komplett, solange die property-Dateien benutzt werden.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2099 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-03-19 09:37:22 +00:00
parent 2a5d642762
commit 7a33e117e8
15 changed files with 1467 additions and 282 deletions

View File

@ -36,7 +36,6 @@ public class EventGlobalizationUtil {
final public static String BUNDLE_NAME = final public static String BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.util.EventResourceBundle"; "com.arsdigita.cms.contenttypes.util.EventResourceBundle";
/** /**
* This returns a globalized message using the type specific bundle, * This returns a globalized message using the type specific bundle,
* BUNDLE_NAME * BUNDLE_NAME

View File

@ -29,7 +29,7 @@ import java.util.PropertyResourceBundle;
* @author Shashin Shinde (sshinde@redhat.com) * @author Shashin Shinde (sshinde@redhat.com)
*/ */
public class EventResourceBundle extends ChainedResourceBundle public class EventResourceBundle extends ChainedResourceBundle
implements CMSGlobalized { implements CMSGlobalized {
public final static String EVENT_BUNDLE_NAME = public final static String EVENT_BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.EventResources"; "com.arsdigita.cms.contenttypes.EventResources";

View File

@ -1099,7 +1099,6 @@ cms.ui.image_upload=Bild hochladen
cms.ui.images=Bilder cms.ui.images=Bilder
cms.ui.search.create.select_close=Item ausw\u00e4hlen und schlie\u00dfen cms.ui.search.create.select_close=Item ausw\u00e4hlen und schlie\u00dfen
cms.ui.search.create.select_edit=Item ausw\u00e4hlen und weiter bearbeiten cms.ui.search.create.select_edit=Item ausw\u00e4hlen und weiter bearbeiten
cms.ui.clear=Zur\u00fccksetzen cms.ui.clear=Zur\u00fccksetzen
cms.ui.type.minimum_number_of_values_bigger_than_maximum_number_of_values=Maximaler Wert kleiner als minimaler Wert cms.ui.type.minimum_number_of_values_bigger_than_maximum_number_of_values=Maximaler Wert kleiner als minimaler Wert
cms.ui.type.minimummaximum_number_of_values_cannot_be_negative=Keine negativen Werte erlaubt cms.ui.type.minimummaximum_number_of_values_cannot_be_negative=Keine negativen Werte erlaubt

File diff suppressed because it is too large Load Diff

View File

@ -1,61 +1,61 @@
cms.tasks.ui.content_center=Content Centre cms.tasks.ui.content_center=Content Centre
cms.ui.content_center=Content Centre cms.ui.content_center=Content Centre
cms.ui.lifecycles=Lifecycles cms.ui.lifecycles=Lifecycles
cms.ui.unknownRole= cms.ui.unknownRole=Unknown role
cms.ui.unknownStatus=Unknown status cms.ui.unknownStatus=Unknown status
cms.contenttypes.ui.genericorgaunit.persons.status=Status cms.contenttypes.ui.genericorgaunit.persons.status=Status
cms.contenttypes.shared.basic_properties.title= cms.contenttypes.shared.basic_properties.title=Basic Properties
cms.ui.edit_assoc= cms.ui.edit_assoc=Edit association
cms.ui.type.permissions= cms.ui.type.permissions=Permissions (Create new items of this type)
cms.ui.type.permissions.role= cms.ui.type.permissions.role=Role
cms.ui.type.permissions_can_use= cms.ui.type.permissions_can_use=Use this type
cms.ui.type.permission.action= cms.ui.type.permission.action=Action
cms.ui.type.permissions.can_use.yes= cms.ui.type.permissions.can_use.yes=Yes
cms.ui.type.permissions.actions.restrict_to_this_role= cms.ui.type.permissions.actions.restrict_to_this_role=Restrict to this role
cms.ui.type.permissions.can_use.grant= cms.ui.type.permissions.can_use.grant=Grant permissions to this role
cms.ui.type.permissions.actions.revoke= cms.ui.type.permissions.actions.revoke=Revoke permission
cms.ui.type.permissions.can_use.no= cms.ui.type.permissions.can_use.no=No
cms.contenttypes.ui.person.set_alias= cms.contenttypes.ui.person.set_alias=Set former name
cms.contenttypes.ui.person.delete_alias= cms.contenttypes.ui.person.delete_alias=Remove former name
cms.contenttypes.ui.person.alias.none= cms.contenttypes.ui.person.alias.none=No former name
cms.contenttypes.ui.person.alias= cms.contenttypes.ui.person.alias=Former name
cms.contenttypes.ui.person.alias.select= cms.contenttypes.ui.person.alias.select=Select former name
cms.contenttypes.ui.contact.alias.select.add= cms.contenttypes.ui.contact.alias.select.add=Select former name
cms.contenttypes.person.alias.select.wrong_type= cms.contenttypes.person.alias.select.wrong_type=No person selected
cms.contenttypes.person.alias.select.same_as_person= cms.contenttypes.person.alias.select.same_as_person=Selected person is the same as the current person. Alias and person can't be identical.
cms.contenttypes.person.alias.select.no_suitable_language_variant= cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant.
cms.ui.item.lifecycle.do= cms.ui.item.lifecycle.do=Execute
cms.ui.item.lifecycle.do.not_authorized= cms.ui.item.lifecycle.do.not_authorized=Your not authorized to publish this item.
cms.ui.item.lifecycle.publish_locked= cms.ui.item.lifecycle.publish_locked=This content item is being (re-)published
cms.ui.item.lifecycle.publish_locked.update= cms.ui.item.lifecycle.publish_locked.update=Update
cms.ui.lifecycle.publish.error= cms.ui.lifecycle.publish.error=An error occured while publishing this item.The system administrator has been notified about this problem. This item will stay locked until the lock is removed by the system administrator manually.
cms.ui.delete_confirmation= cms.ui.delete_confirmation=Permanently delete this item?
cms.ui.lifecycle.details.last_published= cms.ui.lifecycle.details.last_published=Item last (re-)published
cms.ui.item_search.flat.filter= cms.ui.item_search.flat.filter=Filter list
cms.ui.item_search.flat.no_items= cms.ui.item_search.flat.no_items=No items matching the filter found
cms.ui.item_search.flat.title=Title cms.ui.item_search.flat.title=Title
cms.ui.item_search.flat.place=Place cms.ui.item_search.flat.place=Place
cms.ui.item_search.flat.type=Type cms.ui.item_search.flat.type=Type
cms.ui.item_search.flatBrowse=Select item cms.ui.item_search.flatBrowse=Select item
cms.ui.category.undeletable= cms.ui.category.undeletable=This category can't be deleted.
cms.ui.item_search.flat.filter.submit= cms.ui.item_search.flat.filter.submit=Filter
cms.ui.item_search.selected= cms.ui.item_search.selected=Selected content item (id)
cms.ui.item_search.create= cms.ui.item_search.create=Create new
cms.ui.item_search.create.folder_select= cms.ui.item_search.create.folder_select=Select folder
cms.ui.image_library=Image Library cms.ui.image_library=Image Library
cms.ui.image_upload=Upload Image cms.ui.image_upload=Upload Image
cms.ui.images=Images cms.ui.images=Images
cms.ui.search.create.select_close= cms.ui.search.create.select_close=Select item and close
cms.ui.search.create.select_edit= cms.ui.search.create.select_edit=Select item and edit
cms.ui.clear= cms.ui.clear=Clear
cms.ui.item_search.create.folder_missing= cms.ui.item_search.create.folder_missing=No folder selected
cms.ui.images_links= cms.ui.images_links=
cms.contenttypes.ui.person.alias.delete.label= cms.contenttypes.ui.person.alias.delete.label=Delete
cms.ui.contentcenter.mainpage.search= cms.ui.contentcenter.mainpage.search=Search
cms.ui.contentcenter.mainpage.taskssections= cms.ui.contentcenter.mainpage.taskssections=Tasks/Sections
cms.ui.contentcenter.section= cms.ui.contentcenter.section=Section
cms.ui.contentcenter.action= cms.ui.contentcenter.action=Action
cms.ui.set_home_folder= cms.ui.set_home_folder=Set as home folder
cms.ui.go_to_home_folder= cms.ui.go_to_home_folder=Go to home folder
cms.ui.no_home_folder_selected= cms.ui.no_home_folder_selected=No home folder selected

View File

@ -535,58 +535,58 @@ yes=Oui
cms.contenttypes.ui.address.uri=URL (TRANSLATE THIS cms.contenttypes.ui.address.uri) cms.contenttypes.ui.address.uri=URL (TRANSLATE THIS cms.contenttypes.ui.address.uri)
cms.contenttypes.ui.address.email.desc=Means of contacting someone at this address (TRANSLATE THIS cms.contenttypes.ui.address.email.desc) cms.contenttypes.ui.address.email.desc=Means of contacting someone at this address (TRANSLATE THIS cms.contenttypes.ui.address.email.desc)
cms.contenttypes.ui.address.uri.desc=A URL to find more information about this Address (TRANSLATE THIS cms.contenttypes.ui.address.uri.desc) cms.contenttypes.ui.address.uri.desc=A URL to find more information about this Address (TRANSLATE THIS cms.contenttypes.ui.address.uri.desc)
cms.contenttypes.shared.basic_properties.title= cms.contenttypes.shared.basic_properties.title=Basic Properties
cms.ui.edit_assoc= cms.ui.edit_assoc=
cms.ui.type.permissions= cms.ui.type.permissions=Permissions (Create new items of this type)
cms.ui.type.permissions.role= cms.ui.type.permissions.role=Role
cms.ui.type.permissions_can_use= cms.ui.type.permissions_can_use=Use this type
cms.ui.type.permission.action= cms.ui.type.permission.action=Action
cms.ui.type.permissions.can_use.yes= cms.ui.type.permissions.can_use.yes=Yes
cms.ui.type.permissions.actions.restrict_to_this_role= cms.ui.type.permissions.actions.restrict_to_this_role=Restrict to this role
cms.ui.type.permissions.can_use.grant= cms.ui.type.permissions.can_use.grant=Grant permissions to this role
cms.ui.type.permissions.actions.revoke= cms.ui.type.permissions.actions.revoke=Revoke permission
cms.ui.type.permissions.can_use.no= cms.ui.type.permissions.can_use.no=No
cms.contenttypes.ui.person.set_alias= cms.contenttypes.ui.person.set_alias=Set former name
cms.contenttypes.ui.person.delete_alias= cms.contenttypes.ui.person.delete_alias=Remove former name
cms.contenttypes.ui.person.alias.none= cms.contenttypes.ui.person.alias.none=No former name
cms.contenttypes.ui.person.alias= cms.contenttypes.ui.person.alias=Former name
cms.contenttypes.ui.person.alias.select= cms.contenttypes.ui.person.alias.select=Select former name
cms.contenttypes.ui.contact.alias.select.add= cms.contenttypes.ui.contact.alias.select.add=Select former name
cms.contenttypes.person.alias.select.wrong_type= cms.contenttypes.person.alias.select.wrong_type=No person selected
cms.contenttypes.person.alias.select.same_as_person= cms.contenttypes.person.alias.select.same_as_person=Selected person is the same as the current person. Alias and person can't be identical.
cms.contenttypes.person.alias.select.no_suitable_language_variant= cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant.
cms.ui.item.lifecycle.do= cms.ui.item.lifecycle.do=Execute
cms.ui.item.lifecycle.do.not_authorized= cms.ui.item.lifecycle.do.not_authorized=Your not authorized to publish this item.
cms.ui.item.lifecycle.publish_locked= cms.ui.item.lifecycle.publish_locked=This content item is being (re-)published
cms.ui.item.lifecycle.publish_locked.update= cms.ui.item.lifecycle.publish_locked.update=Update
cms.ui.lifecycle.publish.error= cms.ui.lifecycle.publish.error=An error occured while publishing this item.The system administrator has been notified about this problem. This item will stay locked until the lock is removed by the system administrator manually.
cms.ui.delete_confirmation= cms.ui.delete_confirmation=
cms.ui.lifecycle.details.last_published= cms.ui.lifecycle.details.last_published=Item last (re-)published
cms.ui.item_search.flat.filter= cms.ui.item_search.flat.filter=Filter list
cms.ui.item_search.flat.no_items= cms.ui.item_search.flat.no_items=No items matching the filter found
cms.ui.item_search.flat.title=Title cms.ui.item_search.flat.title=Title
cms.ui.item_search.flat.place=Place cms.ui.item_search.flat.place=Place
cms.ui.item_search.flat.type=Type cms.ui.item_search.flat.type=Type
cms.ui.item_search.flatBrowse=Select item cms.ui.item_search.flatBrowse=Select item
cms.ui.category.undeletable= cms.ui.category.undeletable=This category can't be deleted.
cms.ui.item_search.flat.filter.submit= cms.ui.item_search.flat.filter.submit=Filter
cms.ui.item_search.selected= cms.ui.item_search.selected=Selected content item (id)
cms.ui.item_search.create= cms.ui.item_search.create=Create new
cms.ui.item_search.create.folder_select= cms.ui.item_search.create.folder_select=Select folder
cms.ui.image_library=Image Library cms.ui.image_library=Image Library
cms.ui.image_upload=Upload Image cms.ui.image_upload=Upload Image
cms.ui.images=Images cms.ui.images=Images
cms.ui.search.create.select_close= cms.ui.search.create.select_close=Select item and close
cms.ui.search.create.select_edit= cms.ui.search.create.select_edit=Select item and edit
cms.ui.clear= cms.ui.clear=
cms.ui.item_search.create.folder_missing= cms.ui.item_search.create.folder_missing=No folder selected
cms.ui.images_links= cms.ui.images_links=
cms.contenttypes.ui.person.alias.delete.label= cms.contenttypes.ui.person.alias.delete.label=Delete
cms.ui.contentcenter.mainpage.search= cms.ui.contentcenter.mainpage.search=
cms.ui.contentcenter.mainpage.taskssections= cms.ui.contentcenter.mainpage.taskssections=
cms.ui.contentcenter.section= cms.ui.contentcenter.section=
cms.ui.contentcenter.action= cms.ui.contentcenter.action=
cms.ui.set_home_folder= cms.ui.set_home_folder=Set as home folder
cms.ui.go_to_home_folder= cms.ui.go_to_home_folder=
cms.ui.no_home_folder_selected= cms.ui.no_home_folder_selected=No home folder selected

View File

@ -86,6 +86,7 @@ public class BrowsePane extends LayoutPanel implements Resettable {
(new SubmissionListener()); (new SubmissionListener());
} }
@Override
public final void register(Page page) { public final void register(Page page) {
super.register(page); super.register(page);
@ -93,6 +94,7 @@ public class BrowsePane extends LayoutPanel implements Resettable {
page.addActionListener(new TreeListener()); page.addActionListener(new TreeListener());
} }
@Override
public final void reset(PageState state) { public final void reset(PageState state) {
super.reset(state); super.reset(state);

View File

@ -143,30 +143,50 @@ public class MainPage extends CMSApplicationPage implements ActionListener {
* or to add additional tabs after the default CMS tabs are added. * or to add additional tabs after the default CMS tabs are added.
**/ **/
protected TabbedPane createTabbedPane() { protected TabbedPane createTabbedPane() {
TabbedPane pane = new TabbedPane(); TabbedPane tabbedPane = new TabbedPane();
pane.setClassAttr(XSL_CLASS); tabbedPane.setClassAttr(XSL_CLASS);
//addToPane(pane, "Tasks/Sections", getTasksPane(m_typeSel, m_sectionSel)); Label taskLabel = new Label(GlobalizationUtil
//addToPane(pane, "Search", getSearchPane()); .globalize("cms.ui.contentcenter.mainpage.taskssections"));
addToPane(pane, Label searchLabel = new Label(GlobalizationUtil
(String)GlobalizationUtil.globalize("cms.ui.contentcenter.mainpage.taskssections").localize(), .globalize("cms.ui.contentcenter.mainpage.search"));
addToPane(tabbedPane,
taskLabel,
getTasksPane(m_typeSel, m_sectionSel)); getTasksPane(m_typeSel, m_sectionSel));
addToPane(pane, addToPane(tabbedPane,
(String)GlobalizationUtil.globalize("cms.ui.contentcenter.mainpage.search").localize(), // searchLabel,
new Label(GlobalizationUtil.globalize(
"cms.ui.contentcenter.mainpage.search")),
getSearchPane()); getSearchPane());
pane.addActionListener(this); tabbedPane.addActionListener(this);
return pane; return tabbedPane;
} }
// /**
// * Adds the specified component, with the specified tab name, to the
// * tabbed pane only if it is not null.
// *
// * @param pane The pane to which to add the tab
// * @param tabName The name of the tab if it's added
// * @param comp The component to add to the pane
// * @deprecated refactor to use addToPane(Label, Component) instead to
// * enable localized tab strips.
// */
// protected void addToPane(TabbedPane pane, String tabName, Component comp) {
// if (comp != null) {
// pane.addTab(tabName, comp);
// }
// }
/** /**
* Adds the specified component, with the specified tab name, to the * Adds the specified component, with the specified Label as tab name,
* tabbed pane only if it is not null. * to the tabbed pane only if it is not null.
* *
* @param pane The pane to which to add the tab * @param pane The pane to which to add the tab
* @param tabName The name of the tab if it's added * @param tabName The name of the tab if it's added
* @param comp The component to add to the pane * @param comp The component to add to the pane
**/ */
protected void addToPane(TabbedPane pane, String tabName, Component comp) { protected void addToPane(TabbedPane pane, Label tabName, Component comp) {
if (comp != null) { if (comp != null) {
pane.addTab(tabName, comp); pane.addTab(tabName, comp);
} }

View File

@ -250,7 +250,8 @@ public class MainPage extends CMSApplicationPage implements ActionListener {
if (m_searchPane == null) { if (m_searchPane == null) {
m_searchPane = new LayoutPanel(); m_searchPane = new LayoutPanel();
m_searchPane.setLeft(new SimpleComponent()); m_searchPane.setLeft(new SimpleComponent());
m_searchPane.setBody(new ItemSearch(ContentItem.DRAFT, CMS.getConfig().limitToContentSection())); m_searchPane.setBody(new ItemSearch(ContentItem.DRAFT,
CMS.getConfig().limitToContentSection()));
} }
return m_searchPane; return m_searchPane;
} }
@ -356,6 +357,12 @@ public class MainPage extends CMSApplicationPage implements ActionListener {
} }
} }
/**
*
* @param pane
* @param key
* @param tab
*/
private void tab(final TabbedPane pane, private void tab(final TabbedPane pane,
final String key, final String key,
final Component tab) { final Component tab) {

View File

@ -31,31 +31,45 @@ import com.arsdigita.globalization.GlobalizedMessage;
*/ */
public class GlobalizationUtil { public class GlobalizationUtil {
/** */ /** Name of the Java class to handle CMS's globalisation. */
// public static String s_bundleName = // public static String s_bundleName =
// "com.arsdigita.cms.util.CMSResourceBundle"; // "com.arsdigita.cms.util.CMSResourceBundle";
public static String s_bundleName = public static String s_bundleName =
"com.arsdigita.cms.CMSResources"; "com.arsdigita.cms.CMSResources";
public static GlobalizedMessage globalize(String key) { /**
return new GlobalizedMessage(key, getBundleName()); * This returns a globalized message using the package specific bundle,
} * provided by method getBundleName()
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, getBundleName());
}
public static GlobalizedMessage globalize(String key, Object[] args) { /**
return new GlobalizedMessage(key, getBundleName(), args); * Returns a globalized message object, using the package specific bundle,
} * provided by method getBundleName(). Also takes in an Object[] of
* arguments to interpolate into the retrieved message using the
* MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, getBundleName(), args);
}
public static String getBundleName() { /**
return s_bundleName; * Returns the name of the package specific resource bundle.
} * @return
*/
public static String getBundleName() {
return s_bundleName;
}
/* /*
* Not a part of API. Otherwise it would need to be properly synchronized. * Not a part of API. Otherwise it would need to be properly synchronized.
* Only meant be used to override resource keys in CMSResources * Only meant be used to override resource keys in CMSResources
* by a custom application, in Initializer. * by a custom application, in Initializer.
*/ */
public static void internalSetBundleName(String bundleName) { public static void internalSetBundleName(String bundleName) {
s_bundleName = bundleName; s_bundleName = bundleName;
} }
} }

View File

@ -18,21 +18,18 @@
*/ */
package com.arsdigita.bebop; package com.arsdigita.bebop;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import java.io.IOException;
import javax.servlet.ServletException;
import com.arsdigita.bebop.parameters.IntegerParameter; import com.arsdigita.bebop.parameters.IntegerParameter;
import com.arsdigita.util.Assert; import com.arsdigita.util.Assert;
import com.arsdigita.bebop.event.ActionEvent; import com.arsdigita.bebop.event.ActionEvent;
import com.arsdigita.bebop.event.ActionListener; import com.arsdigita.bebop.event.ActionListener;
import com.arsdigita.xml.Element; import com.arsdigita.xml.Element;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import javax.servlet.ServletException;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/* FIXME: Add methods for using images in the tab strip */ /* FIXME: Add methods for using images in the tab strip */

View File

@ -18,32 +18,30 @@
*/ */
package com.arsdigita.globalization; package com.arsdigita.globalization;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.ResourceBundle;
import java.util.PropertyResourceBundle;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Enumeration; import java.util.PropertyResourceBundle;
import java.util.ArrayList; import java.util.ResourceBundle;
import java.util.Collections;
import java.util.Iterator;
/** /**
* This is a ResourceBundle that allows the developer to add additional * This is a ResourceBundle that allows the developer to add additional
* ChainableResourceBundles to it. Then, when the bundle is asked for * ChainableResourceBundles to it. Then, when the bundle is asked for
* a key, it checks the ChainableResourceBundles in the order that they * a key, it checks the ChainableResourceBundles in the order that they
* were added. A typical use would be something like this * were added. A typical use would be something like this
* <pre><code> * <pre><code>
* public class EventResourceBundle extends ChainedResourceBundle { * public class EventResourceBundle extends ChainedResourceBundle {
* public EventResourceBundle() { * public EventResourceBundle() {
* super(); * super();
* addBundle((PropertyResourceBundle)getBundle("EVENT_BUNDLE_NAME")); * addBundle((PropertyResourceBundle)getBundle("EVENT_BUNDLE_NAME"));
* addBundle((PropertyResourceBundle)getBundle("DEFAULT_BUNDLE_NAME")); * addBundle((PropertyResourceBundle)getBundle("DEFAULT_BUNDLE_NAME"));
* } * }
* } * }
* * </code></pre>
* </code></pre> */
**/
public class ChainedResourceBundle extends ResourceBundle { public class ChainedResourceBundle extends ResourceBundle {
private List m_bundles; private List m_bundles;
@ -92,7 +90,7 @@ public class ChainedResourceBundle extends ResourceBundle {
} }
private void putBundle(ChainableResourceBundle bundle) { private void putBundle(ChainableResourceBundle bundle) {
m_bundles.add(0,bundle); m_bundles.add(0,bundle);
Enumeration enu = bundle.getKeys(); Enumeration enu = bundle.getKeys();
List bundleKeys = new LinkedList(); List bundleKeys = new LinkedList();
while (enu.hasMoreElements()) { while (enu.hasMoreElements()) {
@ -129,7 +127,8 @@ public class ChainedResourceBundle extends ResourceBundle {
* an internal PropertyResourceBundle. * an internal PropertyResourceBundle.
*/ */
private class ChainablePropertyResourceBundle private class ChainablePropertyResourceBundle
implements ChainableResourceBundle { implements ChainableResourceBundle {
private PropertyResourceBundle m_wrappedBundle = null; private PropertyResourceBundle m_wrappedBundle = null;
/** /**
@ -159,7 +158,8 @@ public class ChainedResourceBundle extends ResourceBundle {
* an internal PropertyResourceBundle. * an internal PropertyResourceBundle.
*/ */
private class ChainableListResourceBundle private class ChainableListResourceBundle
implements ChainableResourceBundle { implements ChainableResourceBundle {
private ListResourceBundle m_wrappedBundle = null; private ListResourceBundle m_wrappedBundle = null;
/** /**

View File

@ -16,153 +16,178 @@ import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.kernel.Group; import com.arsdigita.kernel.Group;
import com.arsdigita.ui.admin.GroupAdministrationTab;
/** /**
* Series of screens required for adding existing groups as subgroups - * Series of screens required for adding existing groups as subgroups -
* based on existing functionality for adding permissions to a folder in content/admin * based on existing functionality for adding permissions to a folder in
* @version $Id: ExistingGroupAddPane.java,v 1.4 2004/06/21 11:34:03 cgyg9330 Exp $ by $Author: cgyg9330 $ * content/admin
* @version $Id: ExistingGroupAddPane.java,v 1.4 2004/06/21 11:34:03 cgyg9330 Exp $
*/ */
public class ExistingGroupAddPane extends SimpleContainer implements AdminConstants { public class ExistingGroupAddPane extends SimpleContainer implements AdminConstants {
private static final Logger s_log = Logger.getLogger(ExistingGroupAddPane.class); private static final Logger s_log = Logger.getLogger(ExistingGroupAddPane.class);
private ParameterModel searchString = new StringParameter(SEARCH_QUERY); private ParameterModel searchString = new StringParameter(SEARCH_QUERY);
private GroupSearchForm groupSearchForm; private GroupSearchForm groupSearchForm;
private SimpleContainer selectGroupsPanel; private SimpleContainer selectGroupsPanel;
private SimpleContainer noResultsPanel; private SimpleContainer noResultsPanel;
private Tree groupTree; private Tree groupTree;
private GroupAdministrationTab parentPage; private GroupAdministrationTab parentPage;
private RequestLocal parentGroup = new RequestLocal() { /**
protected Object initialValue(PageState ps) { *
String key = (String) groupTree.getSelectedKey(ps); */
private RequestLocal parentGroup = new RequestLocal() {
@Override
protected Object initialValue(PageState ps) {
String key = (String) groupTree.getSelectedKey(ps);
Group group = null; Group group = null;
if (key != null) { if (key != null) {
BigDecimal id = new BigDecimal(key); BigDecimal id = new BigDecimal(key);
try { try {
group = new Group(id); group = new Group(id);
} catch (DataObjectNotFoundException exc) { } catch (DataObjectNotFoundException exc) {
// Silently ignore if group does not // Silently ignore if group does not
// exist. // exist.
} }
} }
return group; return group;
} }
}; };
public ExistingGroupAddPane(Tree groupTree, GroupAdministrationTab parentPage) { /**
this.groupTree = groupTree; * Constructor.
this.parentPage = parentPage; * @param groupTree
* @param parentPage
} */
public ExistingGroupAddPane(Tree groupTree, GroupAdministrationTab parentPage) {
this.groupTree = groupTree;
this.parentPage = parentPage;
}
public void register(Page p) { /**
super.register(p); *
add(getGroupSearchForm()); * @param p
add(getSelectGroupsPanel()); */
add(getNoSearchResultPanel()); @Override
public void register(Page p) {
super.register(p);
add(getGroupSearchForm());
add(getSelectGroupsPanel());
add(getNoSearchResultPanel());
// set initial visibility of components // set initial visibility of components
p.setVisibleDefault(getGroupSearchForm(), true); p.setVisibleDefault(getGroupSearchForm(), true);
p.setVisibleDefault(getSelectGroupsPanel(), false); p.setVisibleDefault(getSelectGroupsPanel(), false);
p.setVisibleDefault(getNoSearchResultPanel(),false); p.setVisibleDefault(getNoSearchResultPanel(),false);
p.addGlobalStateParam(searchString); p.addGlobalStateParam(searchString);
} }
/**
*
* @return
*/
public GroupSearchForm getGroupSearchForm() {
if (groupSearchForm==null) {
groupSearchForm = new GroupSearchForm(this);
}
return groupSearchForm;
}
/**
* Returns a panel with a set of checkboxes for groups
* fulfilling search criteria
*/
public SimpleContainer getSelectGroupsPanel() {
if (selectGroupsPanel==null) {
SelectGroups selectGroups = new SelectGroups(this, getGroupSearchForm());
selectGroupsPanel = selectGroups.getPanel();
}
return selectGroupsPanel;
}
/**
* Returns a bebop panel indicating that the user search
* yielded no results.
*/
public SimpleContainer getNoSearchResultPanel() {
if (noResultsPanel==null) {
Label errorMsg = GROUP_NO_RESULTS;
errorMsg.setClassAttr("errorBullet");
BoxPanel bp = new BoxPanel();
bp.add(errorMsg);
bp.add(new GroupSearchForm(this));
noResultsPanel = new SegmentedPanel().addSegment(new Label(" "),bp);
}
return noResultsPanel;
}
public GroupSearchForm getGroupSearchForm() { /**
if (groupSearchForm==null) { * Shows panel with no results to user search.
groupSearchForm = new GroupSearchForm(this); */
} public void showNoResults(PageState s) {
return groupSearchForm; getGroupSearchForm().setVisible(s, false);
} getSelectGroupsPanel().setVisible(s,false);
getNoSearchResultPanel().setVisible(s, true);
}
/** /**
* Returns a panel with a set of checkboxes for groups * Show the select groups to add as subgroups panel
* fulfilling search criteria */
*/ public void showGroups(PageState s) {
public SimpleContainer getSelectGroupsPanel() { getGroupSearchForm().setVisible(s, false);
if (selectGroupsPanel==null) { getSelectGroupsPanel().setVisible(s,true);
SelectGroups selectGroups = new SelectGroups(this, getGroupSearchForm()); getNoSearchResultPanel().setVisible(s, false);
selectGroupsPanel = selectGroups.getPanel(); }
}
return selectGroupsPanel;
}
/**
*
* show the search form
*/
public void showSearch(PageState s) {
getGroupSearchForm().setVisible(s, true);
getSelectGroupsPanel().setVisible(s,false);
getNoSearchResultPanel().setVisible(s, false);
}
/** /**
* Returns a bebop panel indicating that the user search *
* yielded no results. * @return
*/ */
public ParameterModel getSearchString() {
return searchString;
}
public SimpleContainer getNoSearchResultPanel() { /**
if (noResultsPanel==null) { *
Label errorMsg = GROUP_NO_RESULTS; * @return
errorMsg.setClassAttr("errorBullet"); */
BoxPanel bp = new BoxPanel(); public GroupAdministrationTab getParentPage() {
bp.add(errorMsg); return parentPage;
bp.add(new GroupSearchForm(this)); }
noResultsPanel = new SegmentedPanel().addSegment(new Label(" "),bp);
}
return noResultsPanel;
}
/**
* Shows panel with no results to user search.
*/
public void showNoResults(PageState s) {
getGroupSearchForm().setVisible(s, false);
getSelectGroupsPanel().setVisible(s,false);
getNoSearchResultPanel().setVisible(s, true);
}
/**
* Show the select groups to add as subgroups panel
*/
public void showGroups(PageState s) {
getGroupSearchForm().setVisible(s, false);
getSelectGroupsPanel().setVisible(s,true);
getNoSearchResultPanel().setVisible(s, false);
}
/**
*
* show the search form
*/
public void showSearch(PageState s) {
getGroupSearchForm().setVisible(s, true);
getSelectGroupsPanel().setVisible(s,false);
getNoSearchResultPanel().setVisible(s, false);
}
public ParameterModel getSearchString() {
return searchString;
}
public GroupAdministrationTab getParentPage() {
return parentPage;
}
public Group getParentGroup(PageState ps) {
return (Group) parentGroup.get(ps);
}
/**
*
* @param ps
* @return
*/
public Group getParentGroup(PageState ps) {
return (Group) parentGroup.get(ps);
}
} }

View File

@ -74,7 +74,6 @@ class GroupAddForm extends GroupForm implements AdminConstants,
// Parent group does not exist. // Parent group does not exist.
// This is normal behavior with the new group // This is normal behavior with the new group
// been add with no parent. // been add with no parent.
} }
} }

View File

@ -394,6 +394,7 @@ class GroupAdministrationTab extends BoxPanel
private Component buildMemberListPanel(SegmentedPanel main) { private Component buildMemberListPanel(SegmentedPanel main) {
BoxPanel body = new BoxPanel() { BoxPanel body = new BoxPanel() {
@Override
public void register(Page p) { public void register(Page p) {
p.setVisibleDefault(m_subMemberSearch, false); p.setVisibleDefault(m_subMemberSearch, false);
} }