Has anyone had any success using Dojo in Liferay 7 (Liferay DXP) - dojo

We are currently trying to include Dojo in our liferay 7 application and are running into major difficulties, as it seems the AMD loader is clashing with the AMD loader of Liferay, and its preventing Dojo's define and require from working properly.
If anyone as a solution to getting dojo into Liferay 7 I would appreciate any advice or tips you have for getting this to work.

When using dojo application together with Liferay I could suggest you:
Keep dojo loader requiring only AMD modules from dojo and not Liferay, so use dojo only for dojo and Liferay only for Liferay.
Same when building the application, you need to have two separate build processes, dojo uses it own tools called dojo/util and you won't be able to easily build a dojo app using another builder.

Related

Migrate from dojo to standard bootstrap admin dashboard theme

I am using a php dojo v1.4 project with mysql as backend.
The UI looks very basic.
I need to migrate this project to a standard bootstrap admin theme.
What are the steps I need to do?
If backend and general architecture of your application will remain the same, I'd suggest you to start building new UI from the scratch. When it finished, write missing functions, which were previously implemented with dojo using jquery (which comes with bootstrap) or whatever you like.
I assume, that you are not going to use dojo anymore.
If you are facing some specific difficulties, you'd better provide more details in your question.

How to use built/compressed Dojo to resolve Dojo modules ref'ed from tests?

Currently, with my Intern setup, I'm using an unbuilt Dojo build when running my Intern tests; like, for example, a test module loads app/ProductModuleA, and ProductModuleA references and loads dojo/request. I need to have the dojo/request.js file in the appropriate directory structure in order for the module to be resolved without errors and therefore the test to be able to run. Our product code does use a built dojo.js file and our previous DOH tests were able to use this, too, without any issues--I don't understand how that worked because I don't know anything really about building Dojo.
I know I've seen snippets in various Internet forums (like here) and the Intern User Guide that Intern supports source maps, which I guess suggests it's possible to use a built dojo.js file in conjunction with running Intern, but I haven't found anything at all in detail. Insights, or pointers to documentation or examples that so far I haven't been able to find?
One of the benefits of AMD is that you don't have to do anything special to your code when switching between a built and unbuilt Dojo. The first time you load a dependency using an unbuilt Dojo, the loader requests it over the network and then caches the result. Subsequent loads use the cached dependency. The loading process works the same with a built Dojo; the main difference is that all the modules built into the built Dojo are pre-cached. The loader doesn't have to request them over the network the first time because they start out in the module cache.
For Intern to use a built Dojo, you just need to make sure you're using the built Dojo as your loader during tests. You can do this by setting the useLoader option in your Intern config.
I tried what Jason suggested and it still didn't work--I was getting 404s for a Dojo_ROOT.js module, though nothing in tests or product files explicitly load that. I'm sure this is due to something unique in my product's build environment. That's okay, I will just use the Dojo source for now and return to this later.

Site redesign in sitefinity 3.7

I need to redesign web site that has been done in Sitefinity 3.7. Current version is 6.3 ( I believe ).
I watched some tutorials about this CMS because I use it for the first time.
Can you tell me how much templating system differs in this old 3.7 version from current 6.3?
Is it possible to use Bootstrap 3?
We've been using Bootstrap in all of our recent Sitefinity implementations. I usually end up creating a vanilla, base page template off a .master page that includes references to the Bootstrap css and js, then create custom layout controls through Sitefinity's Visual Studio plugin, Thunder. Using the layouts you can easily create the markup needed for the grid layouts and components in Bootstrap so content editors can drag and drop them through the Sitefinity page edit interface. Editing the widget templates is another way to incorporate Bootstrap styling in the built in content modules.
Here is a project that has a Sitefinity Bootstrap theme, I believe the version of Bootstrap it uses is 2.31 though.
Update!
Jochem added Bootstrap version 3+ to the project, my fault for not seeing it, sorry Jochem! Direct link here

Can I use the dojo framework in Bottle templates, and if so, how?

I've used the dojo framework in websites with good results, and I'm trying to use it in my bottle templates with no luck. I'm loading the claro theme and the dojo javascript from the hosted version on google. None of my dijits are showing up, though. Am I unable to use external libraries with Bottle, or am I missing something basic?
Yes you can use external libraries with Bottle. Check your HTML if you have problems. If you're missing a closing tag, for example, things don't work as expected.

where can I get a XD version dojo source

WHere can I get a XD version of dojo source like the one hosted on google? What I want to do is to host dojo source from my local CDN, and my custom dojo module in my web application. Is this a good practice? or I might as well just include the dojo source in my web app, and run the custom build?
Thanks,
You can build an xd version of dojo from the source code
Here are instructions on how to do it:
http://dojotoolkit.org/reference-guide/1.7/quickstart/custom-builds.html
See the section on "doing xdomain builds"
In our organization (a large one), we do have a CDN version of dojo deployed on internal CDN mainly since some of our webapps are not allowed to access extranet (firewall issues).
For performance, though, a custom build gives biggest boost since it is customized to the modules you need/use - once the custom build is done, you only need to ship a single compressed js output file and a small number of supporting files
When doing your custom build, you can use the xdDojoPath and loader=xdomain if you wish to use cross domain dojo to load your optimized js - see http://osdir.com/ml/cometd-users/2011-08/msg00050.html for some notes on this
Also see related SO question: Dojo on a CDN vs own install
The good news is that with Dojo 1.7+ and the new loader, you don't have to do anything special for a cross domain build (good answer above from #Vijay Agrawal, but I think that reference guide link may need some updating for 1.7) Just write your code to the new AMD format, use asynch:true, run the build tools to create layers, and deploy them on any server. AMD makes use of callbacks and many of the tricks the old Dojo xd builder used to employ, but in a much simpler way.
To support older code, there is a legacy cross domain mode mentioned in the loader docs.