I made a link by every document(in de browse page) with subscribe.
the meaning of this is, that a person can subscribe himself on a document.
If you click on that link, it calls browsebean.subscribe.
code of browsebean.subscribe
public void Subscribe()
{
UserTransaction tx = null;
try
{
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
tx.begin();
// add the versionable aspect to the node
this.nodeService.addAspect(getDocument().getNodeRef(), ContentModel.ASPECT_SUBSCRIBABLE, null);
// commit the transaction
tx.commit();
// reset the state of the current document
getDocument().reset();
}
catch (Throwable e)
{
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), MSG_ERROR_ASPECT_SUBSCRIBE), e.getMessage()), e);
}
}
But this doesn't work.
Does someone know how to deal with the subscribe aspect?