Tim Telcik Blogs and Apps

General Blogs 13 ottobre 2015 Da Tim Telcik

Links

 

How to check the active permission algorithm in Liferay Portal 6.x

Technical Blogs 21 maggio 2014 Da Tim Telcik

Overview

Liferay Portal 5 and 6 support different permission algorithms.

Liferay Portal 5.2.x and 6.0.x supported permission algorithm 5. In addition, Liferay Portal 6.0.x introduced permission algorithm 6.

Brian Chan states, "Algorithm 6 is an improved version of Algorithm 5. It provides the exact same functionality, but reduces database size by 66%."

Please refer to the References section (below) for related links on permission algorithm 5 and 6.

If you are using Liferay Portal 5.2.x, you will be using permission algorithm 5.

But, if you are using Liferay Portal 6.0.x, you could be using permission algorithm 5 or 6.

How do you check which permission algorithm is active in Liferay Portal 6.0.x ?

Permission Algorithm Checks

Check 1 - Check Active Permission Algorithm Using System Admin Control Panel

  1. Navigate to "Control Panel > Server Administration > Properties > Portal Properties"
  2. Find property "permissions.user.check.algorithm" and confirm the value is 6.

Check 2 - Review Liferay Portal Database Tables

Permission algorithm 6 relies upon different tables and data in the database schema.

Review the row counts for the "Permission_" and "Resource_" tables.

Liferay Portal 6.0.x Permission Database Tables
Table Name LP 5.2.x Row Count LP 6.0.x Row Count
Permission_ 31+ 0
Resource_ 20+ 0

If permission algorithm 6 is active, the row count for the "Permission_" and "Resource_" tables will be 0 (empty).

References

 

How to verify data in Liferay Portal 6.0 or 6.1

Technical Blogs 11 giugno 2013 Da Tim Telcik

Overview

Liferay Portal 6.0 and 6.1 provide a data verification mechanism which can be used to resolve various data integrity issues, including the following data sets:

  • Asset
  • Blogs
  • Bookmarks
  • Calendar
  • Document Library
  • Group
  • Journal
  • Layout
  • Message Boards
  • Organization
  • Permission
  • Resource Permissions
  • Role
  • Social
  • User
  • Wiki

Data Verification Usage

Data verification is configured using 2 properties:

  • verify.processes - define verification suite or process to run (fully qualified Java class name)
  • verify.frequency - define frequency for running verification suite or process (-1, 1, 0).

The default values for these properties are listed below.

One approach to the data verification process is listed below:

  1. Enable DEBUG logging for data verification processes to monitor progress and potential issues.
  2. Enable data verification process suite (or individual process)
  3. Start Liferay Portal to trigger data verification process(es)
  4. Review the data verification suite log entries for potential issues.
  5. Shutdown Liferay Portal
  6. Disable data verification process
  7. Disable DEBUG logging for data verification processes

Default Data Verification Properties

FILE: portal-impl.jar!portal.properties

##
## Verify
##

    #
    # Input a list of comma delimited class name that implement
    # com.liferay.portal.integrity.VerifyProcess. These classes will run on
    # startup to verify and fix any integrity problems found in the database.
    #
    verify.processes=com.liferay.portal.verify.VerifyProcessSuite

    #
    # Specify the frequency for verifying the integrity of the database.
    #
    # Constants in VerifyProcess:
    #     public static final int ALWAYS = -1;
    #     public static final int NEVER = 0;
    #     public static final int ONCE = 1;
    #
    verify.frequency=1

 

Enable Data Verification

To enable data verification, update the "verify.frequency" property.

NOTE: Data verification is configured to only run once, as per the default properties.

NOTE: The default data verification process is the Verify Process Suite, which in turn runs many verification processes.

Edit "PORTAL_HOME/portal-ext.properties".

Update property "verify.frequency" to always run.

   verify.frequency=-1

Enable DEBUG level logging for category "com.liferay.portal.verify" package to show additional details.

Disable Data Verification

To disable data verification, update the "verify.frequency" property.

Edit "PORTAL_HOME/portal-ext.properties".

Update property "verify.frequency" to never run.

   verify.frequency=0

