Foros de discusión

how to create portlet to read from text file

arei izuaf, modificado hace 14 años.

how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
Hai,

Actually, i'm new in Liferay.
I have a few question to ask about liferay.
I have text file that content all a page name that should created in layout table.
Could someone teach me how to create portlet to read from text file?

Tq
thumbnail
steve rieger, modificado hace 14 años.

RE: how to create portlet to read from text file

Expert Mensajes: 436 Fecha de incorporación: 11/09/06 Mensajes recientes
you have a text file with page names ? that you want LR to read and create pages from ?
or do you have a text file with content that you want to import into LR ?
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
thank for your reply.
my problem was like this...
i have around 17,000 children to add under 1 page...
all the 17,000 children already list in text file.
currently, i need to add one by one.
is there any solution to make process to add 17,000 page much more easier?
maybe, some program that can read from text file content 17,000 children and then add to a parent page...
for example...

page A
->page A1
->page A2
->pageA3
.....and so on

i hope someone can help me on this...
thanks in advance...
thumbnail
steve rieger, modificado hace 14 años.

RE: how to create portlet to read from text file

Expert Mensajes: 436 Fecha de incorporación: 11/09/06 Mensajes recientes
how about direct inserts into the db ?
an easier way would be to script it into a lar file
export the current pages into a lar file,
find the location that you want to add new ones and create them in the lar file, then import the lar file into LR
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
steve rieger:
how about direct inserts into the db ?
an easier way would be to script it into a lar file
export the current pages into a lar file,
find the location that you want to add new ones and create them in the lar file, then import the lar file into LR


i will try your solution...
thanks for reply...
thumbnail
Victor Zorin, modificado hace 14 años.

RE: how to create portlet to read from text file

Liferay Legend Mensajes: 1228 Fecha de incorporación: 14/04/08 Mensajes recientes
For adding pages use com.liferay.portal.service.LayoutServiceUtil class, there is a good method for this:
LayoutServiceUtil.addLayout(groupId, privateLayout,
parentLayoutId, name, title, description, type, hidden,
friendlyURL);

At the same time, having 17,000 pages in a single portal may be not such a good idea. If all 17K pages have the same layout and style but different content --> a better apporach would be to produce single page but provide access to a different content using http parameters or making custom friendly URL, like MessageBoard or similar portlets do.

When you have 1000+ pages, you may experience problems managing them.

Related links:
How to use liferay for Larger Sites
What is the Maximum limit of pages?
Workaround for Changing public/private pages after users already added
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
Victor Zorin:
For adding pages use com.liferay.portal.service.LayoutServiceUtil class, there is a good method for this:
LayoutServiceUtil.addLayout(groupId, privateLayout,
parentLayoutId, name, title, description, type, hidden,
friendlyURL);

At the same time, having 17,000 pages in a single portal may be not such a good idea. If all 17K pages have the same layout and style but different content --> a better apporach would be to produce single page but provide access to a different content using http parameters or making custom friendly URL, like MessageBoard or similar portlets do.

When you have 1000+ pages, you may experience problems managing them.

Related links:
How to use liferay for Larger Sites
What is the Maximum limit of pages?
Workaround for Changing public/private pages after users already added


sir,

can you provide me a step by step how to use com.liferay.portal.service.LayoutServiceUtil class
i'm totally zero on java or porlet...

tq
thumbnail
Victor Zorin, modificado hace 14 años.

RE: how to create portlet to read from text file

Liferay Legend Mensajes: 1228 Fecha de incorporación: 14/04/08 Mensajes recientes
... step by step .. i'm totally zero on java or porlet...

Would be glad to help , but unfortunately I do not think that 'step-by-step' guidelines are going to work without any java experience. You would really need someone with java+liferay experience to do such implementation. There is always a dilemma of engaging someone to automate the process vs using your own time to click buttons 17,000+ times. Choose whatever option is going to be better for you.
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
Victor Zorin:
... step by step .. i'm totally zero on java or porlet...

Would be glad to help , but unfortunately I do not think that 'step-by-step' guidelines are going to work without any java experience. You would really need someone with java+liferay experience to do such implementation. There is always a dilemma of engaging someone to automate the process vs using your own time to click buttons 17,000+ times. Choose whatever option is going to be better for you.


thanks for reply.
i've already develop a program in VB to insert data direct into database.
table that involve is layout and portlet preference.
my program working fine...all data successfully insert in tables.
but my problem is, when i choose to manage or add application into page that created by my program, LF show an error...
is that any table involve?
hope to see your answer soon.

tq
thumbnail
Victor Zorin, modificado hace 14 años.

RE: how to create portlet to read from text file

Liferay Legend Mensajes: 1228 Fecha de incorporación: 14/04/08 Mensajes recientes
I am afraid that direct inserts into tables may not work in this particular case, as many more tables may require relevant updates, such as permissions, etc. To understand which tables require updates you would have to go through the source code which is not really feasible. No valid results can be guaranteed unless Liferay Service API is used to populate portal data.

