Monday, August 19, 2013

About namespace in Struts

Example

http://<server>:<port>/<webapp>/<namespace>/<action>.action
you want access action when add more namespace in file Struts
<package name="default" namespace="/login" extends="struts-default">
            <action name="index" class="com.webapp.action.CoreAction">
                  <result name="success">/index.jsp</result>
            </action>
      </package>




Have a good time!

Fix errors when build Service version liferay SDK 6.1

Error:
Service Builder is a tool to automate the creation of classes and interfaces for service layer  and database persistence. Service Builder will create most of the common code
required to implement add, update, remove, find operations on the database
You can get more detail about Liferay service builder for 6.1 version

I was getting an issue from developer studio. So I tried to build Liferay services using ant in console.

C:\Liferay\dev-sdk\portlets\my-portlet>ant build-service
Buildfile: C:\Liferay\dev-sdk\portlets\my-portlet\build.xml

build-service:
     [java] Java Result: 1
     [echo] Error occurred during initialization of VM
     [echo] Could not reserve enough space for object heap
     [echo] Could not create the Java virtual machine.

BUILD FAILED
C:\Liferay\dev-sdk\\build-common-plugin.xml:207: Service Builder generated exceptions.

I changed in Ant runtime arguments in eclipse Run->Run configuration", "VM arguments". But still I was getting same above issue.

solution as follows:

Solution : I found , in my dev-sdk, change the build-common-plugin.xml with following values.
I replaced
                <jvmarg value="-Xms512m" />
                <jvmarg value="-Xmx1024m" />
to
            <jvmarg value="-Xms128m" />
            <jvmarg value="-Xmx512m" />

C:\Liferay\dev-sdk\portlets\my-portlet>ant build-service
Buildfile: C:\Liferay\dev-sdk\portlets\my-portlet\build.xml

build-service:
…..
BUILD SUCCESSFUL
Total time: 32 seconds


I was able to solve the problem. Hope this will help.

Have a good time!

Liferay connect Database Oracle

When you run many version Liferay, it has a database available exist generate script. This is small database called HSQL database.If you want to deploy on different database, you need build new database corresponding to it such as Oracle, SQL Server, Mysql
Here is the connect with database Oracle:

create table Account_ (
accountId number(30,0) not null primary key,
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
parentAccountId number(30,0),
name varchar2(300) null,
legalName varchar2(300) null,
legalId varchar2(300) null,
legalType varchar2(300) null,
sicCode varchar2(300) null,
tickerSymbol varchar2(300) null,
industry varchar2(300) null,
type_ varchar2(300) null,
size_ varchar2(300) null
);

create table Address (
addressId number(30,0) not null primary key,
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
classNameId number(30,0),
classPK number(30,0),
street1 varchar2(300) null,
street2 varchar2(300) null,
street3 varchar2(300) null,
city varchar2(300) null,
zip varchar2(300) null,
regionId number(30,0),
countryId number(30,0),
typeId number(30,0),
mailing number(1, 0),
primary_ number(1, 0)
);

create table AnnouncementsDelivery (
deliveryId number(30,0) not null primary key,
companyId number(30,0),
userId number(30,0),
type_ varchar2(300) null,
email number(1, 0),
sms number(1, 0),
website number(1, 0)
);

create table AnnouncementsEntry (
uuid_ varchar2(300) null,
entryId number(30,0) not null primary key,
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
classNameId number(30,0),
classPK number(30,0),
title varchar2(300) null,
content varchar2(4000) null,
url varchar2(4000) null,
type_ varchar2(300) null,
displayDate timestamp null,
expirationDate timestamp null,
priority number(30,0),
alert number(1, 0)
);

create table AnnouncementsFlag (
flagId number(30,0) not null primary key,
userId number(30,0),
createDate timestamp null,
entryId number(30,0),
value number(30,0)
);

create table AssetCategory (
uuid_ varchar2(300) null,
categoryId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
parentCategoryId number(30,0),
leftCategoryId number(30,0),
rightCategoryId number(30,0),
name varchar2(300) null,
title varchar2(4000) null,
vocabularyId number(30,0)
);

create table AssetCategoryProperty (
categoryPropertyId number(30,0) not null primary key,
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
categoryId number(30,0),
key_ varchar2(300) null,
value varchar2(300) null
);

create table AssetEntries_AssetCategories (
entryId number(30,0) not null,
categoryId number(30,0) not null,
primary key (entryId, categoryId)
);

create table AssetEntries_AssetTags (
entryId number(30,0) not null,
tagId number(30,0) not null,
primary key (entryId, tagId)
);

