Uploaded image for project: 'Alfresco'
  1. Alfresco
  2. ALF-21481

Make it easier to extend/modify the default detailed filtered search view

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Unprioritized
    • Resolution: Won't Fix
    • Affects Version/s: 5.0.d Community
    • Fix Version/s: None
    • Component/s: Aikau
    • Security Level: external (External user)
    • Labels:
      None
    • Environment:
      Windows 10, Tomcat 7,
    • Resolution Time Custom Field:
      9 weeks, 3 days, 9 hours, 29 minutes, 2 seconds

      Description

      At the moment if you need to change the filtered search results, you'll need to create a new widget based on AlfSearchResult.js and add your custom metadata fields in the js & html.

      It should be great if we could use the metadata templates or if the widget is pre-defined created.

      I've tried to create a new view which looks almost like the default:

      var widget_list = widgetUtils.findObject(model.jsonModel.widgets, "id", "FCTSRCH_SEARCH_RESULTS_LIST");
      
      if (widget_list && widget_list.config && widget_list.config.widgets) {
          widget_list.config.widgets.push({
              name: "alfresco/documentlibrary/views/AlfDocumentListView",
              config: {
                  viewSelectionConfig: {
                      label: "Table View",
                      iconClass: "alf-tableview-icon",
                      value: "table"
                  },
                  widgets: [{
                      name: "alfresco/documentlibrary/views/layouts/Row",
                      config: {
                          cssRequirements: [{
                              cssFile: "/js/lib/js/aikau/1.0.34/alfresco/search/css/AlfSearchResult.css"
                          }],
                          //templateString: "dojo/text!/js/lib/js/aikau/1.0.34/alfresco/search/AlfSearchResult.html",
                          widgets: [{
                              name: "alfresco/documentlibrary/views/layouts/Cell",
                              config: {
                                  //additionalCssClasses: "mediumpad",alfresco/renderers/MoreInfo
                                  widgets: [{
                                      name: "alfresco/search/SearchThumbnail",
                                      config: {
                                          showDocumentPreview: true,
                                          publishTopic: "ALF_NAVIGATE_TO_PAGE"
                                      }
                                  }]
                              }
                          }, {
                              name: "alfresco/documentlibrary/views/layouts/Cell",
                              config: {
                                  additionalCssClasses: "propertiesCell",
                                  widgets: [{
                                      name: "alfresco/renderers/SearchResultPropertyLink",
                                      config: {
                                          propertyToRender: "displayName",
                                          renderSize: "large"
                                      }
                                  }, {
                                      name: "alfresco/renderers/Property",
                                      config: {
                                          propertyToRender: "title",
                                          renderSize: "small",
                                          renderedValuePrefix: "(",
                                          renderedValueSuffix: ")"
                                      }
                                  }, {
                                      name: "alfresco/renderers/MoreInfo",
                                      config: {
                                          xhrRequired: true,
                                          filterActions: true,
                                          darkIcon: true
                                      }
                                  }, {
                                      name: "alfresco/renderers/DateLink",
                                      config: {
                                          renderedValueClass: "alfresco-renderers-Property pointer dateCell",
                                          renderSize: "small",
                                          deemphasized: true,
                                          modifiedDateProperty: "modifiedOn",
                                          modifiedByProperty: "modifiedBy",
                                          publishTopic: "ALF_NAVIGATE_TO_PAGE",
                                          useCurrentItemAsPayload: false,
                                          publishPayloadType: "PROCESS",
                                          publishPayloadModifiers: ["processCurrentItemTokens"],
                                          publishPayload: {
                                              url: "user/{modifiedByUser}/profile",
                                              type: "SHARE_PAGE_RELATIVE"
                                          }
                                      }
                                  },{
                                      name: "alfresco/renderers/Property",
                                      config: {
                                          propertyToRender: "description",
                                          renderSize: "small"
                                      }
                                  }]
                              }
                          }, {
                              name: "alfresco/documentlibrary/views/layouts/Cell",
                              config: {
                                  widgets: [{
                                      name: "alfresco/renderers/XhrActions",
                                      config: {
                                          onlyShowOnHover: true,
                                          filterActions: true,
                                          allowedActions: documentAndFolderActions,
                                          publishPayload: {
                                              url: "user/{modifiedByUser}/profile",
                                              type: "SHARE_PAGE_RELATIVE"
                                          }
                                      }
                                  }]
                              }
                          }]
                      }
                  }]
              }
          });
      }
      

      So what is desirable is that the filtered-search is pre-built so one can just swap out the modiffiedby for createdby or add an extra metadata field owner for example .

        Attachments

          Structure

            Activity

              People

              • Assignee:
                closedissues Closed Issues
                Reporter:
                tmalik Tahir Malik
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response:

                  Structure Helper Panel