10-25-2021 12:32 PM
I have created a custom aspect, and it's working fine. My problem is in the share-config-custom. So for the standard DocumetLibrary evaluator I have this:
<config evaluator="string-compare" condition="DocumentLibrary"> .... <aspects> <addable /> <!-- defaults to visible config --> <removeable /> <!-- defaults to visible config --> </aspects> </config>
And when I go and click "Manage Aspects" in the repo browser, it looks like all availabe aspects are listed, except of course, mine.
I can add it specifically like this:
<aspects> <visible> <aspect name="damsasp:adHoc" /> </visible> <addable> <aspect name="damsasp:adHoc" /> </addable> <removeable> <aspect name="damsasp:adHoc" /> </removeable> </aspects>
But then that is the ONLY aspect in the list.
Is there a way to do both? Or am I going to have to manually add all the aspects?
10-25-2021 05:15 PM
I see typo in your config, it should be "removable" instead of "removeable". Your approach seems correct but here are some additional details.
The default ootb config for DocumentLibrary is:
<config evaluator="string-compare" condition="DocumentLibrary"> <aspects> <visible> <aspect name="cm:generalclassifiable" /> <aspect name="cm:complianceable" /> <aspect name="cm:dublincore" /> <aspect name="cm:effectivity" /> <aspect name="cm:summarizable" /> <aspect name="cm:versionable" /> <aspect name="cm:templatable" /> <aspect name="cm:emailed" /> <aspect name="emailserver:aliasable" /> <aspect name="cm:taggable" /> <aspect name="app:inlineeditable" /> <aspect name="cm:geographic" /> <aspect name="exif:exif" /> <aspect name="audio:audio" /> <aspect name="cm:indexControl" /> <aspect name="dp:restrictable" /> </visible> <addable> </addable> <removeable> </removeable> </aspects> .. </config>
When you are adding your custom aspects, make sure no where 'replace="true"' is set in either your custom module or at '/shared/classes/alfresco/web-extension/' level.
<config evaluator="string-compare" condition="DocumentLibrary" replace="true">..</config>
If above setting is set, out of the box configuration will get replaced.
To keep ootb aspects and your custom aspects together. You can (read the comments):
<config evaluator="string-compare" condition="DocumentLibrary"> <aspects> <!-- Aspects that a user can see in UI. Used by Rules, aspects are the listed aspects for rule's "has-aspect" action condition. --> <visible> <aspect name="damsasp:adHoc" /> </visible> <!-- Aspects that a user can add in UI. Used by Rules, aspects are the listed aspects for rule's "add-features" action. Same as "visible" if left empty. --> <addable> <aspect name="damsasp:adHoc" /> </addable> <!-- Aspects that a user can remove in UI. Used by Rules, aspects are the listed aspects for rule's "remove-features" action. Same as "visible" if left empty --> <removable> <aspect name="damsasp:adHoc" /> </removable> </aspects> </config> OR <config evaluator="string-compare" condition="DocumentLibrary"> <aspects> <!-- Aspects that a user can see in UI. Used by Rules, aspects are the listed aspects for rule's "has-aspect" action condition. --> <visible> <aspect name="damsasp:adHoc" /> </visible> <!-- Aspects that a user can add in UI. Used by Rules, aspects are the listed aspects for rule's "add-features" action. Same as "visible" if left empty. --> <addable> </addable> <!-- Aspects that a user can remove in UI. Used by Rules, aspects are the listed aspects for rule's "remove-features" action. Same as "visible" if left empty --> <removable> </removable> </aspects> </config>
Try fixing your config and see if it works.
10-25-2021 05:15 PM
I see typo in your config, it should be "removable" instead of "removeable". Your approach seems correct but here are some additional details.
The default ootb config for DocumentLibrary is:
<config evaluator="string-compare" condition="DocumentLibrary"> <aspects> <visible> <aspect name="cm:generalclassifiable" /> <aspect name="cm:complianceable" /> <aspect name="cm:dublincore" /> <aspect name="cm:effectivity" /> <aspect name="cm:summarizable" /> <aspect name="cm:versionable" /> <aspect name="cm:templatable" /> <aspect name="cm:emailed" /> <aspect name="emailserver:aliasable" /> <aspect name="cm:taggable" /> <aspect name="app:inlineeditable" /> <aspect name="cm:geographic" /> <aspect name="exif:exif" /> <aspect name="audio:audio" /> <aspect name="cm:indexControl" /> <aspect name="dp:restrictable" /> </visible> <addable> </addable> <removeable> </removeable> </aspects> .. </config>
When you are adding your custom aspects, make sure no where 'replace="true"' is set in either your custom module or at '/shared/classes/alfresco/web-extension/' level.
<config evaluator="string-compare" condition="DocumentLibrary" replace="true">..</config>
If above setting is set, out of the box configuration will get replaced.
To keep ootb aspects and your custom aspects together. You can (read the comments):
<config evaluator="string-compare" condition="DocumentLibrary"> <aspects> <!-- Aspects that a user can see in UI. Used by Rules, aspects are the listed aspects for rule's "has-aspect" action condition. --> <visible> <aspect name="damsasp:adHoc" /> </visible> <!-- Aspects that a user can add in UI. Used by Rules, aspects are the listed aspects for rule's "add-features" action. Same as "visible" if left empty. --> <addable> <aspect name="damsasp:adHoc" /> </addable> <!-- Aspects that a user can remove in UI. Used by Rules, aspects are the listed aspects for rule's "remove-features" action. Same as "visible" if left empty --> <removable> <aspect name="damsasp:adHoc" /> </removable> </aspects> </config> OR <config evaluator="string-compare" condition="DocumentLibrary"> <aspects> <!-- Aspects that a user can see in UI. Used by Rules, aspects are the listed aspects for rule's "has-aspect" action condition. --> <visible> <aspect name="damsasp:adHoc" /> </visible> <!-- Aspects that a user can add in UI. Used by Rules, aspects are the listed aspects for rule's "add-features" action. Same as "visible" if left empty. --> <addable> </addable> <!-- Aspects that a user can remove in UI. Used by Rules, aspects are the listed aspects for rule's "remove-features" action. Same as "visible" if left empty --> <removable> </removable> </aspects> </config>
Try fixing your config and see if it works.
Explore our Alfresco products with the links below. Use labels to filter content by product module.