Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Sep 19, 2014 @ 15:59
    Biagio Paruolo
    0

    Workaround for publishing at datetime: how create a scheduled task?

    Hi,

    to solve the heavy issue of publishing at, is it possible to build an external code that read "publish at/remove at" fields and made the task? 

  • Charles Afford 1163 posts 1709 karma points
    Sep 21, 2014 @ 18:35
    Charles Afford
    0

    Well you could put some code in the app start to:

    Has this been run today? Is the current date time within the range to run the code? if it is go and call this method x and method y

    Method x does publishing Method y does removing

    You could create seperate section in Umbraco to do this so you had some sort of interface where you could select the time and date ect :).

    Hope that makes sense.

    Charlie

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Sep 21, 2014 @ 18:45
    Biagio Paruolo
    0

    I have some idea, but how query database to see which content nodes have "publish at" and "remove at" configured?

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Sep 26, 2014 @ 09:32
    Biagio Paruolo
    100

    I find it.

    Using this query:

    SELECT D.nodeId, D.releaseDate, D.expireDate FROM dbo.cmsDocument D WHERE D.newest = 1 AND ( ( D.releaseDate IS NOT NULL AND D.releaseDate <= GETDATE() ) OR ( D.expireDate IS NOT NULL AND D.expireDate <= GETDATE() ) );

    with results:

    2772    NULL    2014-05-23 00:00:00.000
    3555    2014-09-19 16:12:00.000    NULL
    3573    2014-09-19 15:57:00.000    NULL
    3580    2014-09-19 09:05:00.000    NULL
    2809    2014-05-22 00:00:00.000    NULL


    I can cycle on this rows and for NodeID ( see first column ), I publish/unpublish node.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies