Addd custom models to different folders

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
geovanny_campov
Active Member II

Addd custom models to different folders

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
Moderator
Moderator

Re: Addd custom models to different folders

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
Advanced

Re: Addd custom models to different folders

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.

geovanny_campov
Active Member II

Re: Addd custom models to different folders

Thanks C,

I will try this plugin.

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

Regards

cesarista
Advanced

Re: Addd custom models to different folders

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

geovanny_campov
Active Member II

Re: Addd custom models to different folders

Thanks for your response Cesar.

Regards!

kalpesh_c2
Senior Member

Re: Addd custom models to different folders

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
Advanced II

Re: Addd custom models to different folders

Kalpesh Patel‌ You can use this even shorter version:

document.specializeType("type-name");

kalpesh_c2
Senior Member

Re: Addd custom models to different folders

Thanks ‌!