This discussion is archived
3 Replies Latest reply: Feb 7, 2013 11:37 PM by Rodney RSS

Is there Task Scheduler For Webcenter Sites ?

969822 Newbie
Currently Being Moderated
Hi,

I need to populate a list of assets every day using a webservice. Is there some way to schedule this task using webcenter sites ?

Thanks.
  • 1. Re: Is there Task Scheduler For Webcenter Sites ?
    Rodney Explorer
    Currently Being Moderated
    Hi Bahuu,
    There is a systemevent table in sites where the sites specific events are registered for example the publish events. You could create your own events which triggers a element that triggers your webservice.

    To register your event I would suggest you create a simple XML element which uses the event XML tags. Take a look at the following XML tags in the docs:
    - APPEVENT
    - ENABLEEEVENT
    - DISABLEEVENT
    - DESTROYEVENT

    Hope this helps.

    Rodney
  • 2. Re: Is there Task Scheduler For Webcenter Sites ?
    969822 Newbie
    Currently Being Moderated
    Hi Rodney,

    Thanks.
    Can you also tell me, How do i register this event on webcenter ? How do i 'run' the XML
  • 3. Re: Is there Task Scheduler For Webcenter Sites ?
    Rodney Explorer
    Currently Being Moderated
    Hi,
    What are you using to develop your templates? Are you using Eclipse + CSDT?

    In that case basically you create a new template but now you're using XML as the Element Type, make sure the usage is "Element defines a whole HTML page and can be called externaly" and set the template Cache Rules to Uncached.

    Executing a XML Template is the same as executing a JSP Template in Sites.

    You'll need to access it like:
    http://yourserver:<port>/<servlet context>/ContentServer?pagename=<sitename>/<templatename>

    So the element to register your event should contain something like:
    <?xml version="1.0" ?>
    <!DOCTYPE FTCS SYSTEM "futuretense_cs.dtd">
    <FTCS Version="1.1">

    <SETVAR NAME="errno" VALUE="0" />
    <APPEVENT NAME="AppEvent"
    GUID="ContentServer"
    TIMES="13:10:00 */*/*">
    <ARGUMENT NAME="pagename" VALUE="[This should be pointing to the template to execute your WebService]"/>
    </APPEVENT>
    <IF COND="IsError.Variables.errno=true">
              <THEN>
              <!--Handle error-->
              </THEN>
    </IF>

    </FTCS>

    This should register your Event, make sure you also have a element, this could be in JSP, that triggers your web service.

    I would also suggest that you build something similar to disable, enable, destroy your event.

    Hope this helps,
    Rodney

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points