3 Replies Latest reply: Jul 30, 2014 3:18 AM by Daniel Merchán RSS

    Search task flow- how to change the hyperlink in search result

    2618084

      Hello Friends,

       

      I have requirement where user has to open/download the document directly from clicking search result link. Currently with the default behavior, when user clicks on search result link, it take to intermediate page and from this page there is download link is available. I want to change it so that user can download the document they click.

       

      thanks

        • 1. Re: Search task flow- how to change the hyperlink in search result
          Sreedhar-Oracle

          Hi,

           

          Please let me know your 5 digit version of WCP.

          can you please explain this issue with the help of some screen shots and this helps me to assist you better.

           

          Regards

          Sreedhar

          • 2. Re: Search task flow- how to change the hyperlink in search result
            rohanwalia

            As suggested above kindly please let us know Webcenter Portal version.

             

            So does it mean that when user search, the downloadable link should also come in the search along with the page?

             

            Thanks

            • 3. Re: Search task flow- how to change the hyperlink in search result
              Daniel Merchán

              Hi.

               

              I'm going first to introduce to you a little bit how Search Adapters are defined and how it works within WebCenter Services

               

              WebCenter Live Search Adapters are registered for each WebCenter Service defined in files called service-definition.xml


              For example, for Doclib services you can find the following fragment:

              <!--
                    - Resource ID is passed into the document viewer taskflow to display the document.
                    - Also reuse the relationship service implementation for the authorizer.
                    -->
                  <resource-view taskFlowId="/oracle/webcenter/doclib/view/jsf/taskflows/folderViewer/folderView#doclib-folder-viewer"
                                 authorizerClass="oracle.webcenter.doclib.internal.view.relationship.DoclibRelationshipService"/>
              
                  <resource-mini-view
                    taskFlowId="/oracle/webcenter/doclib/view/jsf/taskflows/docViewer/documentViewer#doclib-document-viewer"
                    preferredHeight="400"
                    preferredWidth="640"/>
              
                  <sidebar-mini-view
                    taskFlowId="/oracle/webcenter/doclib/view/jsf/taskflows/recentDocuments#doclib-recent-documents"
                    helpTopicId="personal_cs_sidebar_docs" >
                    <parameters>
                      <parameter name="maxDocuments" value="#{10}" />
                      <parameter name="lastModifier" value="#{facesContext.externalContext.remoteUser}" />
                    </parameters>
                    <hover-icon>/adf/webcenter/library_ovr.png</hover-icon>
                    <depressed-icon>/adf/webcenter/library_dwn.png</depressed-icon>
                  </sidebar-mini-view>
              
                  <!-- Relationship service definition -->
                  <relationship-definition
                    xmlns="http://xmlns.oracle.com/webcenter/relationship"
                    id="oracle.webcenter.doclib"
                    implementationClass="oracle.webcenter.doclib.internal.view.relationship.DoclibRelationshipService"
                    version="11.1.1.0">
                    <resourceActionHandlerRenderable>true</resourceActionHandlerRenderable>
                    <genericIconSource>/adf/webcenter/library_ena.png</genericIconSource>
                    <linkExistingView taskFlowId="/oracle/webcenter/doclib/view/jsf/taskflows/relationshipsDialogLTE.xml#doclib-link-to-existing" />
                    <linkNewView taskFlowId="/oracle/webcenter/doclib/view/jsf/taskflows/relationshipsDialogLTN.xml#doclib-link-to-new" />
                  </relationship-definition>
              
                  <relationship-definition
                    xmlns="http://xmlns.oracle.com/webcenter/relationship"
                    id="oracle.webcenter.wiki"
                    implementationClass="oracle.webcenter.doclib.internal.view.relationship.WikiRelationshipService"
                    version="11.1.1.0">
                    <resourceActionHandlerRenderable>true</resourceActionHandlerRenderable>
                    <resourcePickerOnly>true</resourcePickerOnly>
                    <genericIconSource>/adf/webcenter/wiki_qualifier.png</genericIconSource>  
                    <linkNewView taskFlowId ="/oracle/webcenter/doclib/view/jsf/taskflows/wiki/linkToNewWiki#doclib-link-to-new-wiki" />
                  </relationship-definition>
                  
                </service-definition>
                
                <service-definition id="oracle.webcenter.content" version="11.1.1.4.0">
                  <icon>/adf/webcenter/content_qualifier.png</icon>
                  
                  <resource-view authorizerClass="oracle.webcenter.doclib.internal.view.relationship.DoclibRelationshipService"
                                 urlRewriterClass="oracle.webcenter.content.internal.service.ContentResourceUrlRewriter">
                    <parameters>
                      <parameter name="urlExternal" value="false"/>
                    </parameters>
                  </resource-view>
              
                  <!-- Relationship service definition - used for RAH only -->
                  <relationship-definition
                    xmlns="http://xmlns.oracle.com/webcenter/relationship"
                    id="oracle.webcenter.content"
                    implementationClass="oracle.webcenter.content.internal.view.relationship.ContentRelationshipService"
                    version="11.1.1.0">
                    <resourceActionHandlerRenderable>true</resourceActionHandlerRenderable>
                    <genericIconSource>/adf/webcenter/content_qualifier.png</genericIconSource>
                  </relationship-definition>                   
                </service-definition>
              

               

              When a WebCenter resource like oracle.webcenter.content, oracle.webcenter.doclib, oracle.webcenter.... are defined there is a part to define how it is going to open the resource by default.

              If resource-view / resource-viewer are defined then WebCenter will use the ResourceActionHandler to display the content in a Task Flow or from a given URL from a Class Rewriter.

               

              If the implementation of the Live Search Adapter by Java provides a URL and the resource-viewer is not defined then the Search Result will open the Link provided.

               

              You can define your own resources in service-definition.xml in order to have your own resources and open them as you want.

               

              Focusing your problem and workarounds:

              • You can customize the searchResultsFramgemt.jsff of the WebCenter Search Services View library including a mechanism to identify with an af:switcher if the result is a oracle.webcenter.content, oracle.webcenter.wiki ... etc type and provide the download URL instead of the resourceHandler. The part of the fragment that you have to modify is the following (row.tableId will have the serviceId of the row):
              <af:switcher facetName="#{row.url == null}" id="ssresfs2">
                                      <f:facet name="true">
                                        <af:commandLink partialSubmit="true"
                                                        styleClass="WCSearchResultsTitleLink"
                                                        immediate="true" id="ssresfcl2">
                                          <af:outputFormatted value="#{row.title}"
                                                              shortDesc="#{row.descriptionNoFormat == '' ? row.titleNoFormat : row.descriptionNoFormat}"
                                                              id="ssresfof1"/>
                                          <rah:resourceActionBehavior id="rah2" serviceId="#{row.tableId}" 
                                                                      resourceId="#{row.id}" 
                                                                      resourceType="#{row.type}" 
                                                                      resourceTitle="#{row.titleNoFormat}" 
                                                                      resourceScope="#{row.scopeGuid}"
                                                                      useResourcePopup="#{pageFlowScope.srbb.usePopups}" />
              
                                        </af:commandLink>
                                      </f:facet>
                                      <f:facet name="false">
                                        <af:goLink targetFrame="#{row.urlExternal ? '_blank' : null}"
                                                   styleClass="WCSearchResultsTitleLink"
                                                   id="ssresfgl1"
                                                   destination="#{row.url}#{!row.urlExternal and pageFlowScope.srbb.extraUrlParams != '' ? row.urlParamConjunction : ''}#{!row.urlExternal and pageFlowScope.srbb.extraUrlParams != '' ? pageFlowScope.srbb.extraUrlParams : '' }">
                                          <af:outputFormatted value="#{row.title}"
                                                              shortDesc="#{row.descriptionNoFormat == '' ? row.titleNoFormat : row.descriptionNoFormat}"
                                                              id="ssresfof2"/>
                                          <rah:resourceActionBehavior id="rah3" serviceId="#{row.tableId}"
                                                                      resourceId="#{row.id}"
                                                                      resourceType="#{row.type}"
                                                                      resourceTitle="#{row.titleNoFormat}"
                                                                      resourceScope="#{row.scopeGuid}"
                                                                      useResourcePopup="#{pageFlowScope.srbb.usePopups}" />
              
                                        </af:goLink>
                                      </f:facet>
              

               

              • You can define your own oracle.custom.webcenter.doclib service to search documents in WebCenter Content. I have an article published explaining how to do it. It is easy .

              Building an Oracle WebCenter Default Search Adapter

              Integrating Search - 11g Release 1 (11.1.1.8.3)

               

              From my point of view is easier and faster customizing the Task Flow to ignore the custom behaviour.


              I hope this helps.

              Regards.