Sample Data Verification Run

Sample Data Verification Environment

Host O/S: Apple Mac OS X (10.8.4)

Database: MySQL 5.5.x

Liferay Portal: Liferay Portal 6.1. EE GA2 (6.1.20)

Liferay Portal Patches: announcements-1-6120, core-5-6120, documents-and-media-2-6120, dynamic-data-lists-1-6120, hotfix-55-6120, hotfix-56-6120, message-boards-1-6120, plugin-deployment-1-6120, security-hotfix-3-6120, service-builder-1-6120, tags-and-categories-1-6120, upgrade-2-6120

Sample Data Verification Log

Log File: TOMCAT/logs/catalina.out

Starting Liferay Portal Enterprise Edition 6.1.20 EE (Paton / Build 6120 / July 31, 2012)
11:41:48,604 INFO  [pool-2-thread-1][BaseDB:455] Database does not support case sensitive queries
11:41:50,018 DEBUG [pool-2-thread-1][VerifyProcessUtil:99] Initializing verification com.liferay.portal.verify.VerifyProcessSuite
11:41:50,044 DEBUG [pool-2-thread-1][VerifyProcessUtil:107] Running verification com.liferay.portal.verify.VerifyProcessSuite
11:41:50,050 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyProcessSuite
11:41:50,052 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyProperties
11:41:50,077 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyDB2
11:41:50,078 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyMySQL
11:41:58,627 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyOracle
11:41:58,631 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifySQLServer
11:41:58,631 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyCounter
11:41:58,710 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyUUID
11:41:58,739 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyPermission
11:42:09,396 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyRole
11:42:09,402 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyAsset
11:42:09,421 INFO  [pool-2-thread-1][UpgradeProcess:175] Upgrading com.liferay.portal.upgrade.util.UpgradeAssetPublisherManualEntries
11:42:09,702 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyBlogs
11:42:09,778 DEBUG [pool-2-thread-1][VerifyBlogs:35] Processing 0 entries with no asset
11:42:09,778 DEBUG [pool-2-thread-1][VerifyBlogs:54] Assets verified for entries
11:42:09,779 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyBookmarks
11:42:09,783 DEBUG [pool-2-thread-1][VerifyBookmarks:35] Processing 0 entries with no asset
11:42:09,784 DEBUG [pool-2-thread-1][VerifyBookmarks:54] Assets verified for entries
11:42:09,784 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyCalendar
11:42:09,801 DEBUG [pool-2-thread-1][VerifyCalendar:73] Processing 0 events with no asset
11:42:09,801 DEBUG [pool-2-thread-1][VerifyCalendar:91] Assets verified for events
11:42:10,039 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyDocumentLibrary
11:42:10,386 DEBUG [pool-2-thread-1][VerifyDocumentLibrary:169] Processing 0 file entries with invalid version
11:42:10,387 DEBUG [pool-2-thread-1][VerifyDocumentLibrary:181] Fixed misversioned file entries
11:42:10,838 DEBUG [pool-2-thread-1][VerifyDocumentLibrary:128] Processing 464 file entries with application/octet-stream
11:42:12,250 DEBUG [pool-2-thread-1][VerifyDocumentLibrary:160] Fixed file entries with invalid mime types
11:42:12,356 DEBUG [pool-2-thread-1][VerifyDocumentLibrary:240] Processing 0 file entries with no group
11:42:12,357 DEBUG [pool-2-thread-1][VerifyDocumentLibrary:261] Removed orphaned file entries
11:42:12,905 DEBUG [pool-2-thread-1][VerifyDocumentLibrary:270] Processing 0 file entries with no asset
11:42:12,905 DEBUG [pool-2-thread-1][VerifyDocumentLibrary:296] Assets verified for file entries
11:42:12,906 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyGroup
11:42:13,009 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyJournal
11:42:13,210 DEBUG [pool-2-thread-1][VerifyJournal:76] Permissions verified for structures
11:42:13,361 DEBUG [pool-2-thread-1][VerifyJournal:91] Permissions verified for templates
11:42:41,509 DEBUG [pool-2-thread-1][VerifyJournal:157] Permissions and assets verified for articles
11:42:45,634 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyLayout
11:42:49,085 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyMessageBoards
11:42:49,106 DEBUG [pool-2-thread-1][VerifyMessageBoards:110] Processing 34 categories for statistics accuracy
11:42:50,025 DEBUG [pool-2-thread-1][VerifyMessageBoards:135] Statistics verified for categories
11:42:53,546 DEBUG [pool-2-thread-1][VerifyMessageBoards:144] Processing 39028 threads for statistics accuracy
11:43:26,735 DEBUG [pool-2-thread-1][VerifyMessageBoards:161] Statistics verified for threads
11:43:27,209 DEBUG [pool-2-thread-1][VerifyMessageBoards:50] Processing 0 messages with no asset
11:43:27,210 DEBUG [pool-2-thread-1][VerifyMessageBoards:69] Assets verified for messages
11:43:27,249 DEBUG [pool-2-thread-1][VerifyMessageBoards:77] Processing 3 threads with no asset
11:43:27,253 WARN  [pool-2-thread-1][UserPersistenceImpl:965] No User exists with the primary key 80028
11:43:27,255 WARN  [pool-2-thread-1][VerifyMessageBoards:92] Unable to update asset for thread 96224: No User exists with the primary key 80028
11:43:27,260 WARN  [pool-2-thread-1][UserPersistenceImpl:965] No User exists with the primary key 80028
11:43:27,261 WARN  [pool-2-thread-1][VerifyMessageBoards:92] Unable to update asset for thread 96234: No User exists with the primary key 80028
11:43:27,265 WARN  [pool-2-thread-1][UserPersistenceImpl:965] No User exists with the primary key 80028
11:43:27,265 WARN  [pool-2-thread-1][VerifyMessageBoards:92] Unable to update asset for thread 129431: No User exists with the primary key 80028
11:43:27,266 DEBUG [pool-2-thread-1][VerifyMessageBoards:100] Assets verified for threads
11:43:27,267 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyOrganization
11:43:27,269 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyResourcePermissions
11:43:27,270 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifySocial
11:43:27,271 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyUser
11:43:27,311 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyWiki
11:43:29,693 DEBUG [pool-2-thread-1][VerifyWiki:34] Processing 0 pages with no asset
11:43:29,694 DEBUG [pool-2-thread-1][VerifyWiki:52] Assets verified for pages
11:43:29,695 INFO  [pool-2-thread-1][VerifyProcess:55] Verifying com.liferay.portal.verify.VerifyWorkflow
11:43:29,696 DEBUG [pool-2-thread-1][VerifyProcessUtil:113] Finished verification com.liferay.portal.verify.VerifyProcessSuite

References

How to check Liferay Portal plugin deployment issues

Technical Blogs 13 maggio 2013 Da Tim Telcik

Overview

A common problem developers and system admins face is tracking down why their Liferay Portal plugins fail to deploy to their Java web server.

There are many reasons why Liferay Portal plugins fail to deploy. Please refer to the checklist below for possible causes and solutions.

Environment

We will assume a simple test environment of Liferay Portal and Apache Tomcat:

  • Web Server Host: Any flavour of Unix, Linux or Windows NT
  • Liferay Portal: Liferay Portal 5.2.x, 6.0.x, 6.1.x
  • Web App Server: Apache Tomcat 6.0.x, 7.0.x

The author's test environments for preparing the checklist were:

  • Amazon EC2/AMI + Liferay Portal 6.1 EE GA2 (6.1.20) + Apache Tomcat 7.0.27
  • Mac OS X (10.8.3) + Liferay Portal 6.1 EE GA2 (6.1.20) + Apache Tomcat 7.0.27

Checklist

Purge Apache Tomcat Temp and Work Folders

Stale Apache temp and work files can cause various issues.

e.g. Unix/Linux/MacOSX

% cd LIFERAY_HOME/tomcat-xxx/
% rm -rf temp
% rm -rf work

NOTE: If you use the "rm" command with the recursive switch as "rm -rf", be very careful to only delete the target folder.

