|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
typeahead functionalityRather than searching for documents (simple
or advanced), is there any pre-built capability in Nuxeo to support a type-ahead
interface, where document results are filtered based on a character string
keyed into an input field?
Thanks, Bruce. _______________________________________________ ECM mailing list ECM@... http://lists.nuxeo.com/mailman/listinfo/ecm To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm |
||||||||||
|
|
Re: typeahead functionalityThere is nothing built-in.
But it's relatively easy to add using a bit of Ajax and a Seam component, like we do for instance in the Rights management page to search for a user. Florent On Wed, Oct 14, 2009 at 4:57 PM, Bruce Grant <bgrant@...> wrote: > Rather than searching for documents (simple or advanced), is there any > pre-built capability in Nuxeo to support a type-ahead interface, where > document results are filtered based on a character string keyed into an > input field? -- Florent Guillaume, Head of R&D, Nuxeo Open Source, Java EE based, Enterprise Content Management (ECM) http://www.nuxeo.com http://www.nuxeo.org +33 1 40 33 79 87 _______________________________________________ ECM mailing list ECM@... http://lists.nuxeo.com/mailman/listinfo/ecm To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm |
||||||||||
|
|
Re: typeahead functionalityI thought Bruce was talking about kind of interface entirly based on search pattern where you have some filters on the left, looking for documents of that type, witht that word inside,,this topic .... If it is the question, it is easy to build such an interface maintaining a stateful querymodel edit through the widgets. Note that future DAM application will be based on such a pattern.
On Thu, Oct 15, 2009 at 1:19 PM, Florent Guillaume <fg@...> wrote: There is nothing built-in. _______________________________________________ ECM mailing list ECM@... http://lists.nuxeo.com/mailman/listinfo/ecm To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm |
||||||||||
|
|
Re: typeahead functionalityYes Alain, that is what interests me. It
emulates what is already a key part of other content management systems.
Is there any shareable example from the DAM source? Many thanks, Bruce.
I thought Bruce was talking about kind of interface entirly based on search pattern where you have some filters on the left, looking for documents of that type, witht that word inside,,this topic .... If it is the question, it is easy to build such an interface maintaining a stateful querymodel edit through the widgets. Note that future DAM application will be based on such a pattern. On Thu, Oct 15, 2009 at 1:19 PM, Florent Guillaume <fg@...> wrote: There is nothing built-in. But it's relatively easy to add using a bit of Ajax and a Seam component, like we do for instance in the Rights management page to search for a user. Florent On Wed, Oct 14, 2009 at 4:57 PM, Bruce Grant <bgrant@...> wrote: > Rather than searching for documents (simple or advanced), is there any > pre-built capability in Nuxeo to support a type-ahead interface, where > document results are filtered based on a character string keyed into an > input field? -- Florent Guillaume, Head of R&D, Nuxeo Open Source, Java EE based, Enterprise Content Management (ECM) http://www.nuxeo.com http://www.nuxeo.org +33 1 40 33 79 87 _______________________________________________ ECM mailing list ECM@... http://lists.nuxeo.com/mailman/listinfo/ecm To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm _______________________________________________ ECM mailing list ECM@... http://lists.nuxeo.com/mailman/listinfo/ecm To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm |
||||||||||
|
|
Re: typeahead functionalityactually, the virtual navigatin plugin is a good sample : see there how clicking on a tree node, you set the value of a query-model variable, thus modifying the display resultset. If you add more widgets to edit more parameters, it will also work.
On Thu, Oct 15, 2009 at 1:35 PM, Bruce Grant <bgrant@...> wrote: Yes Alain, that is what interests me. It emulates what is already a key part of other content management systems. Is there any shareable example from the DAM source? Many thanks, Bruce. _______________________________________________ ECM mailing list ECM@... http://lists.nuxeo.com/mailman/listinfo/ecm To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm |
||||||||||
|
|
Re: typeahead functionality2009/10/15 Bruce Grant <bgrant@...>
Yes Alain, that is what interests me. It emulates what is already a key part of other content management systems. Is there any shareable example from the DAM source? Many thanks, Bruce. This is a teaser: (see attached files). For the rest of the DAM source code you will have to wait for the public release (no official date scheduled yet though) :) This example heavily relies upon ajax4jsf and the stateful query models of nuxeo. -- Olivier [FilterActions.java] /* * (C) Copyright 2006-2009 Nuxeo SAS (http://nuxeo.com/) and contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 2.1 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl.html * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * Contributors: * Quentin Lamerand * * $Id$ */ package org.nuxeo.dam.webapp.filter; import static org.jboss.seam.ScopeType.CONVERSATION; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.faces.model.SelectItem; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Factory; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Observer; import org.jboss.seam.annotations.Scope; import org.jboss.seam.annotations.web.RequestParameter; import org.nuxeo.ecm.core.api.ClientException; import org.nuxeo.ecm.core.api.CoreSession; import org.nuxeo.ecm.core.api.DocumentModel; import org.nuxeo.ecm.core.api.PagedDocumentsProvider; import org.nuxeo.ecm.core.api.SortInfo; import org.nuxeo.ecm.core.search.api.client.querymodel.QueryModel; import org.nuxeo.ecm.core.search.api.client.querymodel.QueryModelService; import org.nuxeo.ecm.core.search.api.client.querymodel.descriptor.QueryModelDescriptor; import org.nuxeo.ecm.platform.ui.web.api.ResultsProviderFarm; import org.nuxeo.ecm.platform.ui.web.api.SortNotSupportedException; import org.nuxeo.ecm.platform.ui.web.pagination.ResultsProviderFarmUserException; import org.nuxeo.ecm.webapp.helpers.EventNames; import org.nuxeo.ecm.webapp.pagination.ResultsProvidersCache; import org.nuxeo.runtime.api.Framework; @Scope(CONVERSATION) @Name("filterActions") public class FilterActions implements Serializable, ResultsProviderFarm { private static final long serialVersionUID = 1L; @SuppressWarnings("unused") private static final Log log = LogFactory.getLog(FilterActions.class); public static final List<String> DAM_DOCUMENT_TYPES = Arrays.asList("File", "Picture", "Video", "Audio"); protected static final String QUERY_MODEL_NAME = "FILTERED_DOCUMENTS"; protected static final String DOCTYPE_FIELD_XPATH = "filter_query:ecm_primaryType"; @In(create = true, required = false) transient CoreSession documentManager; @In(create = true, required = false) transient ResultsProvidersCache resultsProvidersCache; @RequestParameter protected String docType; protected transient QueryModelService queryModelService; protected DocumentModel filterDocument; public DocumentModel getFilterDocument() throws ClientException { if (filterDocument == null) { QueryModelDescriptor descriptor; try { descriptor = getQueryModelDescriptor(QUERY_MODEL_NAME); } catch (Exception e) { throw new ClientException("Failed to get query model: " + QUERY_MODEL_NAME, e); } filterDocument = documentManager.createDocumentModel(descriptor .getDocType()); } return filterDocument; } @Factory(value = "docTypeSelectItems", scope = ScopeType.EVENT) public List<SelectItem> getDocTypeSelectItems() throws ClientException { DocumentModel filterDocument = getFilterDocument(); List<String> docTypeSelection = filterDocument.getProperty( DOCTYPE_FIELD_XPATH).getValue(List.class); List<SelectItem> items = new ArrayList<SelectItem>(); items.add(new SelectItem("All", "label.type.All", "", docTypeSelection .isEmpty())); for (String type : DAM_DOCUMENT_TYPES) { items.add(new SelectItem(type, "label.type." + type, "", docTypeSelection.contains(type))); } return items; } public void setFilterDocument(DocumentModel filterDocument) { this.filterDocument = filterDocument; } @SuppressWarnings("unchecked") public void toggleSelectDocType() throws ClientException { DocumentModel filterDocument = getFilterDocument(); List<String> previousSelection = filterDocument.getProperty( DOCTYPE_FIELD_XPATH).getValue(List.class); if ("All".equalsIgnoreCase(docType)) { previousSelection.clear(); } else { if (previousSelection.contains(docType)) { previousSelection.remove(docType); } else { previousSelection.add(docType); if (previousSelection.size() == DAM_DOCUMENT_TYPES.size()) { // back to empty selection which means no document type filtering: previousSelection.clear(); } } } filterDocument.setPropertyValue(DOCTYPE_FIELD_XPATH, (Serializable) previousSelection); invalidateProvider(); } public PagedDocumentsProvider getResultsProvider(String queryModelName) throws ClientException, ResultsProviderFarmUserException { try { return getResultsProvider(queryModelName, null); } catch (SortNotSupportedException e) { throw new ClientException("unexpected exception", e); } } public PagedDocumentsProvider getResultsProvider(String queryModelName, SortInfo sortInfo) throws ClientException, ResultsProviderFarmUserException { if (!QUERY_MODEL_NAME.equals(queryModelName)) { return null; } QueryModelDescriptor descriptor; try { descriptor = getQueryModelDescriptor(queryModelName); } catch (Exception e) { throw new ClientException("Failed to get query model: " + queryModelName, e); } QueryModel model = new QueryModel(descriptor, getFilterDocument()); if (!descriptor.isSortable() && sortInfo != null) { throw new SortNotSupportedException(); } PagedDocumentsProvider provider = model.getResultsProvider( documentManager, null, sortInfo); provider.setName(queryModelName); return provider; } @Observer(EventNames.QUERY_MODEL_CHANGED) public void queryModelChanged(QueryModel qm) { resultsProvidersCache.invalidate(qm.getDescriptor().getName()); } public void invalidateProvider() { resultsProvidersCache.invalidate(QUERY_MODEL_NAME); } protected QueryModelDescriptor getQueryModelDescriptor(String descriptorName) throws Exception { if (queryModelService == null) { queryModelService = (QueryModelService) Framework .getService(QueryModelService.class); } return queryModelService.getQueryModelDescriptor(descriptorName); } } _______________________________________________ ECM mailing list ECM@... http://lists.nuxeo.com/mailman/listinfo/ecm To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm |
| Free embeddable forum powered by Nabble | Forum Help |