cancel
Showing results for 
Search instead for 
Did you mean: 

filterOwner at toolbar.js

frontman
Champ in-the-making
Champ in-the-making
Hi guys,

I've modified filters.lib.js that is at "alfresco\WEB-INF\classes\alfresco\templates\webscripts\org\alfresco\slingshot\documentlibrary" in order to execute a lucene search. The documents are there, the parameters are fine, but when I hit document library url, IE shows an error and no results are displayed, just stays loading the library.

An example of how I'm invoking the url is "http://192.168.1.131:8080/share/page/site/inbursa/documentlibrary#filter=custom|curp_RORA820327HDFLN...". IE error is "filterOwner is null o not an object".

The code I added to filter.lib.js is:

case "custom":

      logger.log("Entering custom code");

          var strData=decodeURI(args.filterData);
      var lstParamVal = strData.split("-");
      var lstNextParamVal;
      var strNextParam = "";
      var strNextVal = "";
            logger.log("—–>>>" + strData);

            filterQuery = "+PATH:\"" + parsedArgs.rootNode.qnamePath + "//*\"";

      for(var i=0; i < lstParamVal.length; i++)
      {
         lstNextParamVal = lstParamVal[i].split("_");
         strNextParam = lstNextParamVal[0];
         strNextVal = lstNextParamVal[1];

         logger.log("strNextParam[" + i + "]=" + strNextParam);
         logger.log("strNextVal[" + i + "]=" + strNextVal);

         switch (strNextParam)
                    {
                       case "folio":
                        
                  filterQuery += " +@tsg\\:folioInbursa:"+strNextVal+;
                     
                  break;
                     
                  case "servicio":

                  filterQuery += " +@tsg\\:servicioInbursa:"+strNextVal;

                  break;
                     
                  case "curp":
                        
                  filterQuery += " +@tsg\\:curpInbursa:"+strNextVal;

                  break;                                   
                       
                       case "sort":

                          if(strQueryArray[1]=="editdesc")
                          {
                             filterParams.sort = [
                             {
                                column: "@{http://www.alfresco.org/model/content/1.0}modified",
                                ascending: false
                             }];
                          }
                          if(strQueryArray[1]=="editasc")
                          {
                             filterParams.sort = [
                             {   
                                column: "@{http://www.alfresco.org/model/content/1.0}modified",
                                ascending: true
                             }];
                          }   

                       break;
                  }

         // ADD THE CASE LOGIC TO PROCESS THE ARGUMENTS, NEED THIS LINE TO COMPLETE THE QUERY
               //filterQuery += " +@cm\\:PARAM:\"VALUE\"";
      }
     
            filterParams.query = filterQuery;

      logger.log(filterQuery);

            break;

When I choose any other of the filters (All Documents, I'm Editing, etc), document library works fine. I don't if  I'm missing something.

Regards.
2 REPLIES 2

frontman
Champ in-the-making
Champ in-the-making
Maybe it's a silly question but please, I need some help with this.

I forgot to mention that toolbar.js is in "\share\components\documentlibrary" and I'm working with Alfresco 3.3 and Windows 2003.

mikeh
Star Contributor
Star Contributor
The Document Library can't find an element to highlight to indicate the current filter. Assuming your new filter is in the same "category" as the standard filters, you need to add
   <filter id="custom" label="Frontman's Filter" />
to filter.get.config.xml in site-webscripts/org/alfresco/components/documentlibrary within Share.

Thanks,
Mike
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.