CCM NG/ccm-cms: ItemSearchPane now compiles (but will not work yet).

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4524 8810af33-2d31-482b-a856-94f89814c4df
jensp 2017-01-18 16:27:42 +00:00
parent 26015af797
commit eadab49265
4 changed files with 24 additions and 54 deletions

View File

@ -52,6 +52,7 @@ import org.arsdigita.cms.CMSConfig;
import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.security.PermissionChecker; import org.libreccm.security.PermissionChecker;
import org.librecms.CmsConstants; import org.librecms.CmsConstants;
import org.librecms.contentsection.ContentItemVersion;
import org.librecms.contentsection.privileges.AdminPrivileges; import org.librecms.contentsection.privileges.AdminPrivileges;
/** /**
@ -119,7 +120,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
private TabbedPane m_tabbedPane; private TabbedPane m_tabbedPane;
private FolderAdminPane m_folderPane; private FolderAdminPane m_folderPane;
//ToDo NG private BrowsePane m_browsePane; //ToDo NG private BrowsePane m_browsePane;
//ToDo NG private ItemSearch m_searchPane; private ItemSearch m_searchPane;
//ToDo NG private ImagesPane m_imagesPane; //ToDo NG private ImagesPane m_imagesPane;
private RoleAdminPane m_rolePane; private RoleAdminPane m_rolePane;
private WorkflowAdminPane m_workflowPane; private WorkflowAdminPane m_workflowPane;
@ -146,7 +147,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
// Initialize the individual panes // Initialize the individual panes
m_folderPane = getFolderAdminPane(); m_folderPane = getFolderAdminPane();
//ToDo NG m_browsePane = getBrowsePane(); //ToDo NG m_browsePane = getBrowsePane();
//ToDo NG m_searchPane = getSearchPane(); m_searchPane = getSearchPane();
//ToDo NG m_imagesPane = getImagesPane(); //ToDo NG m_imagesPane = getImagesPane();
m_rolePane = getRoleAdminPane(); m_rolePane = getRoleAdminPane();
m_workflowPane = getWorkflowAdminPane(); m_workflowPane = getWorkflowAdminPane();
@ -249,16 +250,15 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
* *
* @return * @return
*/ */
// ToDo NG protected ItemSearch getSearchPane() {
// protected ItemSearch getSearchPane() { if (m_searchPane == null) {
// if (m_searchPane == null) { m_searchPane
// m_searchPane = new ItemSearch(
// = new ItemSearch( ContentItemVersion.DRAFT.toString(),
// ContentItemVersion.DRAFT.toString(), CMSConfig.getConfig().isLimitItemSearchToContentSection());
// CMSConfig.getConfig().isLimitItemSearchToContentSection()); }
// } return m_searchPane;
// return m_searchPane; }
// }
// ToDo NG // ToDo NG
// protected ImagesPane getImagesPane() { // protected ImagesPane getImagesPane() {
// if (m_imagesPane == null) { // if (m_imagesPane == null) {
@ -266,6 +266,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
// } // }
// return m_imagesPane; // return m_imagesPane;
// } // }
protected RoleAdminPane getRoleAdminPane() { protected RoleAdminPane getRoleAdminPane() {
if (m_rolePane == null) { if (m_rolePane == null) {
m_rolePane = new RoleAdminPane(); m_rolePane = new RoleAdminPane();

View File

@ -22,9 +22,7 @@ import com.arsdigita.bebop.Form;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.Resettable; import com.arsdigita.bebop.Resettable;
import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.bebop.SimpleContainer;
import com.arsdigita.search.ui.QueryGenerator;
import org.apache.lucene.search.Query;
import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentItem;
/** /**
@ -34,7 +32,7 @@ import org.librecms.contentsection.ContentItem;
* @author Stanislav Freidin (sfreidin@arsdigita.com) * @author Stanislav Freidin (sfreidin@arsdigita.com)
* @author <a href="jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
public class ItemSearch extends Form implements Resettable, QueryGenerator { public class ItemSearch extends Form implements Resettable {
public static final String SINGLE_TYPE_PARAM = ItemSearchSection.SINGLE_TYPE_PARAM; public static final String SINGLE_TYPE_PARAM = ItemSearchSection.SINGLE_TYPE_PARAM;
@ -72,16 +70,6 @@ public class ItemSearch extends Form implements Resettable, QueryGenerator {
return new ItemSearchSection(context, limitToContentSection); return new ItemSearchSection(context, limitToContentSection);
} }
@Override
public boolean hasQuery(final PageState state) {
return itemSearchSection.hasQuery(state);
}
@Override
public Query getQuerySpecification(final PageState state) {
return itemSearchSection.getQuerySpecification(state);
}
@Override @Override
public void reset(final PageState state) { public void reset(final PageState state) {
itemSearchSection.reset(state); itemSearchSection.reset(state);

View File

@ -29,8 +29,10 @@ import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.parameters.BigDecimalParameter;
import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentItem;
import org.librecms.contentsection.ContentType; import org.librecms.contentsection.ContentType;
import com.arsdigita.cms.ui.search.ItemQueryComponent; import com.arsdigita.cms.ui.search.ItemQueryComponent;
import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.globalization.GlobalizedMessage;
@ -38,9 +40,6 @@ import com.arsdigita.search.ui.ResultsPane;
import com.arsdigita.search.ui.QueryGenerator; import com.arsdigita.search.ui.QueryGenerator;
import com.arsdigita.toolbox.ui.LayoutPanel; import com.arsdigita.toolbox.ui.LayoutPanel;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.lucene.search.Query;
import org.librecms.CmsConstants; import org.librecms.CmsConstants;
/** /**
@ -51,11 +50,8 @@ import org.librecms.CmsConstants;
* @author Stanislav Freidin (sfreidin@arsdigita.com) * @author Stanislav Freidin (sfreidin@arsdigita.com)
* @version $Id: ItemSearchSection.java 1940 2009-05-29 07:15:05Z terry $ * @version $Id: ItemSearchSection.java 1940 2009-05-29 07:15:05Z terry $
*/ */
public class ItemSearchSection extends FormSection implements Resettable, public class ItemSearchSection extends FormSection implements Resettable {
QueryGenerator {
private static final Logger LOGGER = LogManager.getLogger(
ItemSearchSection.class);
public static final String SINGLE_TYPE_PARAM = "single_type"; public static final String SINGLE_TYPE_PARAM = "single_type";
private ItemQueryComponent itemQueryComponent; private ItemQueryComponent itemQueryComponent;
@ -117,22 +113,13 @@ public class ItemSearchSection extends FormSection implements Resettable,
searchPanel.setBody(resultsComponent); searchPanel.setBody(resultsComponent);
this.add(searchPanel); this.add(searchPanel);
// addQueryGenerator(this); addQueryGenerator(this);
// addResultsPane(this); addResultsPane(this);
addFormListener(); addFormListener();
setClassAttr("itemSearch"); setClassAttr("itemSearch");
} }
@Override
public boolean hasQuery(final PageState state) {
return itemQueryComponent.hasQuery(state);
}
@Override
public Query getQuerySpecification(final PageState state) {
return itemQueryComponent.getQuerySpecification(state);
}
@Override @Override
public void reset(final PageState state) { public void reset(final PageState state) {

View File

@ -18,16 +18,12 @@
*/ */
package com.arsdigita.cms.ui.search; package com.arsdigita.cms.ui.search;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.form.Submit; import com.arsdigita.bebop.form.Submit;
import org.libreccm.categorization.Category;
import com.arsdigita.cms.CMS;
import org.librecms.contentsection.ContentSection;
import org.librecms.contentsection.ContentType; import org.librecms.contentsection.ContentType;
import com.arsdigita.cms.ui.ContentSectionPage; import com.arsdigita.cms.ui.ContentSectionPage;
import com.arsdigita.search.ui.BaseQueryComponent; import com.arsdigita.search.ui.BaseQueryComponent;
import java.util.ArrayList;
import java.util.List;
/** /**
* This class provides a basic query form for CMS admin pages that automatically * This class provides a basic query form for CMS admin pages that automatically
@ -52,6 +48,7 @@ public class ItemQueryComponent extends BaseQueryComponent {
final ContentType type) { final ContentType type) {
this.context = context; this.context = context;
//ToDo
// add(new PermissionFilterComponent( // add(new PermissionFilterComponent(
// SecurityManager.CMS_PREVIEW_ITEM)); // SecurityManager.CMS_PREVIEW_ITEM));
// //
@ -121,11 +118,8 @@ public class ItemQueryComponent extends BaseQueryComponent {
// CreationUserFilterType.KEY)); // CreationUserFilterType.KEY));
// add(new PartyFilterWidget(new LastModifiedUserFilterType(), // add(new PartyFilterWidget(new LastModifiedUserFilterType(),
// LastModifiedUserFilterType.KEY)); // LastModifiedUserFilterType.KEY));
Submit submit = new Submit(context + "_search",
ContentSectionPage.globalize("cms.ui.search"));
Submit submit =
new Submit(context + "_search",
ContentSectionPage.globalize("cms.ui.search"));
add(submit); add(submit);
} }