2

I need to enabled files with same name in same folder in Alfresco.

I try to create custom association, but I can't see the files in Share (bellow you can see my custom type code).

I can solve this changing the properties duplicate for true on contentModel.xml, but this type of global change is not recommended.

Any idea when I can enable duplicate files in Alfresco? Is correct create another type and define custom association for this OR do I really have to change the global file in contentModel.xml?

<type name="acme:project">
    <title>Project folder</title>
    <parent>cm:folder</parent>
    <associations>
        <child-association name="acme:contains">
            <source>
                <mandatory>false</mandatory>
                <many>true</many>
            </source>
            <target>
                <class>acme:document</class>
                <mandatory>false</mandatory>
                <many>true</many>
            </target>
            <duplicate>true</duplicate>
            <propagateTimestamps>false</propagateTimestamps>
        </child-association>
    </associations>
</type>

*PS: Sorry for my English.

Joerison
  • 51
  • 5
  • 1
    I'm under the impression that you should not even try to do this. Just think of name as something that is unique, and work around this (for example, have the duplicate title). – Lista Sep 18 '19 at 07:41
  • If I really couldn't try to do this, I think this property would not be in an xml configuration, but in a static final variable. The FK is not unique by name, but a key composed precisely to give conditions to have the same filename for the same folder. When using a **different** default association, I can't see the files in Alfresco share view (`cm: contains` ok, `acme:contains` not ok). And yes, in the scenario I have, I really need to have the same filename. Thanks for reply. – Joerison Sep 18 '19 at 13:55

2 Answers2

2

You can't configure this. Uniqueness on the filename in a directory is also enforced by a unique constraint directly in the database. You would break a lot of funktionallity if you change that. Alfresco implements the fileserver concepts and a fileserver only supports one file with the same path. Use your custom property instead.

Heiko Robert
  • 2,488
  • 11
  • 12
  • If I really couldn't change, I think this property would not be in an configuration xml, but in a static final variable. The FK is not unique by name, but a key composed precisely to give conditions to have the same filename for the same folder. When using a different default association, I can't see the files in Alfresco share view (`cm: contains` ok, `acme:contains` not ok). And yes, in the scenario I have, I really need to have the same filename. Thanks for reply. – Joerison Sep 18 '19 at 13:53
0

I don't have your use case, so my proposition may be unsatisfying, but : if you want to see your document in Share, it might be possible to custom your share interface to show another property than the document name, a property on which you can have the same value for nodes in the same folder.

Another proposition would be to categorise your documents and use the classification plan you made (with hierarchical categories instead of folder organisation) to access to your documents.

Akah
  • 1,890
  • 20
  • 28
  • Thanks for reply. Do you have an example or documentation that I can create custom share interface similar to explorer that already exists on share? – Joerison Sep 19 '19 at 14:15