Hinweistext für die Suche eingefügt
git-svn-id: https://svn.libreccm.org/ccm/trunk@2435 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
d3805612d3
commit
35647b1d2b
|
|
@ -64,72 +64,56 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class ContentSectionPage extends CMSPage implements ActionListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger
|
||||
(ContentSectionPage.class);
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(ContentSectionPage.class);
|
||||
public static final String RESOURCE_BUNDLE =
|
||||
"com.arsdigita.cms.CMSResources";
|
||||
|
||||
/**
|
||||
* The URL parameter that can be passed in in order to set the
|
||||
* current folder. This is used in getting back to the correct
|
||||
* level of folder expansion from content item page.
|
||||
* The URL parameter that can be passed in in order to set the current
|
||||
* folder. This is used in getting back to the correct level of folder
|
||||
* expansion from content item page.
|
||||
*/
|
||||
public static final String SET_FOLDER = "set_folder";
|
||||
|
||||
/**
|
||||
* The URL parameter that can be passed in in order to set the
|
||||
* current template (for setting the content type)
|
||||
* The URL parameter that can be passed in in order to set the current
|
||||
* template (for setting the content type)
|
||||
*/
|
||||
public static final String SET_TEMPLATE = "set_template";
|
||||
|
||||
/**
|
||||
* The URL parameter that can be passed in in order to set the
|
||||
* current tab. This is a KLUDGE right now because the
|
||||
* TabbedDialog's current tab is selected with a local state
|
||||
* parameter.
|
||||
* The URL parameter that can be passed in in order to set the current tab.
|
||||
* This is a KLUDGE right now because the TabbedDialog's current tab is
|
||||
* selected with a local state parameter.
|
||||
*/
|
||||
public static final String SET_TAB = "set_tab";
|
||||
|
||||
/**
|
||||
* Index of the search tab
|
||||
*/
|
||||
public static final int SEARCH_TAB = 0;
|
||||
|
||||
/**
|
||||
* Index of the browse tab
|
||||
*/
|
||||
public static final int BROWSE_TAB = 1;
|
||||
|
||||
/**
|
||||
* Index of the roles tab
|
||||
*/
|
||||
public static final int ROLES_TAB = 2;
|
||||
|
||||
/**
|
||||
* Index of the workflows tab
|
||||
*/
|
||||
public static final int WORKFLOW_TAB = 3;
|
||||
|
||||
/**
|
||||
* Index of the lifecycles tab
|
||||
*/
|
||||
public static final int LIFECYCLES_TAB = 4;
|
||||
|
||||
/**
|
||||
* Index of the categories tab
|
||||
*/
|
||||
public static final int CATEGORIES_TAB = 5;
|
||||
|
||||
/**
|
||||
* Index of the content types tab
|
||||
*/
|
||||
public static final int CONTENTTYPES_TAB = 6;
|
||||
|
||||
public static final int USER_ADMIN_TAB = 7;
|
||||
|
||||
private TabbedPane m_tabbedPane;
|
||||
|
||||
private FolderAdminPane m_folderPane;
|
||||
private BrowsePane m_browsePane;
|
||||
private ItemSearch m_searchPane;
|
||||
|
|
@ -144,6 +128,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
private ReportPane m_reportPane;
|
||||
|
||||
private static class TitlePrinter implements PrintListener {
|
||||
|
||||
@Override
|
||||
public void prepare(PrintEvent e) {
|
||||
final Label l = (Label) e.getTarget();
|
||||
|
||||
|
|
@ -183,15 +169,14 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
add(m_tabbedPane);
|
||||
|
||||
addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public final void actionPerformed(ActionEvent e) {
|
||||
final PageState state = e.getPageState();
|
||||
|
||||
final String tab = state.getRequest().getParameter
|
||||
(SET_TAB);
|
||||
final String tab = state.getRequest().getParameter(SET_TAB);
|
||||
|
||||
if (tab != null) {
|
||||
m_tabbedPane.setSelectedIndex
|
||||
(state, Integer.valueOf(tab).intValue());
|
||||
m_tabbedPane.setSelectedIndex(state, Integer.valueOf(tab).intValue());
|
||||
}
|
||||
|
||||
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
|
||||
* method to return null will prevent this tab from appearing.
|
||||
* Creates, and then caches, the browse pane. Overriding this method to
|
||||
* return null will prevent this tab from appearing.
|
||||
*/
|
||||
protected FolderAdminPane getFolderAdminPane() {
|
||||
if (m_folderPane == null) {
|
||||
|
|
@ -226,8 +211,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates, and then caches, the browse pane. Overriding this
|
||||
* method to return null will prevent this tab from appearing.
|
||||
* Creates, and then caches, the browse pane. Overriding this method to
|
||||
* return null will prevent this tab from appearing.
|
||||
*/
|
||||
protected BrowsePane getBrowsePane() {
|
||||
if (m_browsePane == null) {
|
||||
|
|
@ -237,8 +222,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates, and then caches, the search pane. Overriding this
|
||||
* method to return null will prevent this tab from appearing.
|
||||
* Creates, and then caches, the search pane. Overriding this method to
|
||||
* return null will prevent this tab from appearing.
|
||||
*/
|
||||
protected ItemSearch getSearchPane() {
|
||||
if (m_searchPane == null) {
|
||||
|
|
@ -262,9 +247,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates, and then caches, the workflow administration
|
||||
* pane. Overriding this method to return null will prevent this
|
||||
* tab from appearing.
|
||||
* Creates, and then caches, the workflow administration pane. Overriding
|
||||
* this method to return null will prevent this tab from appearing.
|
||||
*/
|
||||
protected WorkflowAdminPane getWorkflowAdminPane() {
|
||||
if (m_workflowPane == null) {
|
||||
|
|
@ -274,9 +258,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates, and then caches, the lifecycle administration
|
||||
* pane. Overriding this method to return null will prevent this tab
|
||||
* from appearing.
|
||||
* Creates, and then caches, the lifecycle administration pane. Overriding
|
||||
* this method to return null will prevent this tab from appearing.
|
||||
*/
|
||||
protected LifecycleAdminPane getLifecycleAdminPane() {
|
||||
if (m_lifecyclePane == null) {
|
||||
|
|
@ -286,9 +269,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates, and then caches, the category administration
|
||||
* pane. Overriding this method to return null will prevent this tab
|
||||
* from appearing.
|
||||
* Creates, and then caches, the category administration pane. Overriding
|
||||
* this method to return null will prevent this tab from appearing.
|
||||
*/
|
||||
protected CategoryAdminPane getCategoryAdminPane() {
|
||||
if (m_categoryPane == null) {
|
||||
|
|
@ -298,9 +280,9 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates, and then caches, the content type administration
|
||||
* pane. Overriding this method to return null will prevent this
|
||||
* tab from appearing.
|
||||
* Creates, and then caches, the content type administration pane.
|
||||
* Overriding this method to return null will prevent this tab from
|
||||
* appearing.
|
||||
*/
|
||||
protected ContentTypeAdminPane getContentTypeAdminPane() {
|
||||
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
|
||||
* the tabbed pane only if it is not null.
|
||||
* 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
|
||||
|
|
@ -357,15 +339,14 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* <p>Created the TabbedPane to use for this page. Adds the tabs
|
||||
* to the pane. The default implementation uses a {@link
|
||||
* com.arsdigita.bebop.TabbedPane}. This implementation also adds
|
||||
* browse, search, staff admin, viewers admin, workflow admin,
|
||||
* category admin, and content type panes.</p>
|
||||
* <p>Created the TabbedPane to use for this page. Adds the tabs to the
|
||||
* pane. The default implementation uses a {@link
|
||||
* com.arsdigita.bebop.TabbedPane}. This implementation also adds browse,
|
||||
* search, staff admin, viewers admin, workflow admin, category admin, and
|
||||
* content type panes.</p>
|
||||
*
|
||||
* <p>Developers can override this method to add only the tabs
|
||||
* they want, or to add additional tabs after the default CMS tabs
|
||||
* are added.</p>
|
||||
* <p>Developers can override this method to add only the tabs they want, or
|
||||
* to add additional tabs after the default CMS tabs are added.</p>
|
||||
*/
|
||||
protected TabbedPane createTabbedPane() {
|
||||
final TabbedPane pane = new TabbedPane();
|
||||
|
|
@ -392,6 +373,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
* @param request The HTTP request
|
||||
* @return The current content section
|
||||
*/
|
||||
@Override
|
||||
public ContentSection getContentSection(HttpServletRequest request) {
|
||||
// Resets all content sections associations.
|
||||
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
|
||||
* formerly-selected pane.
|
||||
* When a new tab is selected, reset the state of the formerly-selected
|
||||
* pane.
|
||||
*
|
||||
* @param event The event fired by selecting a tab
|
||||
*/
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
final PageState state = event.getPageState();
|
||||
|
||||
|
|
@ -443,12 +426,10 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
|||
*/
|
||||
public static String getSectionURL(ContentItem item, int tab) {
|
||||
// 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,12 +65,14 @@ public class ImageLibraryComponent extends SimpleContainer
|
|||
m_chooser = new ImageChooser(ContentItem.DRAFT, m_mode);
|
||||
m_chooser.addImageActionListener(new ImageBrowser.LinkActionListener() {
|
||||
|
||||
@Override
|
||||
public void deleteClicked(final PageState state, final BigDecimal imageID) {
|
||||
ImagesPane.S_LOG.debug("Clicked delete");
|
||||
final ReusableImageAsset image = new ReusableImageAsset(imageID);
|
||||
image.delete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void linkClicked(final PageState state, final BigDecimal imageID) {
|
||||
ImagesPane.S_LOG.debug("Clicked select");
|
||||
try {
|
||||
|
|
@ -137,6 +139,7 @@ public class ImageLibraryComponent extends SimpleContainer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReusableImageAsset getImage(final FormSectionEvent event) {
|
||||
final PageState state = event.getPageState();
|
||||
return (ReusableImageAsset) m_imageModel.getSelectedItem(state);
|
||||
|
|
@ -148,30 +151,36 @@ public class ImageLibraryComponent extends SimpleContainer
|
|||
page.addComponentStateParam(this, m_imageID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCaption(final FormSectionEvent event) {
|
||||
final PageState state = event.getPageState();
|
||||
return (String) m_caption.getValue(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(final FormSectionEvent event) {
|
||||
final PageState state = event.getPageState();
|
||||
return (String) m_description.getValue(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle(final FormSectionEvent event) {
|
||||
final PageState state = event.getPageState();
|
||||
return (String) m_title.getValue(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUseContext(final FormSectionEvent event) {
|
||||
final PageState state = event.getPageState();
|
||||
return (String) m_useContext.getValue(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Form getForm() {
|
||||
return m_form;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaveCancelSection getSaveCancelSection() {
|
||||
return m_saveCancel;
|
||||
}
|
||||
|
|
@ -195,6 +204,7 @@ public class ImageLibraryComponent extends SimpleContainer
|
|||
/**
|
||||
* Reset this component.
|
||||
*/
|
||||
@Override
|
||||
public void reset(final PageState state) {
|
||||
// clear selection
|
||||
m_imageModel.clearSelection(state);
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ public class ResultsPane extends SimpleComponent {
|
|||
}
|
||||
|
||||
/**
|
||||
* Determines whether the links to the search results will be
|
||||
* relative or absolute. The default is absolute.
|
||||
* Determines whether the links to the search results will be relative or
|
||||
* absolute. The default is absolute.
|
||||
*/
|
||||
public void setRelativeURLs(boolean relative) {
|
||||
m_relative = relative;
|
||||
|
|
@ -78,6 +78,11 @@ public class ResultsPane extends SimpleComponent {
|
|||
if (s_log.isDebugEnabled()) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue