cancel
Showing results for 
Search instead for 
Did you mean: 

Adding metadata to default file type or setting custom type of document as default

tomekszy
Confirmed Champ
Confirmed Champ

Hi,

I want to add a custom values (metadata fields) to standard type in Alfresco. I tried to add custom types in model, with all metadata that I need, but still after adding file, I have to manually change type so Alfresco will show me my custom fileds of metadata. This is how it looks now:

I have some metadata in Models/Custom Types:

Zrzut ekranu 2016-10-12 10.56.22.png

So if I add a file (to sites/document library), I have to change type, so alfresco shows me my custom metadata:

Zrzut ekranu 2016-10-12 10.53.07.png

Then metadata could be filled:

Zrzut ekranu 2016-10-12 10.53.52.png

But I want my custom metadata fields to be added for all files, which I put to Alfresco like that:

Zrzut ekranu 2016-10-12 10.59.33.png

But without changing file types in first place. For example that all added files will have automatically set type to my custom one or to add my metadata to default file type. How can I do that?

1 ACCEPTED ANSWER

1. you might need to create 2 rules on 'User Homes' and your 'Sites' and check the 'apply to subfolders'

2. you need to make your type visible in share: Share configuration for custom types and properties | Alfresco Documentation

3. you can do that, but as Douglas C. R. Paes​ already pointed out, thats probably not what you want. it can lead to problems.

1 thing to know about specializing an item is => you can not 'unspecialize' it once its in the repo. and your users can potentially upload anything.

do you want 1000 jpeg's of somebodies cat with your special type? i don't think so.

create a strict rule that only applies your type to the files that really need it.

View answer in original post

16 REPLIES 16

mrks_js1
Star Contributor
Star Contributor

To do that, you need a folder-rule with "Specialise the type of an item" action

Change content type after upload

I think it's not I wanted to do, because I wanted all files that came into repository get specific type type, not only ones in specific folder. I don't want to set all new folders created by users with rules. I'm thinking about more "global" approach, maybe editing some xml file in alfresco server, but i don't know which file, and what to edit

douglascrp
World-Class Innovator
World-Class Innovator

Tomasz, you folder rule can be applied in a lower level, like, for the documentLibrary folder for a site.

But you have to make sure you don't deal with ALL objects being created, because there are OOTB objects created by alfresco that can not be specialized for custom types.

So, the ideal approach is to use a filter, like, for all documents created, AND with mime type of doc, docx, pdf, txt, whatever, then specialize it.

tomekszy
Confirmed Champ
Confirmed Champ

Ok, I tried to do that, but I have 3 questions:

1. How can I use that rule to all folders in all users and sites?

2. When I try to use that rule, I can't find my set of metadata (called Metadane), there is only Inteligent Folder Template, and Place to transfer files

Is it something I do wrong?

3. Maybe there is an option to add my custom metadata to all base metadata included in default type? (there are some metadata present in all types like e.g. Name, can I add some of my custom metadata there?)

1. you might need to create 2 rules on 'User Homes' and your 'Sites' and check the 'apply to subfolders'

2. you need to make your type visible in share: Share configuration for custom types and properties | Alfresco Documentation

3. you can do that, but as Douglas C. R. Paes​ already pointed out, thats probably not what you want. it can lead to problems.

1 thing to know about specializing an item is => you can not 'unspecialize' it once its in the repo. and your users can potentially upload anything.

do you want 1000 jpeg's of somebodies cat with your special type? i don't think so.

create a strict rule that only applies your type to the files that really need it.

tomekszy
Confirmed Champ
Confirmed Champ

I tried to do that, and I get the error "unable to change file type" when I want to change it in single file, and it didn't appeard in rules for directories. But leave it for now.

I have another idea. All I want to do is just add some of my metadata fields in common metadata (by common metadata I mean Name, Title, Description, Author - I just want to add there some other fields), so all files independently of type, will get few extra metadata fields. Can I do that? File types will be the same, just want to add some custom fileds in file properties.

Thank you all for all your previous replies.

is there an error message in your log file when you tried to specialize?

you can edit the default model but it is not recommended to do that. and that change will not work retroactively.

I will send my log in monday, but I want to ask, how to edit alfresco's default model?