Message Boards

Move folder from one document media library to other

Dhruv Pal, modified 10 Years ago.

Move folder from one document media library to other

Junior Member Posts: 82 Join Date: 1/24/13 Recent Posts
Hi
I have two organisations with their own document media library .I need to move folder from one media library to other. There is not problem if I move it within same media library but I don't have a clue how to do it when we have different media libraries.
thumbnail
Tejas Kanani, modified 10 Years ago.

RE: Move folder from one document media library to other

Liferay Master Posts: 654 Join Date: 1/6/09 Recent Posts
If you want to replicate it from one site to another you can try Documents & Media portlet's Export/Import feature. This will have all your documents/folders copied from one site to another.
Dhruv Pal, modified 10 Years ago.

RE: Move folder from one document media library to other

Junior Member Posts: 82 Join Date: 1/24/13 Recent Posts
Hi Tejas

This will copy folders so new folders will be created with new folder Ids but I need the same folder Ids same like when we use move option .Is that possible ?
thumbnail
Tejas Kanani, modified 10 Years ago.

RE: Move folder from one document media library to other

Liferay Master Posts: 654 Join Date: 1/6/09 Recent Posts
This will copy folders so new folders will be created with new folder Ids but I need the same folder Ids same like when we use move option

Well, Within a same site it is possible as groupId(scopeGroupId) & folderId will remain same while moving a content. But when you change the site, groupId will get change. So as far as I know it's not possible to MOVE folder across site.
Dhruv Pal, modified 10 Years ago.

RE: Move folder from one document media library to other

Junior Member Posts: 82 Join Date: 1/24/13 Recent Posts
Thanks

I will let you know If I come up with some idea and same goes for you.

Thanks Again
Dhruv
thumbnail
Ravi Kumar Gupta, modified 10 Years ago.

RE: Move folder from one document media library to other

Liferay Legend Posts: 1302 Join Date: 6/24/09 Recent Posts
If you are willing to try with custom development for document library(not hook on existing portlet but a new one), this should be possible.
Dhruv Pal, modified 10 Years ago.

RE: Move folder from one document media library to other

Junior Member Posts: 82 Join Date: 1/24/13 Recent Posts
Can you guide me how to start with that
thumbnail
Ravi Kumar Gupta, modified 10 Years ago.

RE: Move folder from one document media library to other

Liferay Legend Posts: 1302 Join Date: 6/24/09 Recent Posts
When you move anything and its recreated, the id will definitely be changed. Liferay uses counter server to decide an id. And no two IDs are same in Liferay. It will always be different from other regardless of type of entity.

In your custom development, you need to create your own portlet leaving document library aside. Implement same features along with your custom ones.

Seems like you are using folder id/document id/file id for some purpose and you want to keep them same even if you move. Now whatever you want to do with these IDs.. I would have a different approach as well.. I would use existing document library with a custom attribute which assigns folders/docs an ID at the time of creation. I would use this id to retrieve/do operations on those contents.
Dhruv Pal, modified 10 Years ago.

RE: Move folder from one document media library to other

Junior Member Posts: 82 Join Date: 1/24/13 Recent Posts
Thanks

I will try it.
majdi Achouri, modified 4 Years ago.

RE: Move folder from one document media library to other

Junior Member Posts: 38 Join Date: 11/21/19 Recent Posts
In my case that was not possible as the exported .lar size is a bit large. Do you have an idea on how to import a large lar file to a portalplz ?
asif aftab, modified 3 Years ago.

RE: Move folder from one document media library to other

Regular Member Posts: 123 Join Date: 9/2/13 Recent Posts
My requirement is to copy folder with in same site but the problem is I have to copy with complete folder(s) and document(s). Please can u share api to copy folder with its complete content.
 
thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Move folder from one document media library to other

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi,You can use
DLAppServiceUtil.copyFolder(repositoryId,  sourceFolderId, parentFolderId, name, description, serviceContext);
asif aftab, modified 3 Years ago.

RE: Move folder from one document media library to other

Regular Member Posts: 123 Join Date: 9/2/13 Recent Posts
thanks