We have an issue with the theme we created for Liferay and to me it seems like we are doing something wrong, because it seems like a very stupid problem. We use Maven builds for all our plugins and therefore have a build artifact containing a version number. When we deploy the theme, it looks like Liferay creates an ID for the theme based on the theme name specified in the look and feel XML of the theme and the name of the .war file. It looks something like xxxx_WAR_yyyy, which is very confusing to me. When we deploy a new version of the theme, Liferay will create a different ID for it and thus all pages using the "old" theme, will not be updated to the new version.
There has to be some way to specify a unique ID for a theme that will never change, no matter what file the theme has been deployed as. The file name should not have any meaning for Liferay, in my opinion. Is there some way to do this? Obviously we could just always deploy the file with a fixed file name, but somehow it seems to me like we are doing something wrong, missing a configuration setting or something. Is there a way of forcing a unique ID on a theme?
In your pom.xml of theme project, give this
<artifactId>your-theme</artifactId>
<name>${project.artifactId}</name>
This should create a same name artifact when you deploy any version of your theme.
According to the first paragraph of the question as a solution i think , if at first you'll disable the older version theme(not only do it from admin section but also remove that specific theme directory from webapps) , then deploy the newer version of theme. Next enable the newer version theme for all public pages from liferay admin section .Then if you check , in all pages newer version of the theme been applied . If you wish , can also try in this way . Hope this'll be helpful .
Related
I have the following directory structure
The circled directories are the paths of the liferay tomcat server and the sdk respectively.
and I have the file build.osama.properties with the following settings :
app.server.parent.dir=D:\sources\lr_bundles\liferay_tomcat\liferay-ce-portal-7.0-ga3
app.server.tomcat.dir=${app.server.parent.dir}/tomcat-8.0.32
and when I try to create a liferay plugin project it keeps saying :
I am using LR 7 ga3 with tomcat 8 and sdk 7 ga3
Try with the slash using the *NIX way, or at least, double the '\', as it may be understood as an escape character.
app.server.parent.dir=D:/sources/lr_bundles/liferay_tomcat/liferay-ce-portal-7.0-ga3
or
app.server.parent.dir=D:\\sources\\lr_bundles\\liferay_tomcat\\liferay-ce-portal-7.0-ga3
and see if it helps.
Regards
If I were you, I'd reinstall the Liferay one more time with brief step-by-step instruction.
In a few words, you should install:
Database (if you want to use custom one)
Liferay Portal
Liferay IDE
Plugins SDK.
In the plugins SDK folder you should copy build.properties file, and change the copied build.propertis file name to build.osama.properties. (check this step one more time, may be your profile is named as Osama instead of osama). Then you should open newly created build.osama.properties file and uncomment following lines:
app.server.type=tomcat
app.server.parent.dir=${sdk.dir}/../bundles
app.server.tomcat.dir=${app.server.parent.dir}/tomcat-7.0.42
app.server.tomcat.deploy.dir=${app.server.tomcat.dir}/webapps
app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext
app.server.tomcat.portal.dir=${app.server.tomcat.dir}/webapps/ROOT
Make sure that app.server.type and app.server.dir properties should be correct.
In my case I had to combine previous answers ('/' instead of Windows' default '\') AND move liferay portal directory to C:/ (and point build.Username.Properties file to this directory).
I've created a very simple MVC application in VS2015 which has some basic CSS styling and some HTML to get an application off the ground more quickly.
The application runs perfectly.
I've exported this as a template using File -> Export Template...
I then created a brand new project based off this project type. So far so good. But, now when I run the newly created project I get a blank page with "Access Denied" (see image).
I've been going over the template project and the new project with a fine tooth comb and I can't find any differences. Why would one work but the other give an access denied? I am out of ideas, any help is appreciated.
EDIT:
After more research I have found the cause of the problem, but not a solution.
It seems that the project template has "Anonymous Authentication" as Disabled, and has "Windows Authentication" set to Enabled in the project settings. However when I create a project based on the template these values are flipped and thus causes the Access Denied.
Here's an image of the project settings in the template:
Here's an image of the project settings in the "new" project:
Note that both Authentication settings are flipped. Can anyone tell me how to get this to not happen?
Edit 2:
As suggested, the applicationhost.config files are different which is causing the above problem. Here is the applicationhost.config security section of the Template:
However, here is the same file in the new project created based off the template:
Notice that the section is missing entirely from the new project. So, now the question becomes how do you get this to copy over to new projects?
As suggested by BrianLegg I move my comments to an answer
Seems that the problem is related with the applicationhost.config file. This files it's not present on the zip file which contains the template.
You could take a look on the physical path attribute on
<system.applicationHost>
<sites>
Maybe it's trying to access to the first project instead the new one.
Could you check what is in your applicationHost.config template?
Take a look on Where is the template for applicationHost.config file stored
have you had a look at the global routes? it could be something routes not created or corrupted?
I want to make changes in look n feel of liferay, for that i have created themes using this link
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/creating-a-the-4
Everything worked fine. I saw mesaage BUILD SUCCESSFULL at the end. But the problem is After clicking on Manage > Page > Look and Feel, i didnt see any theme created by me. So please can u tell me wats wrong with this?
War file is created at Desktop/LR/bundles/deploy/deep-gray-theme-6.1.1.1.war
Should i get(import) this war file from liferay GUI so that themes would be available?
Just check your build.properties file, and to verify check if the theme is present in webapps folder.
I have been trying to customize IBM Connections UI and have been able to insert and execute code in header.jsp thanks to the material available on the web.
The problem is if I add a new image file under the themes directory in <IBM_CONNECTIONS>\data\shared\customization\themes\images, how do I reference this image in header.jsp? Surely I cannot use an absolute path here which is <IBM_CONNECTIONS>/connections/resources/web/com.ibm.lconn.core.styles.oneui3/images/myimage.png.
Similarly I would like to add a new JavaScript, but I am not able to figure out how to give its relative path in header.jsp.
The <CONNECTIONS_CUSTOMIZATION_PATH>/themes directory should only be used to override images referenced by existing stylesheets, or add new images for custom stylesheets. If all you need is to display an image, the recommended location is <CONNECTIONS_CUSTOMIZATION_PATH>/common/images (create subdirectories if necessary). The image will be available under every application's context root, e.g. /files/images/myimage.png
claudiopro, your solution works with /files/images/myimage.png and /profiles/images/myimage.png and so on. But what about main /homepage/
The url /homepage/images/myimage.png is not working.
Do you know how to avoid that?
Do you also know where the solution you provided is documented in IBM Knowledge Center?
In documentation of Connections 5.0 there are few pages about images and CSS custiomizations but some of those solutions are not even working, some are in contraty with each other...
I want to change look and feel of liferay using css. i am very new to liferay. Can any give me any idea to do the changes. Thanks in advance
The step-by-step seems complicated, but it's not that bad .....
1a) download and unpack the plugins sdk for the version of liferay you want to use. All the downloads are on the sf page http://lportal.sourceforge.net/
1b) make sure you have the latest version of ant and the JDK version that matches your liferay version (1.5.x or 1.6.x)
2) there are a few main folders in the kit. Change into the "themes" folder and run the create script there in this format (on linux or mac you'll need to make the .sh files executable)
c:\liferay\plugins\themes >create my-name "My Theme Description"
linux/mac $>./create.sh my-name "My Theme Description"
This will create a skeleton theme in a folder called my-name-theme and a folder within it called _diff.
Make whatever modifications you want WITHIN THE _diff FOLDER. (except changes to the properties file within WEB-INF)
Once you've made changes run "ant compile" from within the my-name-theme folder and the sdk will run through it's paces and spit out a .war file to the "dist" folder in the sdk root. You can upload this to the site using the plugin installer
OR ... if you configure the sdk to know where your development server is you can run "ant deploy" from the theme's folder and let the autodeploy magic in liferay do the work.
Once the theme is installed just assign it using the "look and feel" tab in the "manage pages" tool.
TIP : Make most of your changes to the custom.css file .... keeps things easy to upgrade.
TIP : Development is really slow for CSS if you do this for every change .... so if you're running a dev server add a style tag just before the end of the head tag that points into your _diffs/css folder. href="file:///...../_diffs/custom.css". This way whatever edits you make will be compiled into the next version of the war and will override the currently installed version without reuploading. make sure to remove the link before you put it on a live server.
The liferay.com documentation is great and there's a "themer's guide" i can't find the link to right now that got me started.
We've done a number of LifeRay customizations for various companies but your question is too vague for us to answer. If you are just looking to change a few colours and fonts then editing the CSS is fine, but if you are looking to completely change the layout then you need to delve in to the template files and start working with the XHTML.
Provide more details and we might be able to prod you in the right direction :D
IMO theme development for liferay can be quite slow to start with. I have found two different approach quite useful. It works for me, might work for you as well.
If you edit files inside _diff folder AFAIK you have to deploy every
time two see the changes , which can be quite frustrating for
front-end developers. An approch can be edit the css file directly
in tomcat/themename folder. Copy the changed every couple of hours
or so in the _diff folder and deploy. In my case the CSS stays in
C:\liferay-portal-6.1.0\tomcat-7.0.23\webapps\\css\
Also if you are aware liferay supports Sass now. So it you are writing Sass "deploy" may be you most likely option. But I have also figured out a way to speed up that process. Install ruby (if you are in windows, in Mac its preinstalled) > Install Compass > and create a blank compass project. Start "compass watch" . Open bothe scss file and the compiled css file in your IDE. "compass watch" will poll for changes in your scss file and put the compiled output in the css file. Every while you may copy the css output in the css file in theme folder or directly in firebug or web-inspector in chrome/safari.
I have found these are faster dev practice than deploying everytime or completely developing on firebug/web-inspector.
Also if anyone know of better method, specially things like only CSS/JS deploy (or simple copy for that matter if one is not writing Scss), please let us know.
You can make your custom style with the liferay plugins sdk, which can be found here: http://www.liferay.com/downloads/liferay-portal/additional-files
There is a themes folder included, in which you can create a new theme. Liferay generates here a basic theme as a boilerplate, which then you can customize and deploy to your liferay installation.
You can
mvn archetype:generate
then select “liferay-theme-archetype (Provides an archetype to create Liferay themes.)” et voilà you are ready tu customize your theme.
Best practice recommends that you make all your custom themes using only the custom.css file, and that you not override any of the templates unless absolutely necessary. This will make future upgrades far easier, as you won't have to manually modify your templates to add support for new Liferay features.
Deploy the newly created theme using
mvn clean package liferay:deploy