create table AssetEntry (
entryId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
classNameId number(30,0),
classPK number(30,0),
classUuid varchar2(300) null,
visible number(1, 0),
startDate timestamp null,
endDate timestamp null,
publishDate timestamp null,
expirationDate timestamp null,
mimeType varchar2(300) null,
title varchar2(1020) null,
description varchar2(4000) null,
summary varchar2(4000) null,
url varchar2(4000) null,
height number(30,0),
width number(30,0),
priority number(30,20),
viewCount number(30,0)
);

create table AssetLink (
linkId number(30,0) not null primary key,
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
entryId1 number(30,0),
entryId2 number(30,0),
type_ number(30,0),
weight number(30,0)
);

create table AssetTag (
tagId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
name varchar2(300) null,
assetCount number(30,0)
);

create table AssetTagProperty (
tagPropertyId number(30,0) not null primary key,
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
tagId number(30,0),
key_ varchar2(300) null,
value varchar2(1020) null
);

create table AssetTagStats (
tagStatsId number(30,0) not null primary key,
tagId number(30,0),
classNameId number(30,0),
assetCount number(30,0)
);

create table AssetVocabulary (
uuid_ varchar2(300) null,
vocabularyId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
name varchar2(300) null,
title varchar2(4000) null,
description varchar2(4000) null,
settings_ varchar2(4000) null
);

create table BlogsEntry (
uuid_ varchar2(300) null,
entryId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
title varchar2(600) null,
urlTitle varchar2(600) null,
content clob null,
displayDate timestamp null,
allowPingbacks number(1, 0),
allowTrackbacks number(1, 0),
trackbacks clob null,
status number(30,0),
statusByUserId number(30,0),
statusByUserName varchar2(300) null,
statusDate timestamp null
);

create table BlogsStatsUser (
statsUserId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
entryCount number(30,0),
lastPostDate timestamp null,
ratingsTotalEntries number(30,0),
ratingsTotalScore number(30,20),
ratingsAverageScore number(30,20)
);

create table BookmarksEntry (
uuid_ varchar2(300) null,
entryId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
createDate timestamp null,
modifiedDate timestamp null,
folderId number(30,0),
name varchar2(1020) null,
url varchar2(4000) null,
comments varchar2(4000) null,
visits number(30,0),
priority number(30,0)
);

create table BookmarksFolder (
uuid_ varchar2(300) null,
folderId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
createDate timestamp null,
modifiedDate timestamp null,
parentFolderId number(30,0),
name varchar2(300) null,
description varchar2(4000) null
);

create table BrowserTracker (
browserTrackerId number(30,0) not null primary key,
userId number(30,0),
browserKey number(30,0)
);

create table CalEvent (
uuid_ varchar2(300) null,
eventId number(30,0) not null primary key,
groupId number(30,0),
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
title varchar2(300) null,
description varchar2(4000) null,
startDate timestamp null,
endDate timestamp null,
durationHour number(30,0),
durationMinute number(30,0),
allDay number(1, 0),
timeZoneSensitive number(1, 0),
type_ varchar2(300) null,
repeating number(1, 0),
recurrence clob null,
remindBy number(30,0),
firstReminder number(30,0),
secondReminder number(30,0)
);

create table ClassName_ (
classNameId number(30,0) not null primary key,
value varchar2(800) null
);

create table ClusterGroup (
clusterGroupId number(30,0) not null primary key,
name varchar2(300) null,
clusterNodeIds varchar2(300) null,
wholeCluster number(1, 0)
);

create table Company (
companyId number(30,0) not null primary key,
accountId number(30,0),
webId varchar2(300) null,
key_ clob null,
virtualHost varchar2(300) null,
mx varchar2(300) null,
homeURL varchar2(4000) null,
logoId number(30,0),
system number(1, 0),
maxUsers number(30,0)
);

create table Contact_ (
contactId number(30,0) not null primary key,
companyId number(30,0),
userId number(30,0),
userName varchar2(300) null,
createDate timestamp null,
modifiedDate timestamp null,
accountId number(30,0),
parentContactId number(30,0),
firstName varchar2(300) null,
middleName varchar2(300) null,
lastName varchar2(300) null,
prefixId number(30,0),
suffixId number(30,0),
male number(1, 0),
birthday timestamp null,
smsSn varchar2(300) null,
aimSn varchar2(300) null,
facebookSn varchar2(300) null,
icqSn varchar2(300) null,
jabberSn varchar2(300) null,
msnSn varchar2(300) null,
mySpaceSn varchar2(300) null,
skypeSn varchar2(300) null,
twitterSn varchar2(300) null,
ymSn varchar2(300) null,
employeeStatusId varchar2(300) null,
employeeNumber varchar2(300) null,
jobTitle varchar2(400) null,
jobClass varchar2(300) null,
hoursOfOperation varchar2(300) null
);

create table Counter (
name varchar2(300) not null primary key,
currentId number(30,0)
);




.....
Have a good time!!!