How to avoid multiple define error while referring custom libraries?

cancel
Showing results for 
Search instead for 
Did you mean: 
mageshvg
Active Member

How to avoid multiple define error while referring custom libraries?

Jump to solution

Hello Everyone,

I have created a surf page in my alfresco share in my AMP application.

In this page, the view FTL file, i have made a simple angular application. for this application we have referred some javascript library related to angular and jQuery libraries.

I am getting error like this below:

For setup a tiny-mce editor for application also i can't able to add cdn link for latest version of Tinymce-4.7.X.

I know alftesco already contains tiny-mce editor. But i want to know how to overcome this multiple define error.

How to override define block in dojo loader and how to refer custom libraries.

1 Solution

Accepted Solutions
afaust
Master

Re: How to avoid multiple define error while referring custom libraries?

Jump to solution

Simple: Do not use any of the template instances that Alfresco bundles out-of-the-box. By following that documentation page you linked, you should already be using a custom template instance you control.

View solution in original post

4 Replies
afaust
Master

Re: How to avoid multiple define error while referring custom libraries?

Jump to solution

Ideally, you'd only try to load libraries in other version other than provided by default in completely custom pages wihtout any Share / Aikau components in it. Otherwise you will always risk conflicts - even Alfresco managed to produce a conflict they now do not intend to fix.

It is technically possible to override the global Dojo loader initialisation, but it is the absolute wrong thing to do. If you want to extend Share, you'd do best to work within the libraries already provided to avoid a lot of problems. If you want to have something drastically different, create a custom Surf page that does NOT use any of the default page templates Alfresco provides and use your own, so you have full control over what libraries get loaded in the global context. But be aware that you will likely not be able to use any of the default Share components in that page, i.e. the standard Share menu rendered by Aikau widgets.

mageshvg
Active Member

Re: How to avoid multiple define error while referring custom libraries?

Jump to solution

Hi Axel,

Apologies for delay.

I have followed the way below to create a page in Share.

Adding a new Surf page to Share | Alfresco Documentation 

Could you please explain your below words in detail:

"If you want to have something drastically different, create a custom Surf page that does NOT use any of the default page templates Alfresco provides and use your own, so you have full control over what libraries get loaded in the global context"

How to create a surf page which does NOT have any of the default  page templates Alfresco provides?

afaust
Master

Re: How to avoid multiple define error while referring custom libraries?

Jump to solution

Simple: Do not use any of the template instances that Alfresco bundles out-of-the-box. By following that documentation page you linked, you should already be using a custom template instance you control.

mageshvg
Active Member

Re: How to avoid multiple define error while referring custom libraries?

Jump to solution

Thank you Axel