cancel
Showing results for 
Search instead for 
Did you mean: 

How to publish using alfresco api?

dynamolalit
Champ on-the-rise
Champ on-the-rise
Hi,

I want to know how can i deploy/publish content from my web project to deploy it to say local file system using alfresco java apis? I have content in user sandbox of my web project & now i want to dump it using wcm deployment mechanism.

Can i do it?What services/classes should i use?

Another part is can i use only simple document management without using AVM stores for same?
8 REPLIES 8

dynamolalit
Champ on-the-rise
Champ on-the-rise
Hi,

I have got answer to my first question : YES & below is code for same.


logger.debug("Deploying Content");
String srcPath = "dns name of project–user name:/www/avm_webapps/ROOT";         
DeploymentReport report = new DeploymentReport();         
List<DeploymentCallback> callbacks = new ArrayList<DeploymentCallback>();
callbacks.add(new DeploymentReportCallback(report));
DeploymentService deploymentService = serviceRegistry.getDeploymentService();         
deploymentService.deployDifferenceFS(-1, srcPath, "default", "localhost", 44100, "user name", "password" , "default", null, false , false, false, callbacks);
logger.debug("Content Deployed");

Here Namematcher can be null & it will deploy latest diff from web project.

But still i could not find any answer to my second question

Another part is can i use only simple document management without using AVM stores for same?

But my gut says it must be no, still want a confirmation.

mrogers
Star Contributor
Star Contributor
AVM has its deployment machinery that you have been using above.   If working with "simple document management" then the AVM facilities including deployment can't be used. 

However there are other ways of "publishing" "simple documents",  look at WQS for one way of doing it.

rickfenton
Champ in-the-making
Champ in-the-making
I am really a new kid when it comes alfresco. A very good colleague introduce me to it and to be honest, it was really interesting.
Just when I ran into the title of the thread, I really felt like I am on the right track. Thanks so much for the information guys. I hope
you don't mind if I will keep track of your ideas and your answers.

Thanks and have a nice day everyone!

dynamolalit
Champ on-the-rise
Champ on-the-rise
Hi,

For second part

Another part is can i use only simple document management without using AVM stores for same?

From 3.3 onwards, alfresco provides TransferService for DM transfer.

But i can get it that it is viable b/w two alfresco repositories not from a alfresco repository to a file system etc as in WCM & it has only one default target.

As one might expect, the Transfer Service comprises two major parts: the part that is responsible for sending information from the source repository and the part that is responsible for receiving information in the target repository

sam4alf
Champ in-the-making
Champ in-the-making
Lalit / Forum members,

We have a similar requirement to publish from Alfresco repository to a remote file system on a daily basis. I should be able to publish both content and metadata. Can I use the "Transfer Service" for this? Any other better approaches?

Thanks,
Sarma.

mikey
Champ in-the-making
Champ in-the-making
Sarma,

In the current release, there is no way to publish content and metadata to a remote file system using the DM Store. There is a content transfer service that can be extended to do this, but you would have to create that extension yourself. (The AVM Store lets you push content to a file server, but not metadata).

Alfresco has said that in a future release, they will add the ability to export content to a remote file system, but I'm not sure if it will include metadata.

Assuming you need this for some external system to access content in Alfresco, most folks that need this kind of thing either 1) Use the CIFS Interface to allow content to be accesses as if it were on a file system or 2) Have the external system get the content using a web service.

-Mike

Michael Trafton
Blue Fish Development Group

mrogers
Star Contributor
Star Contributor
An AVM deployment receiver does have metadata.   Just the filesystem target has nowhere to put it!

sam4alf
Champ in-the-making
Champ in-the-making
Thanks Mike and Rogers. I'll wait for this functionality to be available (OOB) in future versions.

Meanwhile, I'll try some of your suggestions.

-Sarma.