Thomas Negeli wrote:
> Hello out there
> 
> I want to start activation of content from within code.
> We have an application where users are allowed to upload documents in the
> public instance. So this is why we need to propagate this content back to
> the author instance.
> I'm at the point where I know where the content is saved to and I can get
> the UUID of the content element, but I don't know how to start activation of
> this content via a java call.
> I know, when you activate content in the AdminCentral, this works via a
> filter, but I don't want to send a request, I just want to make a simple
> java call.

Try something along the lines of:

    Syndicator syndicator = (Syndicator)
FactoryUtil.newInstance(Syndicator.class);
    User user = MgnlContext.getUser();
    String repository = "config";
    String workspace = ContentRepository.getDefaultWorkspace(repository);
    syndicator.init(user, repository, workspace, new Rule());
    syndicator.activate("/some/folder", "/some/folder/content");

You'll have to configure subscribers and other parameters of course.


Cheers
PHilippe


----------------------------------------------------------------
for list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
----------------------------------------------------------------

Reply via email to