AngularJs: Problems with imagemin-gifsicle

I’ve been using the Yeoman Angular generator for my recent angular projects. Excellent tool. But when I run

grunt serve

to generate my dist folder, I kept getting errors related to imagemin-gifsicle. Something along the lines of:

Loading “imagemin.js” tasks…ERROR
>> Error: Cannot find module ‘imagemin-gifsicle’

The solution, after a little googling was found here. User anuragd comments that simply running

npm install grunt-contrib-imagemin –save-dev

should solve the issue. Sure enough, it did. Thanks anuragd!

Tagged

Liferay: How do you disable the Terms of Service page that comes up every time a new user logs in for the first time?

  1. Create a new Liferay project in the Liferay IDE of type Hook.
  2. Create a new file called portal.properties in docroot/WEB-INF/src.
  3. Add the line terms.of.use.required=false
Tagged ,

Where are files uploaded in Liferay stored?

When a file is uploaded in Liferay (through the Control Panel for example), it is stored in

[liferay.home]/data/document_library

To change the default location, add a line to portal-ext.properties:

dl.store.file.system.root.dir=${liferay.home}/data/document_library

Tagged ,

How to completely hide portlets with borders that are inactive or portlets that users do not have access to?

Let’s say you have a portlet that is only visible to logged in users. Once you set that up, by default, Liferay shows an error message in place of the portlet to unauthorized users. The error message looks something like this:

error

There are two ways to do this depending on what you want to achieve.

Let’s say you want to apply this to all portlets in the portal. To do this,

  1. Create / edit the portal-ext.properties file. It is located in the [TOMCAT_SERVER_FOLDER]\webapps\ROOT\WEB-INF\classes folder.
  2. Add the line layout.show.portlet.access.denied=false
  3. Restart the server

That should do it.

If you want to set this property on a per-portlet basis:

  1. Open up the portlets liferay-portlet.xml file (located under docroot\WEB-INF).
  2. Under the <portlet> tag, add <show-portlet-access-denied>false</show-portlet-access-denied>

Note that the second method overrides the first.

Tagged ,

Adding custom permissions in liferay

By default, all the documentation provided on Liferay is for JSP. For permissions-related configuration, read the LiferayInAction section (4.3.8 Protecting data with Liferay permissions), and then refer to http://kofler.nonblocking.at/2012/06/using-liferay-6-permissions-within-a-jsf-portlet/ for the finishing touches.

Tagged ,

Creating a portlet using the Liferay Eclipse IDE

This guide assumes that you have the Liferay Eclipse IDE, Liferay SDK and server set up already. The steps below create a basic portlet that is ready to use PrimeFaces.

Step 1: File->New->Liferay Project. Configure as per screen shot. Click Next.

 

2

Step 2: Choose JSF 2.x. Choose Primefaces. Click Finish.

2
Step 3: Open up faces-config.xml (docroot->WEB-INF->faces-config.xml). Replace <phase-listener>com.liferay.faces.bridge.lifecycle.BridgeDebugPhaseListener</phase-listener> with <phase-listener>com.liferay.faces.util.lifecycle.DebugPhaseListener</phase-listener>.Due to some bug in the IDE, the wrong value is populated in the XML. Until the bug is resolved, this is the workaround.

3

 

4

Step 4: By default, all Primefaces portlets use the “aristo” theme. If you need to change the theme, open up web.xml, located in docroot/WEB-INF, and follow the steps given in http://www.primefaces.org/themes.html. Note that changing the theme of one portlet changes the theme for all portlets on that page.
Step 5: Deploy the portlet by dragging the project from the Package Explorer to the Server. If the portlet is deployed successfully, it is now available to be added to the portal. Go to the portal in your web browser and log in. Once logged in, go to the “Add” menu option to the top-left of the screen and select “More…”

 

5

Step 6: Under the Sample option, you should find your portlet listed. Add it to your portal. Your portlet should show up after you refresh the page.

 

6

Tagged ,

Learning CodeIgniter

I’ve been trying to learn how to use CodeIgniter over the past few days. Have to say that it’s been quite easy. I spent a few hours following the basic tutorial that they have on their site and I picked up most of what was needed for me to build a website.

It’s a simple MVC framework. No extra bells and whistles. Only what’s required to get the job done. It does a good job of helping out but at the same time, staying out of your way. In some ways, it reminded me of Django, the python framework. The tutorials were clear and concise, the documentation was well laid out and the framework itself was easy to get started with.

I think I’m gonna enjoy working with CI.

Tagged ,

Drupal 7: Adding an event calendar

Tagged ,

Creating a Drupal 7 Proximity Search

Tagged ,
Follow

Get every new post delivered to your Inbox.

Join 52 other followers

%d bloggers like this: