Showing posts with label Liferay Portal. Show all posts
Showing posts with label Liferay Portal. Show all posts

Wednesday, December 19, 2012

Servidce/Util classes access in template (.vm) file in Liferay

Hi Developers,

Many times you need to access services/util class in template. 

Below is some importance hits for the same.

=> Access services using findService method in Velocity(vm)

#set ($userLocalService= $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
=>Access util class using  findUtil Method for inbuilt Util of Liferay
#set ($journalContentUtil = $utiLocator.findUtil("com.liferay.portlet.journalcontent.util.JournalContentUtil"))
=> some times you also need to access util class which is not have access in template file like StorageEngineUtil. for that you can use below approch..

#set ($util = $portal.getClass().forName("com.liferay.portlet.dynamicdatamapping.storage.StorageEngineUtil").newInstance()) 


HTH.. :))

Wednesday, December 12, 2012

Audio play in portlet using flowplayer.....



For mp3 audio file play you need below plugin swf & js file.

flowplayer.controls-3.2.14.swf
flowplayer.audio-3.2.10.swf
flowplayer-3.2.15.swf
flowplayer-3.2.6.min.js

and here is the sample code snippet to play mp3 audio file which in document library....

<< script type="text/javascript" src="/video-portlet/js/flowplayer-3.2.6.min.js"></script>

<< a href="http://localhost:8080/documents/10180/f7804b0c-9001-4f59-a7b2-45dcbceae8ca" style="display:block;width:520px;height:330px" id="unsecure">
            </a>
<< script type="text/javascript">
        $f("unsecure", "/video-portlet/flowplayer-3.2.15.swf",
                {
                    plugins: {
                        controls: {
                            fullscreen: true,
                            height: 30,
                            autoHide: false
                        },
                        audio: {
                            url: '/video-portlet/flowplayer.audio-3.2.10.swf'
                        }
                    },
                    clip:  {
                         provider: "audio"
                    }
                }
       
       
            );

        </script>


NOTE: "http://localhost:8080/documents/10180/f7804b0c-9001-4f59-a7b2-45dcbceae8ca" is a document library file url.

Thursday, September 6, 2012

Liferay portal connection with various databse

Hi visitor,

here is the list of  different/various database and it's connection properties to connection Liferay portal.

 MySQL

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=


 Oracle

jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.default.url=jdbc:oracle:thin:@localhost:1521:xe
jdbc.default.username=lportal
jdbc.default.password=lportal


DB2

jdbc.default.driverClassName=com.ibm.db2.jcc.DB2Driver
jdbc.default.url=jdbc:db2://localhost:50000/lportal:deferPrepares=false;fullyMaterializeInputStreams=true;fullyMaterializeLobData=true;progresssiveLocators=2;progressiveStreaming=2;
jdbc.default.username=db2admin
jdbc.default.password=lportal


 Derby

jdbc.default.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
jdbc.default.url=jdbc:derby:lportal
jdbc.default.username=
jdbc.default.password=


 Hypersonic

dbc.default.driverClassName=org.hsqldb.jdbcDriver
dbc.default.url=jdbc:hsqldb:${liferay.home}/data/hsql/lportal
dbc.default.username=sa
dbc.default.password=


 Ingres

jdbc.default.driverClassName=com.ingres.jdbc.IngresDriver
jdbc.default.url=jdbc:ingres://localhost:II7/lportal
jdbc.default.username=
jdbc.default.password=


 P6Spy

jdbc.default.driverClassName=com.p6spy.engine.spy.P6SpyDriver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=


 PostgreSQL

jdbc.default.driverClassName=org.postgresql.Driver
jdbc.default.url=jdbc:postgresql://localhost:5432/lportal
jdbc.default.username=sa
jdbc.default.password=


 SQL Server

jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
jdbc.default.url=jdbc:jtds:sqlserver://localhost/lportal
jdbc.default.username=sa
jdbc.default.password=


 Sybase

jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
jdbc.default.url=jdbc:jtds:sybase://localhost:5000/lportal
jdbc.default.username=sa
jdbc.default.password=