09-24-2019 06:22 AM
Hi, I'm new to Alfresco. I have a simple report generation using jasper and that document(pdf) is currently save to "public" folder in my project. My task is to save my report to alfresco document manager.
I'm using alfresco 6.1.
Can someone please guide me on this. I read several blogs and i dont have a clear idea on how to do above task.
Thank you.
09-24-2019 06:34 AM
Hope this helps:
https://github.com/aborroy/cmis-associations-alfresco
This project is creating associations, but it can be used as template for your requirement.
09-24-2019 06:45 AM
thanks a lot for the reply. I'll go though that.
Can you provide a simple guidline to upload a file to alfresco using java. My alfresco version is 6.1.
I tried several blogs. But i can find CMIS in alfresco 6.1. Some have mentioned that it will start with alfresco and i'm not getting a clear idea.
Can you give a clear guidance on how to upload a file using alfresco 6.1 in java.
Thank you
09-24-2019 06:47 AM
09-24-2019 06:51 AM
thanks a lot for replying so quicky. Much appreciated. I'll go through that document and let you know.
09-24-2019 08:06 AM
In the document you provided, when we grab the session, we provide username, password, ATOMPUB_URL. In here what is username ? is this the admin of my alfresco user or any user in alfresco ?
And what should i provide for ATOMPUB_URL ? In a stack overflow asnwer i saw a url like this >
"http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom"
What should i use for atompub_url with alfresco 6.1 ?
09-24-2019 07:26 AM
You can use the following OOTB APIs in order to upload a document from your java application to Alfresco.
1. Authentication - http://localhost:8080/alfresco/api/s/login
2. Upload document - http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/{nodeId}/children
You will need to pass the authentication ticket in upload document API.
Please refer the following link for the response and body required to pass:
https://api-explorer.alfresco.com/api-explorer/#/
Thanks,
Kintu
09-24-2019 08:08 AM
i'll go through this and let you know. Thank you for replying to me.
09-24-2019 08:21 AM
hi, I tried to authenticate it by typing this url >
"http://localhost:8080/alfresco/api/s/login?u=myUSER&pw=myPW"
And i am not getting a token. I only get a blank response body. It has nothing in it. Btw i provided my admin username and password.
09-26-2019 02:00 PM
Answering your question about the CMIS URL, yes, what you found is the correct CMIS service URL. Yes, just use any username and password that has access to the folder in Alfresco you are trying to write to.
CMIS will be easier to use than the Alfresco REST API for this, in my opinion, but either one can be used.
Explore our Alfresco products with the links below. Use labels to filter content by product module.