Hinweistext für die Suche eingefügt

git-svn-id: https://svn.libreccm.org/ccm/trunk@2435 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2013-11-14 10:07:04 +00:00
parent d3805612d3
commit 35647b1d2b
4 changed files with 306 additions and 310 deletions

View File

@ -64,72 +64,56 @@ import org.apache.log4j.Logger;
*/ */
public class ContentSectionPage extends CMSPage implements ActionListener { public class ContentSectionPage extends CMSPage implements ActionListener {
private static final Logger s_log = Logger.getLogger private static final Logger s_log = Logger.getLogger(ContentSectionPage.class);
(ContentSectionPage.class);
public static final String RESOURCE_BUNDLE = public static final String RESOURCE_BUNDLE =
"com.arsdigita.cms.CMSResources"; "com.arsdigita.cms.CMSResources";
/** /**
* The URL parameter that can be passed in in order to set the * The URL parameter that can be passed in in order to set the current
* current folder. This is used in getting back to the correct * folder. This is used in getting back to the correct level of folder
* level of folder expansion from content item page. * expansion from content item page.
*/ */
public static final String SET_FOLDER = "set_folder"; public static final String SET_FOLDER = "set_folder";
/** /**
* The URL parameter that can be passed in in order to set the * The URL parameter that can be passed in in order to set the current
* current template (for setting the content type) * template (for setting the content type)
*/ */
public static final String SET_TEMPLATE = "set_template"; public static final String SET_TEMPLATE = "set_template";
/** /**
* The URL parameter that can be passed in in order to set the * The URL parameter that can be passed in in order to set the current tab.
* current tab. This is a KLUDGE right now because the * This is a KLUDGE right now because the TabbedDialog's current tab is
* TabbedDialog's current tab is selected with a local state * selected with a local state parameter.
* parameter.
*/ */
public static final String SET_TAB = "set_tab"; public static final String SET_TAB = "set_tab";
/** /**
* Index of the search tab * Index of the search tab
*/ */
public static final int SEARCH_TAB = 0; public static final int SEARCH_TAB = 0;
/** /**
* Index of the browse tab * Index of the browse tab
*/ */
public static final int BROWSE_TAB = 1; public static final int BROWSE_TAB = 1;
/** /**
* Index of the roles tab * Index of the roles tab
*/ */
public static final int ROLES_TAB = 2; public static final int ROLES_TAB = 2;
/** /**
* Index of the workflows tab * Index of the workflows tab
*/ */
public static final int WORKFLOW_TAB = 3; public static final int WORKFLOW_TAB = 3;
/** /**
* Index of the lifecycles tab * Index of the lifecycles tab
*/ */
public static final int LIFECYCLES_TAB = 4; public static final int LIFECYCLES_TAB = 4;
/** /**
* Index of the categories tab * Index of the categories tab
*/ */
public static final int CATEGORIES_TAB = 5; public static final int CATEGORIES_TAB = 5;
/** /**
* Index of the content types tab * Index of the content types tab
*/ */
public static final int CONTENTTYPES_TAB = 6; public static final int CONTENTTYPES_TAB = 6;
public static final int USER_ADMIN_TAB = 7; public static final int USER_ADMIN_TAB = 7;
private TabbedPane m_tabbedPane; private TabbedPane m_tabbedPane;
private FolderAdminPane m_folderPane; private FolderAdminPane m_folderPane;
private BrowsePane m_browsePane; private BrowsePane m_browsePane;
private ItemSearch m_searchPane; private ItemSearch m_searchPane;
@ -144,6 +128,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
private ReportPane m_reportPane; private ReportPane m_reportPane;
private static class TitlePrinter implements PrintListener { private static class TitlePrinter implements PrintListener {
@Override
public void prepare(PrintEvent e) { public void prepare(PrintEvent e) {
final Label l = (Label) e.getTarget(); final Label l = (Label) e.getTarget();
@ -183,15 +169,14 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
add(m_tabbedPane); add(m_tabbedPane);
addActionListener(new ActionListener() { addActionListener(new ActionListener() {
@Override
public final void actionPerformed(ActionEvent e) { public final void actionPerformed(ActionEvent e) {
final PageState state = e.getPageState(); final PageState state = e.getPageState();
final String tab = state.getRequest().getParameter final String tab = state.getRequest().getParameter(SET_TAB);
(SET_TAB);
if (tab != null) { if (tab != null) {
m_tabbedPane.setSelectedIndex m_tabbedPane.setSelectedIndex(state, Integer.valueOf(tab).intValue());
(state, Integer.valueOf(tab).intValue());
} }
SecurityManager sm = CMS.getContext().getSecurityManager(); SecurityManager sm = CMS.getContext().getSecurityManager();
@ -215,8 +200,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the browse pane. Overriding this * Creates, and then caches, the browse pane. Overriding this method to
* method to return null will prevent this tab from appearing. * return null will prevent this tab from appearing.
*/ */
protected FolderAdminPane getFolderAdminPane() { protected FolderAdminPane getFolderAdminPane() {
if (m_folderPane == null) { if (m_folderPane == null) {
@ -226,8 +211,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the browse pane. Overriding this * Creates, and then caches, the browse pane. Overriding this method to
* method to return null will prevent this tab from appearing. * return null will prevent this tab from appearing.
*/ */
protected BrowsePane getBrowsePane() { protected BrowsePane getBrowsePane() {
if (m_browsePane == null) { if (m_browsePane == null) {
@ -237,8 +222,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the search pane. Overriding this * Creates, and then caches, the search pane. Overriding this method to
* method to return null will prevent this tab from appearing. * return null will prevent this tab from appearing.
*/ */
protected ItemSearch getSearchPane() { protected ItemSearch getSearchPane() {
if (m_searchPane == null) { if (m_searchPane == null) {
@ -262,9 +247,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the workflow administration * Creates, and then caches, the workflow administration pane. Overriding
* pane. Overriding this method to return null will prevent this * this method to return null will prevent this tab from appearing.
* tab from appearing.
*/ */
protected WorkflowAdminPane getWorkflowAdminPane() { protected WorkflowAdminPane getWorkflowAdminPane() {
if (m_workflowPane == null) { if (m_workflowPane == null) {
@ -274,9 +258,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the lifecycle administration * Creates, and then caches, the lifecycle administration pane. Overriding
* pane. Overriding this method to return null will prevent this tab * this method to return null will prevent this tab from appearing.
* from appearing.
*/ */
protected LifecycleAdminPane getLifecycleAdminPane() { protected LifecycleAdminPane getLifecycleAdminPane() {
if (m_lifecyclePane == null) { if (m_lifecyclePane == null) {
@ -286,9 +269,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the category administration * Creates, and then caches, the category administration pane. Overriding
* pane. Overriding this method to return null will prevent this tab * this method to return null will prevent this tab from appearing.
* from appearing.
*/ */
protected CategoryAdminPane getCategoryAdminPane() { protected CategoryAdminPane getCategoryAdminPane() {
if (m_categoryPane == null) { if (m_categoryPane == null) {
@ -298,9 +280,9 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the content type administration * Creates, and then caches, the content type administration pane.
* pane. Overriding this method to return null will prevent this * Overriding this method to return null will prevent this tab from
* tab from appearing. * appearing.
*/ */
protected ContentTypeAdminPane getContentTypeAdminPane() { protected ContentTypeAdminPane getContentTypeAdminPane() {
if (m_typePane == null) { if (m_typePane == null) {
@ -335,8 +317,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Adds the specified component, with the specified tab name, to * Adds the specified component, with the specified tab name, to the tabbed
* the tabbed pane only if it is not null. * 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
@ -357,15 +339,14 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* <p>Created the TabbedPane to use for this page. Adds the tabs * <p>Created the TabbedPane to use for this page. Adds the tabs to the
* to the pane. The default implementation uses a {@link * pane. The default implementation uses a {@link
* com.arsdigita.bebop.TabbedPane}. This implementation also adds * com.arsdigita.bebop.TabbedPane}. This implementation also adds browse,
* browse, search, staff admin, viewers admin, workflow admin, * search, staff admin, viewers admin, workflow admin, category admin, and
* category admin, and content type panes.</p> * content type panes.</p>
* *
* <p>Developers can override this method to add only the tabs * <p>Developers can override this method to add only the tabs they want, or
* they want, or to add additional tabs after the default CMS tabs * to add additional tabs after the default CMS tabs are added.</p>
* are added.</p>
*/ */
protected TabbedPane createTabbedPane() { protected TabbedPane createTabbedPane() {
final TabbedPane pane = new TabbedPane(); final TabbedPane pane = new TabbedPane();
@ -392,6 +373,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
* @param request The HTTP request * @param request The HTTP request
* @return The current content section * @return The current content section
*/ */
@Override
public ContentSection getContentSection(HttpServletRequest request) { public ContentSection getContentSection(HttpServletRequest request) {
// Resets all content sections associations. // Resets all content sections associations.
ContentSection section = super.getContentSection(request); ContentSection section = super.getContentSection(request);
@ -400,11 +382,12 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* When a new tab is selected, reset the state of the * When a new tab is selected, reset the state of the formerly-selected
* formerly-selected pane. * pane.
* *
* @param event The event fired by selecting a tab * @param event The event fired by selecting a tab
*/ */
@Override
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
final PageState state = event.getPageState(); final PageState state = event.getPageState();
@ -443,12 +426,10 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
*/ */
public static String getSectionURL(ContentItem item, int tab) { public static String getSectionURL(ContentItem item, int tab) {
// Get the content section associated with the content item. // Get the content section associated with the content item.
ContentSection section = null; ContentSection section = ContentSection.getContentSection(item);
section = ContentSection.getContentSection(item); String url = section.getURL() + PageLocations.SECTION_PAGE
+ "?" + SET_TAB + "=" + tab;
String url = section.getURL() + PageLocations.SECTION_PAGE +
"?" + SET_TAB + "=" + tab;
return url; return url;
} }

View File

@ -65,12 +65,14 @@ public class ImageLibraryComponent extends SimpleContainer
m_chooser = new ImageChooser(ContentItem.DRAFT, m_mode); m_chooser = new ImageChooser(ContentItem.DRAFT, m_mode);
m_chooser.addImageActionListener(new ImageBrowser.LinkActionListener() { m_chooser.addImageActionListener(new ImageBrowser.LinkActionListener() {
@Override
public void deleteClicked(final PageState state, final BigDecimal imageID) { public void deleteClicked(final PageState state, final BigDecimal imageID) {
ImagesPane.S_LOG.debug("Clicked delete"); ImagesPane.S_LOG.debug("Clicked delete");
final ReusableImageAsset image = new ReusableImageAsset(imageID); final ReusableImageAsset image = new ReusableImageAsset(imageID);
image.delete(); image.delete();
} }
@Override
public void linkClicked(final PageState state, final BigDecimal imageID) { public void linkClicked(final PageState state, final BigDecimal imageID) {
ImagesPane.S_LOG.debug("Clicked select"); ImagesPane.S_LOG.debug("Clicked select");
try { try {
@ -137,6 +139,7 @@ public class ImageLibraryComponent extends SimpleContainer
} }
} }
@Override
public ReusableImageAsset getImage(final FormSectionEvent event) { public ReusableImageAsset getImage(final FormSectionEvent event) {
final PageState state = event.getPageState(); final PageState state = event.getPageState();
return (ReusableImageAsset) m_imageModel.getSelectedItem(state); return (ReusableImageAsset) m_imageModel.getSelectedItem(state);
@ -148,30 +151,36 @@ public class ImageLibraryComponent extends SimpleContainer
page.addComponentStateParam(this, m_imageID); page.addComponentStateParam(this, m_imageID);
} }
@Override
public String getCaption(final FormSectionEvent event) { public String getCaption(final FormSectionEvent event) {
final PageState state = event.getPageState(); final PageState state = event.getPageState();
return (String) m_caption.getValue(state); return (String) m_caption.getValue(state);
} }
@Override
public String getDescription(final FormSectionEvent event) { public String getDescription(final FormSectionEvent event) {
final PageState state = event.getPageState(); final PageState state = event.getPageState();
return (String) m_description.getValue(state); return (String) m_description.getValue(state);
} }
@Override
public String getTitle(final FormSectionEvent event) { public String getTitle(final FormSectionEvent event) {
final PageState state = event.getPageState(); final PageState state = event.getPageState();
return (String) m_title.getValue(state); return (String) m_title.getValue(state);
} }
@Override
public String getUseContext(final FormSectionEvent event) { public String getUseContext(final FormSectionEvent event) {
final PageState state = event.getPageState(); final PageState state = event.getPageState();
return (String) m_useContext.getValue(state); return (String) m_useContext.getValue(state);
} }
@Override
public Form getForm() { public Form getForm() {
return m_form; return m_form;
} }
@Override
public SaveCancelSection getSaveCancelSection() { public SaveCancelSection getSaveCancelSection() {
return m_saveCancel; return m_saveCancel;
} }
@ -195,6 +204,7 @@ public class ImageLibraryComponent extends SimpleContainer
/** /**
* Reset this component. * Reset this component.
*/ */
@Override
public void reset(final PageState state) { public void reset(final PageState state) {
// clear selection // clear selection
m_imageModel.clearSelection(state); m_imageModel.clearSelection(state);

View File

@ -57,8 +57,8 @@ public class ResultsPane extends SimpleComponent {
} }
/** /**
* Determines whether the links to the search results will be * Determines whether the links to the search results will be relative or
* relative or absolute. The default is absolute. * absolute. The default is absolute.
*/ */
public void setRelativeURLs(boolean relative) { public void setRelativeURLs(boolean relative) {
m_relative = relative; m_relative = relative;
@ -78,6 +78,11 @@ public class ResultsPane extends SimpleComponent {
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("No query available, skipping XMl generation"); s_log.debug("No query available, skipping XMl generation");
} }
Element content = Search.newElement("results");
Element info = content.newChildElement("info");
// info.setText(GlobalizationUtil.globalize("cms.ui.search_help").localize().toString());
info.setText("To search for content items, please enter at least 3 letters into the search field. You can narrow the result by using additional parameters.");
parent.addContent(content);
return; return;
} }