|
|
 Rank: Devotee
Joined: 1/10/2008 Posts: 55 Location: London
|
Hi all,
I'm writing a small tool that will run as a scheduled task to alert users when pages hasn't been updated for more than x months.
In the Document class, there is a UserID property that seems to be the creator ID, not the last user who has updated the document. Also this information should be available as it is stored somewhere (at least in the umbraco.config file, there is a writerID for each node which seems to be the last "updator" ID).
Does anybody knows how to retrieve this information?
many thanks,
seb
Bingo maniak
|
|
 Rank: Devotee
Joined: 11/9/2006 Posts: 47 Location: Stockholm
|
I think what u r looking for is the writerID, that should point to last user to publish the document.
|
|
 Rank: Devotee
Joined: 1/10/2008 Posts: 55 Location: London
|
it is yes, but unfortunaly WriterID is not a property of the Document class. So how do I get it? Remember i'm not within XSLT, I'm in some C# code.
cheers, seb
Bingo maniak
|
|
 Rank: Devotee
Joined: 11/9/2006 Posts: 47 Location: Stockholm
|
Ugly hack warning!
Use the library to get the XmlPathNodeIterator from umbraco.library.GetXmlNodeById(Document.Id), and grab the writerID attribute from there.
:)
Have fun!
//S
|
|
 Rank: Devotee
Joined: 1/10/2008 Posts: 55 Location: London
|
:)
yeah I actually tried that first; it didn't work. The reason for that was because the application I'm building will sit outside umbraco web folder, and therefore will not have access to the umbraco.config file. I can't see another way but using this Document class. please correct me if I'm wrong
seb
Bingo maniak
|
|
 Rank: Devotee
Joined: 11/9/2006 Posts: 47 Location: Stockholm
|
Are you trying to access umbraco from outside the web site? In that case I'd say a web service would be your best bet. If you are building a stand-alone app, it's either this or some other API you need.
Good luck!
//S
|
|
 Rank: Devotee
Joined: 1/10/2008 Posts: 55 Location: London
|
it's more than I'm trying to access the site data using umbraco API to do some stuff (sending an email to user who haven't updated their content recently enough).
At the end, I will get an exe that will be run daily on the server. So I'm not in the context of a web app here, but really as a stand-alone application using some API, umbraco being one of them.
I would say the writerID has been forgotten from the Document class; will report that on Codeplex. But in the mean time, I'm a bit stucked here :(
Bingo maniak
|
|
 Rank: Devotee
Joined: 1/10/2008 Posts: 55 Location: London
|
right, after more readings on the forum, I think I should rather create a page that runs my code and use the build-in Umbraco scheduler.
This way I'll be able to use the GetXml.. functions. Also I wanted to extend notifications so users can have a similar email to the current notifications ones when the content they are responsible for needs to be reviewed, and found out that Actions need to be run in a web context.
thanks, seb
Bingo maniak
|
|
|
Guest |