Review Apache Tomcat and Liferay Portal Log Files

  • Are any INFO, WARN or ERROR messages logged in the Liferay or Catalina log files ? There is often a clue in the log entries.

Review Liferay Portal Plugin Config Files

  • Check the Liferay Portal config files (*.xml, *.properties). Are the config files suitable for your target environment (i.e. is it an LP 5.2.x config file when an LP 6.1.x config file is expected) ?
  • Do not use both plugin package XML and plugin package properties file in your plugin package (*.war). Use plugin-package.properties file in favour of plugin-package.xml config file. If you use both, you must keep them in sync. Better to use only properties and allow Liferay Portal to build the XML during plugin auto deployment.

Review Timezones

NOTE: Assuming the local timezone is GMT+8 (Australia/Perth).

  • Is the user.timezone property in your Tomcat environment correct ?
    See TOMCAT_HOME/bin/setenv.sh
    ... -Duser.timezone=GMT ...
  • Is the timezone correct for your host web server ? If the target web server has a local time behind the time stamps for files in your Liferay Portal plugin (eg. my-portal.war, my-theme.war), the plugin may not deploy. Apache Tomcat uses a simple time-based strategy to deploy new web apps. If the WAR files are newer than Tomcat's local time, it may ignore the web app (*.war) files. In this case, it may ignore Liferay Portal plugins.
  • Is the Tomcat user.timezone property (above) the same as the web server host time zones (eg. are they both GMT)

Review File Ownership

  • Ensure the Liferay Portal plugin files (*.war) have the same user and group ownership as the Tomcat process. For example, if the Tomcat process is started by user liferay with group liferay, but the plugins files, such as my-portal.war and my-theme.war, are owned by user tim.telcik and group tim.telcik, Tomcat may not be able to deploy the plugin file(s).

How to fix popup page menu links in Liferay Portal 6.1 EE GA2 for Internet Explorer 9 on Windows 7

Technical Blogs 27 aprile 2013 Da Tim Telcik

Environment

  • Host Environment: MS Windows 7
  • Web Browser: MS Internet Explorer 9
  • Liferay Portal: 6.1 CE GA2 (6.1.1), 6.1 EE GA2 (6.1.20)
     

Issues

  • Popup page menu links for nested pages overlap portlet borders.

  • Popup page menu links disappear when the mouse hovers over them.

Solution(s)

  • Ensure intranet "Compatibility View” mode is disabled.

NOTE: The "Compatibility View" mode prevents the page from rendering correctly.

(i.e. HTML not rendered as expected, JavaScript functions do not behave)

How to reset the password for a Liferay Portal user

Technical Blogs 27 aprile 2013 Da Tim Telcik

Overview

If you need to reset the password for a Liferay Portal user in the database, refer to the following test steps.

Test Environment

These steps assume the following:

  • We are connecting to a MySQL database server.

  • User is stored in Liferay Portal database.

  • We are using default auth (not LDAP or SSO).

Test Steps

1/ Connect to Liferay Portal database schema


2/ Identify user who forgot their password

e.g.

select * from User_;


e.g.

select userId, screenName from User_;

Scan rows/columns for user by name or email address.


Locate target entry by "userId" or "screenName".

We will assume the user ID for our user is "10178" and screen name is "test".


3/ Confirm user by selecting user by their user ID or screen name

e.g.

select * from User_ where userId='10178';


eg.

select * from User_ where screenName='test';

 

4/  Reset password to default for user by user ID


We will reset the password to default "test".

e.g.

update User_
set password_='test', passwordEncrypted=0, passwordReset=0
where userId='10178';

e.g.

update User_
set password_='test', passwordEncrypted=0, passwordReset=0
where screenName='test';

 

5/ Commit user password change

e.g.

commit;

 

6/ Confirm new user password by selecting user using their user ID.


e.g.

select * from User_ where userId='10178';

e.g.

select * from User_ where screenName='test';

 

7/ Clear Liferay Portal database cache and/or restart Liferay Portal server

Clear portal caches.

8/ Login as user and user, then use Control Panel to reset password to something else


9/ Change the user ID and default password to suit.
 

Visualizzati 6 risultati.
Items 20
di 1