May be you can use VB to create and populate export/import lar files, as suggested by Steve. They have xml format, it may work for you. To get the lar file format, export one of your sample layouts and then edit them manually or by VB.
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
how to export page to become LAR file?
how can i open and read LAR file?

tq
kehsihba eejrenab, modificado hace 14 años.

RE: how to create portlet to read from text file

Junior Member Mensajes: 82 Fecha de incorporación: 16/07/09 Mensajes recientes
Q. How to export page as lar file.
Ans- Go to manage pages-->Settings -->Export Import and click Export to save the settings as LAR file.

Q. How to open a lar file?
Ans- LAR file is like a zip or rar file use winrar or winzip or any file compression utility to open it. I will contain the page settings in a text file.


As per your requirement.If I am correct , you have 17000 users and you want to each of them a separate login page on login.

If I am correct , u need to check for user groups,communities, private and public page and user friendly url in liferay

hint: add users into liferay.
create a new group in liferay
add the users to the group (or u can specify default association in settings of control panel.)
create a new community on liferay and assign a new private page to the community.Add a common set of portlets to it.
add the user group to the community
make the community page as default in liferay.

now whenever the user logs in , he can see a new page exclusively for the user.

for various different set of portelts . use combinatio of communities and groups.

It will solve the burden of creating 17000 pages.


regadrs
Kehsihba
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
acctually here are my page structure

A - Agriculture >> 01 - Crop and animal production >> 011 - Growing of perennial crops >> 0111 - Growing of oleaginous fruits >> 01111 - Growing of oil palm

B - Foresty >> 04 - animal production >> 041 - Growing of .... >> 0411 - Growing of .... >> 04111 - Growing of ...

and so on...

A is a sector (sector have 22 - all layout are same)
01 is a division (division have 99 - all layout are same)
011 is a group (group have 659 - all layout are same)
0111 is a class (class have 8653 - all layout are same)
01111 is a item (item have 95603 - all layout are same)

i already look into LAR file, and i think it's a lot of work need to modify in order to add all of the page...
thumbnail
Victor Zorin, modificado hace 14 años.

RE: how to create portlet to read from text file

Liferay Legend Mensajes: 1228 Fecha de incorporación: 14/04/08 Mensajes recientes
Extra questions,
What type of content/portlets is going to be placed into each layout? How are you going to fetch/populate it?
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
Victor Zorin:
Extra questions,
What type of content/portlets is going to be placed into each layout? How are you going to fetch/populate it?


first, i create the sample page for each page (1 for sector, 1 for division, 1 for group, 1 for class and 1 for item)..
based on sample page i'll copy their layout for the others...
let say for next sector is B, this page will copy A layout..including its portlet and content...

for the content, my user will write manually...
my job is to create the page structure...
thumbnail
Victor Zorin, modificado hace 14 años.

RE: how to create portlet to read from text file

Liferay Legend Mensajes: 1228 Fecha de incorporación: 14/04/08 Mensajes recientes
You can definitely create a Java scipt which will generate 17K of independent pages, it is probably a maximum of 2 days of effort. I still think that the major issue is going to be having 17K of layout entries in a portal and I am afraid that 'Manage Pages' may not work for you properly. Plus it may be an additional handicap for portal in terms of performance.
It could be worthwhile to spend a couple of weeks of writing a portlet that will render information based on URL. This way you will only have to create only ONE page but display 17K pieces of data according to the asked URL.
It will position your system well for future extensions without pre-setting any limits and avoiding evident performance-related issues. Something similar to WIKI or Blog or other Knowledge-based porlets may do work for you, you would just have to make some effort making URL mapping working according to your requirements.
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
Victor Zorin:
You can definitely create a Java scipt which will generate 17K of independent pages, it is probably a maximum of 2 days of effort. I still think that the major issue is going to be having 17K of layout entries in a portal and I am afraid that 'Manage Pages' may not work for you properly. Plus it may be an additional handicap for portal in terms of performance.
It could be worthwhile to spend a couple of weeks of writing a portlet that will render information based on URL. This way you will only have to create only ONE page but display 17K pieces of data according to the asked URL.
It will position your system well for future extensions without pre-setting any limits and avoiding evident performance-related issues. Something similar to WIKI or Blog or other Knowledge-based porlets may do work for you, you would just have to make some effort making URL mapping working according to your requirements.


sir,
can i have a java script code to generate 17k page?
i'm totally no idea how to do that?

tq
thumbnail
Victor Zorin, modificado hace 14 años.

RE: how to create portlet to read from text file

Liferay Legend Mensajes: 1228 Fecha de incorporación: 14/04/08 Mensajes recientes
sorry I meant a Java code, not java script.
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
Victor Zorin:
sorry I meant a Java code, not java script.


it's ok...
i'll find another way to solve my problem.
anyway...merry christmas
arei izuaf, modificado hace 14 años.

RE: how to create portlet to read from text file

New Member Mensajes: 22 Fecha de incorporación: 17/12/09 Mensajes recientes
hai...

finally, i found the way how to insert layout automaticcally.
acctually it's just a trick using web form...
thanks to all of you that give me a support...