Rename a folder in a module component set the name to a new UUID instead of the name given

cancel
Showing results for 
Search instead for 
Did you mean: 
SébastienVallet
Active Member

Rename a folder in a module component set the name to a new UUID instead of the name given

Hi,

I'm using ACS 5.2 and I want to fix a path of some folders at startup because a ImporterModuleComponent use the path to be fix.

I created a new implementation of a AbstractModuleMomponent to rename the folders with fileFolderService.rename(myNode, "my-new-name").

But the new name of the folder is not the name a passed in parameters to fileFolderService.rename() but a UUID.

I alse tried to re-apply the name with setProperty (the wrong way) but my node do not take this name either. (See the logs)

fixnodepathmodulecomponent.jpg

Any idea why this is happening ? Is this related to AbstractModuleComponent and some side effect related to that ?

Thank's

10 Replies
cristinamr
Advanced

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

Could you please go through Node browser and check which properties has that UUID?

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
SébastienVallet
Active Member

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

This is the nodeId  (created by a BootstrapView) :  

2021-08-11 12_19_18-Alfresco » Outils admin.jpg

cristinamr
Advanced

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

I cannot see anything interesting in that screenshot Smiley Tongue

Please do it through node browser and attach us a screenshot with all its properties. For example:

Snag_23f74dd3.png

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
SébastienVallet
Active Member

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

2021-08-11 16_49_31-Alfresco » Navigateur de nœuds [Hôte_ SVALLET IP_ 10.53.13.65].jpg

This should help you Smiley Happy

cristinamr
Advanced

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

Could you please do the following test?

- Create a test.txt with properties (at least with the name)

- Execute your code against that nodeRef (test.txt)

Let us know your results.

 

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
SébastienVallet
Active Member

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

There is the folowing tests I ran:

I created a file MyTextFile.txt

I used fileFolderService.rename() on this file => It has been renamed correctly

I used fileFolderService.rename() on my folder with a custom uuid of "cpage-folder" (not a real uuid) => the folder has been renamed with a new uuid as name

Logs of the 1st test :

Node has been renamed (fix path): workspace://SpacesStore/90bd49cc-e777-4e0a-a264-40c17e10407e [oldName=MyTextFile][newNameToApply=TheNewName] --> newNameOfTheNode=TheNewName
 2021-08-12 09:00:18,767  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-folder [oldName=Dictionnaire CPage][newNameToApply=cpage-folder] --> newNameOfTheNode=fe4cb5e2-95d5-412d-9391-2e4d4dec8254
 2021-08-12 09:00:18,790  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-referentiels-folder [oldName=Referentiels][newNameToApply=cpage-referentiels-folder] --> newNameOfTheNode=67aeb5e1-563f-47a0-8693-b4597a6f9923
 2021-08-12 09:00:18,832  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-referentiels-pc-folder [oldName=PC][newNameToApply=cpage-referentiels-pc-folder] --> newNameOfTheNode=b99846e8-3537-4906-80f5-6f341565dfb6
 2021-08-12 09:00:18,867  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-referentiels-pj-folder [oldName=PJ][newNameToApply=cpage-referentiels-pj-folder] --> newNameOfTheNode=a158cb9a-37e3-4afd-b00f-4f4866ec28a9
 2021-08-12 09:00:18,889  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-synchro-permissions-folder [oldName=Synchronisation permissions][newNameToApply=cpage-synchro-permissions-folder] --> newNameOfTheNode=1e6c1da2-e2ae-4ab9-828c-3fc92e677090

I cleared the database.

I created a file MyTextFile.txt

I created a folder MyFolderTest

I used nodeService.setproperty() on ContentModel.PROP_NAME on the file => the file has been renamed correctly (but the path is wrong)

I used nodeService.setproperty() on ContentModel.PROP_NAME on the folder => the folder has been renamed correctly (but the path is wrong)

I used nodeService.setproperty() on ContentModel.PROP_NAME on my custom folder that contains a uuid of "cpage-folder" => the folder has NOT been renamed

Logs of the 2nd test :

2021-08-12 09:59:35,664  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/b666309f-6180-4fc1-bfbe-fb12e7ee6f04 [oldName=MyTextFile][newNameToApply=TheNewName] --> newNameOfTheNode=TheNewName
 2021-08-12 09:59:35,680  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/b221a434-4113-4851-b822-50432e70a71a [oldName=MyFolderTest][newNameToApply=TheNewFolderName] --> newNameOfTheNode=TheNewFolderName
 2021-08-12 09:59:35,689  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-folder [oldName=Dictionnaire CPage][newNameToApply=cpage-folder] --> newNameOfTheNode=Dictionnaire CPage
 2021-08-12 09:59:35,695  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-referentiels-folder [oldName=Referentiels][newNameToApply=cpage-referentiels-folder] --> newNameOfTheNode=Referentiels
 2021-08-12 09:59:35,700  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-referentiels-pc-folder [oldName=PC][newNameToApply=cpage-referentiels-pc-folder] --> newNameOfTheNode=PC
 2021-08-12 09:59:35,705  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-referentiels-pj-folder [oldName=PJ][newNameToApply=cpage-referentiels-pj-folder] --> newNameOfTheNode=PJ
 2021-08-12 09:59:35,711  INFO  [bootstrap.modules.FixNodePathModuleComponent] [localhost-startStop-1] Node has been renamed (fix path): workspace://SpacesStore/cpage-synchro-permissions-folder [oldName=Synchronisation permissions][newNameToApply=cpage-synchro-permissions-folder] --> newNameOfTheNode=Synchronisation permissions

Thanks

SébastienVallet
Active Member

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

Hi,

Can I have a feedback on this issue please?

Thank's

cristinamr
Advanced

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

Hi!

Please, share with us your code.

Cheers!

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
SébastienVallet
Active Member

Re: Rename a folder in a module component set the name to a new UUID instead of the name given

Hi,

You can acces my bootstrap-context.xml here: https://pastebin.com/SZwUAek1

And my FixNodePathModuleComponent.java here: https://pastebin.com/AT0Bfmgz

Tell me if you need anything else to test this behavior.

Thank's