Actionhandler creating published "folders"
I have an action handler which creates "folders" in the Umbraco content tree when an item is saved/published.
Creating a structure like:
--2009
----05
------01
--------theItem
However when I try to publish the folders programmatically they do not get any "link to document" and from investigations it seems like the documentCache isnt updated.
I was thinking of modifying the actionhandler so it can be used for different versions of umbraco.
I saw that the documentObject has a property named "version". Is this the umbraco version or just the version of the object? And also as it is a guid how do I know what version this Id corresponds to?
It's version of the object (also used in rollback scenarios)
umbraco version can be found as it's stored in web.config. Not sure if it's available as public property, otherwise use ConfigurationManager to get the umbraco version.
Actionhandler creating published "folders"
I have an action handler which creates "folders" in the Umbraco content tree when an item is saved/published.
Creating a structure like:
--2009
----05
------01
--------theItem
However when I try to publish the folders programmatically they do not get any "link to document" and from investigations it seems like the documentCache isnt updated.
Doing:
[code]umbraco.library.UpdateDocumentCache(Id);[/code]
Works fine in Umbraco version 4.
But I want to deploy this on a 3.0.2 version umbraco installation.
When I try the same code on that server I get:
[code]System.MissingMethodException: Method not found: 'Void umbraco.content.UpdateDocumentCache(Int32)'.
[/code]
Is there any equivalent in version 3.0.2?
I have tried:
[code]
umbraco.library.UpdateDocumentCache(Id);
umbraco.content.UpdateDocumentCache(Id);
umbraco.library.RefreshContent();
[/code]
And all is "missing" and does not work.
Hi,
v3.x doesn't know about those 'new' publishing methods.
In v3.x, you' use:
Publish() and PublishSingleNode()
First function prepares a node for publishing, the second performs the actual publish and refreshes the data!
Hope this helps.
Regards,
/Dirk
Yes, it worked!
Thank you for the solution.
I was thinking of modifying the actionhandler so it can be used for different versions of umbraco.
I saw that the documentObject has a property named "version". Is this the umbraco version or just the version of the object? And also as it is a guid how do I know what version this Id corresponds to?
It's version of the object (also used in rollback scenarios)
umbraco version can be found as it's stored in web.config. Not sure if it's available as public property, otherwise use ConfigurationManager to get the umbraco version.
Cheers,
/Dirk
is working on a reply...