Forum Discussion

Yannick_P's avatar
Yannick_P
Mentor
12 years ago

2 crawl lists with different crawl_message folders

Hi,

 

I have created a endpoint code URL to crawl our board contents similar to the out of the box url, https://<domain>/ttcon/crawl_boards page but with custom filters added in for the boards to be displayed.

 

From GSA we already have a collection which crawls the default URL https://<domain>/ttcon/crawl_boards for its messages which is identified with this URL, https://<domain>/ttcon/board/crawl_message?board.id=Welcome&message.id=392

 

now, in GSA I have created another collection which will crawl my custom page created with Endpoints. which also results in a message url exactly same as the default one as mentioned above. https://<domain>/ttcon/board/crawl_message?board.id=Welcome&message.id=392

 

To avoid overlap of contents in both GSA collections, Is there a way in Lithium to differentiate both the message URL(s). may be by a different folder for message?

 

any thoughts or ideas would be helpful.

 

Thanks.

  • AdamN's avatar
    AdamN
    Khoros Oracle

    Hi Zach,

     

    I'm not sure I fully understand the exact use case you're battling with, but if you're just looking for a way to access the same message from a different URL, I think I can help. You mentioned that you've created a custom endpoint. In this endpoint, I assume you're getting a collection of messages and then outputing details of each message. 

     

    The Message object returned from the REST API has a "view_href" attribute associated with it that will give you the "SEO friendly" URL that you would most commonly find the in UI. You can see this attribute (and more) by appending the parameter/value pair "restapi.response_style=view" to your request URL. More details on that here: http://lithosphere.lithium.com/t5/rest-api/bd-p/developers-rest-api?page=apiresponse

     

    Here's an example call using the parameter mentioned above:

    http://lithosphere.lithium.com/restapi/vc/messages/id/107639?restapi.response_style=view

    And a sample (condensed) response:

    <response status="success">
    <message type="message" href="/messages/id/107639" view_href="http://lithosphere.lithium.com/t5/developers-discussion/2-crawl-lists-with-different-crawl-message-folders/m-p/107639#M3996">
    <id type="int">107639</id>
    ...
    </message>
    </response>

     You can see this message has a "view_href" attribute with a value of:

    http://lithosphere.lithium.com/t5/developers-discussion/2-crawl-lists-with-different-crawl-message-folders/m-p/107639#M3996

     

    If you're making your call in a custom component using the "rest" or "restadmin" context object, you don't need to worry about adding the "restapi.response_style" parameter. It's automatically added for you when you use the context objects. You can just directly access the attribute on the message object, for example:

    <#assign message = rest("/messages/id/107639").message />
    ${message.@view_href}

    Here are some additional details for accessing attributes in Freemarker:

    http://freemarker.org/docs/xgui_imperative_learn.html#autoid_70

     

    I hope this helps! If there's something different you're looking for, please let us know.

     

    • Yannick_P's avatar
      Yannick_P
      Mentor

      Hi Adam,

       

      thanks for the quick reply.

       

      In my custom Endpoint, i reference the message with @view_href as you mentioned in your reply, but our GSA servers block reading the /t5 url's.

       

      so I am getting error when GSA crawls my custom page with messages.

       

      is there any way i can access the message without the SEO friendly url generated by the rest api call.

       

      something similar to the out of the box link,

       

      http://<domain>/ttcon/board/crawl_message?board.id=Welcome&message.id=351

       

      Thanks for your help on this.