Using CDN with Liferay - liferay

We are using CDN for our custom theme. Now we want to do same for all Liferay static resources(js,images,css and fonts). Has anyone done this before? We are planning to move whole /html of ROOT to CDN. But we faced some issues regarding compass from some css files which imports compass. What is the ideal scenario while uploading Liferay's static resources to CDN? Any help? We are using cdn.host.http in portal-ext.properties.

Do not move resources from the webapp to the CDN! A lot of those things are not actual resources, but more of a ‘source’! For example, the css in the ROOT/html are actually SASS files and will not work if moved as is. The best solution is to use a Squid-like proxy to cache resources from the actual tomcat portal as they are requested.

Related

How do I deploy a GWT website without Google App Engine? Is it possible to use GitHub Pages?

The Issue
Hi, I made a GWT (Google Web Toolkit) website, but now that I am done, I'm not sure how to host the website.
The code is only client-side, so I'm not sure where the problem is.
I would be grateful for any advice on where and how to host a GWT website.
Here's the GWT app on GitHub: https://github.com/aryanka15/GWTCledgeTextParser
My attempt to use GitHub Pages: https://github.com/aryanka15/aryanka15.github.io
What I tried:
I tried using GitHub Pages, but it doesn't work, for some reason the JS file is not recognized by browsers or something like that.
The build Java with Ant Github Action doesn't work either.
I also tried using Google App Engine, but it is a very complicated process that I couldn't get working, and I would like to avoid it if possible.
Also, I used VSCode to develop the application, if that helps. I think that many of the Google App Engine plugins for IDE's like Eclipse are deprecated, but let me know if I'm wrong.
Thank you!
Nvm, I wasn't being very smart. I just had to change the html to index.html, make necessary adjustments in the js files, and added all the files inside war to GitHub with the same file structure.

Use SVN in opencms to keep versioning of site content

I am working with 10.5.4. I would like to use SVN to keep versioning of my site contents so as editors to be able to commit their changes. I have read a lot about mounting the VFS and that stuff, however with that way everyone coulld access and commit others changes
I would appreciate any further information about using versioning not only for module developments but also for site contents
I know, this is probably not exactly what you are looking for, but you may have a look at the OpenCms Maven plugin.
The main focus of this plugin is, to ease the development process of OpenCms projects. But with a good setup and Maven configuration you might use it to put the contents of your production site under version control. If you are interested, you'll find more information on the official website of the plugin.

Minify resource files with IIS, when using Java and .JSP

I was recommended that I move this question from StackOverflow to here.
I am running a web site on a server with Tomcat and IIS. I use .JSP and Java in the back end.
I don't know how to configure IIS to automatically minify resource files (CSS, JavaScript, images) when using .JSP. I have found a few suggested solutions online, but they all apply to IIS and .ASP.
I added the "compression" tag to this post because there is no "minification" tag available, but I am not referring to gzip compression, but removing white spaces, merging resources for faster download etc.
Could anyone help me figure out how to configure IIS to minify resource files with .JSP? Thank you!
Minification a process which combines multiple CSS or JS files to a single file and perform process of compression(whitespace removal) and obfuscation(JS) is an ideal build time solution, rather than a run time solution. While using Tomcat with IIS, it will be good to have some thing like this:
Use WRO4J as a maven build time plugin. Create an attribute like
devmode=true or false. In JSP's have if else condition to define
groups to add multiple CSS/JS or Single based on the devmode value.
While deploying use devmode = false. This with maven configuration will compile JSP with single CSS/JS files.
In IIS, configure a separate VD and map your static resources of war to it. Write a rewrite rule to instruct IIS to serve the static resources. Enable static compression.
The above said configuration will take less load on the CPU.
Some links of interest could be:
https://code.google.com/p/wro4j/wiki/MavenPlugin
Unobtrusive way to combine and compress javascript/css for java/spring/maven applications?

Where to put a library shared between portlets in Liferay?

I need to share a library (built in-house) between portlets and I prefer to put it in a common place instead of adding it as dependency to every portlet that need it because I want to update the library once. Can I build a hook or ext plugin that the portlets can refer to and access the library? I know that you can add it to the common library directory and add it to liferay-plugin-package.properties for each portlet but the location depends on the application server. I want to know, there is a standard or cleaner way to do this? Thanks in advance.
With the tomcat bundle, the common usage is to put these in the tomcat/lib/ext folder.
There is one big drawback, every modification in this folder will require a server restart.

deploying global.asax to sharepoint 2010 in an enterprise environment to enable unity DI container

Working on a SharePoint project I'm trying to use Unity as a dependency injection container.
My first idea to get this container running is using the global.asax as described in the best practices by P&P:
http://webclientguidance.codeplex.com/releases/view/17134#DownloadId=43305
In these best practices they tell you to manually edit the global.asax file to make it inherit SPUnityHttpApplication.
<%# Application Language="C#" Inherits="Unity.SharePoint.SPUnityHttpApplication" %>
Manually editing this file is not an option in enterprise environments since we have multiple environments (DTAP) and all of them have multiple frontend servers that would need manual steps.
I can't find any way to deploy a global.asax file by using a feature or wsp or anything because the global.asax is located in the web application root and sharepoint deploys other files to the /14 hive folder so you can't acces the web application root directory.
Alternatives i've looked into is the SharePointServiceLocator. this build in functionality does almost what i want. but it can only resolve classes that have a default constructor. this way i can't chain resolve all my implementations by using constructor injection. I found a post how to change the service locator to make use of unity but this doesn't seem to work properly if you read the comments.
My problem can be fixed by fixing 1 of these 2 main problems:
Don't arrange unity in the global.asax, but then where and how?
Deploy the global.asax in sharepoint? possible?
The global.asax doesn't seem to be the best solution to do this because of the deployment issues described in the question.
A viable solution is implementing this in a httpmodule
The init method can be used to wire everything up since this is called when the sharepoint application starts.
the httpmodule can be added in the web.config by a feature receiver
This way there is no need to do tricks with the global.asax that is located in a directory you can't deploy to with a feature and you have all the functionality and correct time to instantiate the DI container.
It may not be ideal, but you could look at using a feature receiver and write code to edit the existing files directly.

Resources