I created a bean called DashBoardPersoActionsBean which implements 
ResultsProviderFarm and it works but I can't sort by column :



@Stateful
@Name("dashboardPersoActions")
@Scope(SESSION)
@SerializedConcurrentAccess
@Install(precedence=FRAMEWORK)
public class DashBoardPersoActionsBean extends InputController implements 
ResultsProviderFarm {

   private static final long serialVersionUID = 7737098220471277412L;

   private static final Log log = LogFactory.getLog
(DashBoardPersoActionsBean.class);

   protected static final String REVIEW_TAB_ID = "TAB_CONTENT_REVIEW";

   // Result providers
   protected static final String BOARD_DOCSPERSO = 
"dashboardDocsPersoQueryModel";

   @In
   protected transient Context eventContext;

   @In(required = true)
   protected transient CoreSession documentManager;

   @In(create = true)
   protected transient QueryModelActions queryModelActions;

   @In(required = false)
   protected transient Principal currentUser;

   @In(required = false)
   protected transient DocumentModel currentDomain;

   @In(create = true)
   protected transient WebActions webActions;

   @In(create = true)
   protected transient NavigationContext navigationContext;

   @In(create = true)
   protected transient ResultsProvidersCache resultsProvidersCache;

   protected Collection<DashBoardItem> dashboardItems;

   @RequestParameter("sortColumn")
   protected String newSortColumn;

   protected SortInfo sortInfo;

   protected Comparator<DashBoardItem> comparator;

   public DashBoardPersoActionsBean() {
       super();
   }


   @Destroy
   @Remove
   @PermitAll
   public void destroy() {
       log.debug("Removing Seam component...");
   }


   public PagedDocumentsProvider getResultsProvider(String name,
           SortInfo sortInfo) throws ClientException,
           ResultsProviderFarmUserException {

       Object[] params;
       if(BOARD_DOCSPERSO.equals(name)) {
           params = null;
       } else {
           throw new ClientException("Unknown board: " + name);
       }

       PagedDocumentsProvider provider = null;
       try {
           provider = getQmDocuments(name, params, sortInfo);
       } catch (Exception e) {
           log.error("sorted query failed");
           log.debug(e);
           log.error("retrying without sort parameters");
           provider = getQmDocuments(name, params, null);
       }
       provider.setName(name);
       return provider;
   }

   public PagedDocumentsProvider getResultsProvider(String name)
           throws ClientException, ResultsProviderFarmUserException {
       return getResultsProvider(name, null);
   }

   protected PagedDocumentsProvider getQmDocuments(String qmName,
           Object[] params, SortInfo sortInfo) throws ClientException {
       try {
           return queryModelActions.get(qmName).getResultsProvider(params,
                   sortInfo);
       } catch (QueryException e) {
           throw new ClientException(String.format("Invalid search query. 
"
                   + "Check the \"%s\" QueryModel configuration", qmName), 
e);
       }
   }
}





Narcis Paslaru <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
30/11/2007 12:13
Please respond to
[EMAIL PROTECTED]


To
[EMAIL PROTECTED]
cc
[email protected]
Subject
Re: [Ecm] Adding a new result window to the dashboard






[EMAIL PROTECTED] wrote:
>
> Ok, but I don't know what is a farm and how I can define a new one.
>
Just take DashboardActionsBean as an example.
You must implement ResultsProviderFarm interface.

Cheers,
Narcis
>
>
> *Narcis Paslaru <[EMAIL PROTECTED]>*
>
> 30/11/2007 11:06
> Please respond to
> [EMAIL PROTECTED]
>
>
> 
> To
>                [EMAIL PROTECTED]
> cc
>                [email protected]
> Subject
>                Re: [Ecm] Adding a new result window to the dashboard
>
>
>
> 
>
>
>
>
>
> Hello,
>
> You might also try to write your own farm and use it instead of
> DashboardActionsBean.
>
> Cheers,
> Narcis
>
> [EMAIL PROTECTED] wrote:
> >
> > Thank you.
> >
> > In my project, I don't know how to replace an original java file.
> >
> >
> >
> >
> > *Damien DUPRAZ-GRALLIER <[EMAIL PROTECTED]>*
> >
> > 30/11/2007 10:44
> >
> > 
> > To
> >                  [EMAIL PROTECTED]
> > cc
> >                  [email protected]
> > Subject
> >                  Re: [Ecm] Adding a new result window to the dashboard
> >
> >
> >
> > 
> >
> >
> >
> >
> >
> >
> >
> > Hello, you have to modify a source code page.
> >
> > The page is DashBoardActionsBean.java
> >
> > Add a new  "protected static final String" that is the name of your 
new
> > dashboard view (see example in the code) and you'll have to add
> > a condition around ligne  455. You have to add a condition to
> > determine which
> > parameters will be used for the request.
> > To make it simple, if you have no "?" parameter in your NXQL request
> > just add
> > the condition like this :
> >
> > ...
> > } else if (BOARD_WORKSPACES.equals(name) ||  YOUR_CONDITION) {
> >            params = null;
> >        } else {
> > ....
> >
> > Damien
> >
> > 
------------------------------------------------------------------------
> >
> > _______________________________________________
> > ECM mailing list
> > [email protected]
> > http://lists.nuxeo.com/mailman/listinfo/ecm
> > 
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ECM mailing list
> [email protected]
> http://lists.nuxeo.com/mailman/listinfo/ecm
> 

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to