cancel
Showing results for 
Search instead for 
Did you mean: 

Add Content: how modify the code

angeand
Champ in-the-making
Champ in-the-making
Hi,
I would like understand the steps and witch classes are called to add a document with Alfresco Webclient.

For example If I want modify the 'add content' flow when I press 'OK', witch classes I have to modify ?

Looking at the page jsp where is the 'OK' buttom to upload file (add-content-dialog.jsp), I see that this buttom has the submit action="/alfresco/faces/jsp/content/add-content-dialog.jsp' but I don't see all the classes that this process call; is there a mapping ?

I know that the class AddContentDialog add a document, When this class is called ? Where this class is called ?


Thanks a lot everybody.

Andrea
2 REPLIES 2

angeand
Champ in-the-making
Champ in-the-making
Hello,
I have found where I have to modify the code:

the Jsp add-content-dialog when I press 'OK' call the method AddContentDialog.finish (ovveride finishImpl). In this method, finishImpl, at end of code there is the calling to method saveContent. Here it insert the document into repository.

My question is: if I want insert the document into repository and more I want insert a record in my custom table, Have to add my code at end of method saveContent ? And, If one of two operation failed how can I do rollback ?

Thanks a lot.
Andrea

ribz33
Champ on-the-rise
Champ on-the-rise
Maybe open a transaction.

Try this if you can :

tx = Repository.getUserTransaction(context,true);
tx.begin();
<your code>
tx.commit;

Test it,  i dont know if this kind of transaction is available to saveContent() method.

I know that this is used for search on repository but i don't know for save content if that can work also.