cancel
Showing results for 
Search instead for 
Did you mean: 

Addd custom models to different folders

geovanny_campov
Confirmed Champ
Confirmed Champ

Hello,


I have an structure of folders and I need to upload files with diferent metadata in each one: For example, I have the next structure:


Main

-Human Resources (Custom properties for files: Name, Age, Language, etc.)

-TIC´s (Custom properties for files: Model, Year, Suppliers, etc.)

-Sales (Custom properties for files: Country, State, etc.)


I have created an specific model for files of every folder (I have three models).Now, when I add a file on any folder I need to change the  Type in order to see the corresponding properties and fill them.


There is some way to set a default model to an specific folder and, by inheritance, set by default this model to all the new files that I´m adding?


Thanks in advance,


Regards.

8 REPLIES 8

ycoulon
Employee
Employee

Hi,

Maybe you can use rules.

Define a rules on the parent folder to "Specialise type"

You can also write a small JS file that will be called by the rule that do the same thing.

Yann

cesarista
World-Class Innovator
World-Class Innovator

Hi:

A very nice addon may be used for a similar proposal too (defining custom upload folders):

GitHub - softwareloop/uploader-plus: An Alfresco uploader that prompts for metadata 

Regards.

--C.

Thanks C,

I will try this plugin.

This plugin add metadata to files depending the folder where is located?

Regards

cesarista
World-Class Innovator
World-Class Innovator

Yes, you may define custom "upload folders" for using defined custom types from Alfresco Share Admin Console. 

Thanks for your response Cesar.

Regards!

kalpesh_c2
Star Collaborator
Star Collaborator

Hi,

You can create a rule on a folder to change a type of a documents when they are created or added to a folder.

In order to create such rule the most simple way is to create JavaScript file (.js) that contains a following code

var myAction = actions.create("specialise-type");
myAction.parameters["type-name"] = "{<url of your namespace>}<prefix>";
myAction.execute(document);

Place this this .js file at "Company Home/Data Dictionary/Scripts" folder in your repository. Ensure the mimetype is JavaScript. Create a rule on required folders. While defining a rule , select when "items are created or entered in this folder" and in perform action select "Execute script". Select the JS file you created.

Thanks,

Kalpesh

ContCentric

douglascrp
World-Class Innovator
World-Class Innovator

Kalpesh Patel‌ You can use this even shorter version:

document.specializeType("type-name");

Thanks ‌!