cancel
Showing results for 
Search instead for 
Did you mean: 

Enforcing file name when uploading new versions in Alfresco Community 25.3

lferrario
Champ in-the-making
Champ in-the-making

Hello everyone,

my organization wants to prevent users from renaming files and folders in Alfresco Community Edition (25.3).From the documentation we understood that preventing a file from being renamed is possible. However, it is not clear whether, when uploading a revision, it is possible to prevent a document revision from being uploaded with a different name.

Is there a way to force users to upload a new version of a file only if it has exactly the same name as the file being revised?

Thanks in advance to anyone who can give us support.

3 ACCEPTED ANSWERS

LeoMattioli
Employee
Employee

Hi,

you have to create a Behaviour (docs), attaching your code to onUpdateProperties event. Your code will receive a 
NodeRef and 2 Maps with properties before and after. You can search some example on how to implement it also in our source code, like there for example.
Best regards.

 


Leo Mattioli - Technical Account Manager @Hyland.

View answer in original post

Thank you Leo for the quick reply. I have another question related to product customization; if it’s necessary to open a separate thread, please let me know.
Another aspect we would like to address is the URL of individual files. We would like to have "descriptive" URLs for each files, displaying the folder structure they come from and the files' name. This would greatly help in terms of traceability and improve SEO. Is this kind of customization also possible?

View answer in original post

LeoMattioli
Employee
Employee

Quite difficult to achieve:

  1. A node can have multiple primary parents (very rare, but technically possible)
  2. A node just "knows" its direct parent/children

I think would be easier for you to create your own UI to achieve the descriptive URL requirement. You can think to have a custom metadata field with the full path and create a behaviour that keeps it updated every time the node is changed (and remember to batch calculate the field value at go-live, as behaviors don't touch the existing nodes when installed). You UI will display the full URL as you need. I'm not an Angular dev, but maybe you can create something with ADF libraries (I'm not sure if routing needs fragments or not in the URLs)


Leo Mattioli - Technical Account Manager @Hyland.

View answer in original post

3 REPLIES 3

LeoMattioli
Employee
Employee

Hi,

you have to create a Behaviour (docs), attaching your code to onUpdateProperties event. Your code will receive a 
NodeRef and 2 Maps with properties before and after. You can search some example on how to implement it also in our source code, like there for example.
Best regards.

 


Leo Mattioli - Technical Account Manager @Hyland.

Thank you Leo for the quick reply. I have another question related to product customization; if it’s necessary to open a separate thread, please let me know.
Another aspect we would like to address is the URL of individual files. We would like to have "descriptive" URLs for each files, displaying the folder structure they come from and the files' name. This would greatly help in terms of traceability and improve SEO. Is this kind of customization also possible?

LeoMattioli
Employee
Employee

Quite difficult to achieve:

  1. A node can have multiple primary parents (very rare, but technically possible)
  2. A node just "knows" its direct parent/children

I think would be easier for you to create your own UI to achieve the descriptive URL requirement. You can think to have a custom metadata field with the full path and create a behaviour that keeps it updated every time the node is changed (and remember to batch calculate the field value at go-live, as behaviors don't touch the existing nodes when installed). You UI will display the full URL as you need. I'm not an Angular dev, but maybe you can create something with ADF libraries (I'm not sure if routing needs fragments or not in the URLs)


Leo Mattioli - Technical Account Manager @Hyland.