Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
How to use liferay for Larger Sites Auditya manikanta Vadrevu February 25, 2009 9:45 PM
RE: How to use liferay for Larger Sites Victor Zorin February 25, 2009 10:20 PM
RE: How to use liferay for Larger Sites Auditya manikanta Vadrevu February 25, 2009 11:27 PM
RE: How to use liferay for Larger Sites Victor Zorin February 26, 2009 12:06 AM
RE: How to use liferay for Larger Sites Auditya manikanta Vadrevu February 26, 2009 1:11 AM
RE: How to use liferay for Larger Sites Victor Zorin May 14, 2009 8:14 PM
RE: How to use liferay for Larger Sites Auditya manikanta Vadrevu February 26, 2009 1:38 AM
RE: How to use liferay for Larger Sites Victor Zorin May 14, 2009 8:15 PM
RE: How to use liferay for Larger Sites Auditya manikanta Vadrevu February 26, 2009 3:09 AM
RE: How to use liferay for Larger Sites Victor Zorin March 4, 2009 11:36 PM
RE: How to use liferay for Larger Sites Auditya manikanta Vadrevu March 5, 2009 3:21 AM
RE: How to use liferay for Larger Sites Victor Zorin March 5, 2009 1:28 PM
RE: How to use liferay for Larger Sites Auditya manikanta Vadrevu March 5, 2009 9:51 PM
RE: How to use liferay for Larger Sites Victor Zorin March 5, 2009 10:32 PM
RE: How to use liferay for Larger Sites Auditya manikanta Vadrevu March 8, 2009 10:12 PM
RE: How to use liferay for Larger Sites Victor Zorin March 8, 2009 11:10 PM
RE: How to use liferay for Larger Sites deva v June 1, 2009 2:58 AM
RE: How to use liferay for Larger Sites Lisa Simpson October 5, 2009 9:03 AM
RE: How to use liferay for Larger Sites Samujjwal Sahu January 28, 2013 2:03 AM
RE: How to use liferay for Larger Sites Victor Zorin January 28, 2013 8:39 PM
RE: How to use liferay for Larger Sites Samujjwal Sahu January 28, 2013 11:13 PM
RE: How to use liferay for Larger Sites Victor Zorin January 29, 2013 12:17 AM
RE: How to use liferay for Larger Sites Samujjwal Sahu January 29, 2013 3:29 AM
RE: How to use liferay for Larger Sites Jacques Traore April 21, 2013 7:14 PM
RE: How to use liferay for Larger Sites jose fernandez May 30, 2013 2:26 AM
RE: How to use liferay for Larger Sites Rob Zondag April 16, 2014 7:56 AM
Auditya manikanta Vadrevu
How to use liferay for Larger Sites
February 25, 2009 9:45 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi,
i have a requirement where i need to maintain a large site in liferay portal.

The website contains almost 800 pages. How to migrate from that site to our portal.

One way is to start creating all pages, journal contents etc.., (it will take so much of time)

Any other ideas..., it will be helpfull


Thanks in Advance,
V.Auditya
Victor Zorin
RE: How to use liferay for Larger Sites
February 25, 2009 10:20 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

Just finished similar data migration, for local government, from a third-party CMS, 8,000+ entries, plus documents plus calendar events.

The only way to do such volume is to create a Java migration script, which will do transfer of all data into Liferay. In our case, the script was loading data directly from CMS database and publishing them as articles in liferay portal.

A couple of other things had to be done to maintain synchronization of sites during roll-over time, as previous site was live and liferay-based one was under completion.
A portlet had to be developed which would display the latest additions to live site, so the content would be synchronized manually on a daily basis, until switchover time.
Auditya manikanta Vadrevu
RE: How to use liferay for Larger Sites
February 25, 2009 11:27 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi victor,

thanks for ur quick and valuable reply.


Ok this will work fine if the client site have cms database, but in my case all the pages are static (just html files, not in database).

What i planned is to copy whole site folder in webapps and and call the files through embedded link option in pages. (and l will give folder permissions to various users to update content in files.) But the problem in this method is upon refresh of the page , the page renders the first page (which we have specified in embedded link).

U could get a doubt that if this is the method then why to use portal..... This is because, I want to extend my previous static site with liferay collaboration features, CMS etc.., so that from now i can use cms in my site with my previous static files.

do u have any idea how to overcome that refresh problem in embedded link? or any other idea how to import files in portal ?



Thanks in Advance,
V.Auditya
Victor Zorin
RE: How to use liferay for Larger Sites
February 26, 2009 12:06 AM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

Not really clear about "refresh" issues, suppose could be addressed one or another way.

But I would probably still migrate an entire content into the liferay, it is much better from content and configuration management point of view. It really does not matter whether you migrate data from database or from static pages, you still publish an article in liferay. Your case would probably be even simpler, since one page would be represented by a single article.

If you still would like to maintain both sites running in parallel, there could be another way:
rather then making links from dynamic liferay to static site, which is as you are saying has got some fundamental problems, do it the the other way - make static links from static website to liferay-based collaboration area. If look-and-feel is the same, user won't notice the site change and you would not have "refresh" problems.
Auditya manikanta Vadrevu
RE: How to use liferay for Larger Sites
February 26, 2009 1:11 AM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi victor,

If look-and-feel is the same, user won't notice the site change and you would not have "refresh" problems.


This is a good idea .


It really does not matter whether you migrate data from database or from static pages, you still publish an article in liferay. Your case would probably be even simpler, since one page would be represented by a single article.


I can see the only option of migrating the data from static pages to journal content is to add articles one by one for every page manually. ( it will be quite hard if our site have more than 800 pages). Is there any other method to migrate ? (dynamically ?)


Thanks in Advance,
V.Auditya
Victor Zorin
RE: How to use liferay for Larger Sites
May 14, 2009 8:14 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

I di dnot mean migrating by hand, but as we did it, do it automatically, using Liferay API.
1. Go through every link on static site,
2. get page html,
3. modify page html by changing over urls within the html to liferay friendly urls
3. create article xml from it
4.ceate a new article using Liferay API
5. create a page with friendly url' using Liferay API
6. create 'article content portlet' instance on this page using Liferay API
7. assign published article to this portlet instance using liferay API

All automatically , it is worth to spend a couple of days to write such Java class.

You would probably need to create an empty theme for those pages, because each article will contain an entire layout of the static site.
Auditya manikanta Vadrevu
RE: How to use liferay for Larger Sites
February 26, 2009 1:38 AM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi victor,


Thanks for the solution.



can u give an example how u have managed with that liferay API and also that java file(as u have developed it) .This will be very helpfull.





Thanks in Advance,
V.Auditya
Victor Zorin
RE: How to use liferay for Larger Sites
May 14, 2009 8:15 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

Unlike my own company files, this particular source code can not be given away as by implementation contract it became client's intellectual property.
Have a look at liferay service utility classes, they provide all methods you would need, eg. com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil for article publishing. All of them are fairly straightforward. If in doubt, use liferay's struts-config.xml to find Action classes that show how these utilities are used by liferay portlets itself.
Auditya manikanta Vadrevu
RE: How to use liferay for Larger Sites
February 26, 2009 3:09 AM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi victor,

ok no probs..

i will try to develop it. thanks for the hints.


Thanks,
V.Auditya
Victor Zorin
RE: How to use liferay for Larger Sites
March 4, 2009 11:36 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

Adding link to similar post, which may provide more samples, Migrate foreign data .
Auditya manikanta Vadrevu
RE: How to use liferay for Larger Sites
March 5, 2009 3:21 AM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi victor,
thanks for ur hint.

First i have tried to add the article with the sample data which i have entered manually.


article = JournalArticleLocalServiceUtil.addArticle(userid,articleId,false,plid,title,description,
manual_body_string,type,
structureId,templateId,10,10,2008,0,0,1,1,1,1,1,true,1,1,1,1,1,true,true,false,null,null,null,
articleURL,req.getPreferences(),new String[0],true,true);


The article has been added successfully.


But the body is not displaying the string i have passed with contentPre and contentPost Strings.

But when i pass only the string without the contentPre and contentPost string the body of the journal is displayed correctly but an error is seen in log

10:59:13,667 ERROR [LocaleTransformerListener:118] org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.



and also ..


Actually i didnt understood how u created articleId uniquely
1String articleId = prop.getProperty("url").replaceAll("/", ".");
2logger.info("articleId=" + articleId);
3if (articleId.length() > 75) {
4 String hash = String.valueOf(articleId.hashCode());
5 articleId = articleId.substring(0, 70 - hash.length());
6 articleId += "." + hash;
7 logger.info("************** reduced article ID to " + articleId);
8}


With Regards
V.Auditya.
Victor Zorin
RE: How to use liferay for Larger Sites
March 5, 2009 1:28 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

1. article content shall be a valid XML file
Go to your liferay database, get to the field which contains journal content, and see how does it look like.

2. with article id, I had to come up with the way of how to relate an article in liferay with the source page.
So if the source page URL is '/intranet/hr/forms', article id would be 'intranet.hr.forms'.
However there is a length limit on article id, so if url is too long, I was hashing the rest of the url, to maintain its uniqueness.
By having an articleId properly built, we are able to re-import full content on the fly, or detect and re-submit those articles that have been modified on old system during phasing/testing period.
Auditya manikanta Vadrevu
RE: How to use liferay for Larger Sites
March 5, 2009 9:51 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi victor,

Now i understood about the article id. thanks for the help. and also the content is also displayed corrrectly.

But still with a structure and template given(not default) iam getting a problem in displaying the content, i have seen the content from database as u suggested.

Its working with only default structure and default template .

here is my code

 1
 2String contentPre = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
 3+ "<root available-locales=\"en_US\" default-locale=\"\">"
 4+ "<static-content language-id=\"en_US\"><![CDATA[";
 5
 6String customString = "My name is auditya";
 7
 8String contentPost = "]]></static-content></root>";
 9
10String body = contentPre + customString + contentPost;
11
12System.out.println(body);
13// i have specified structure id and template id in the method.
14System.out.println("ARTICLE ADDED");
15System.out.println("APPROVED");


here is the log after execution,



<?xml version="1.0" encoding="UTF-8"?><root available-locales="en_US" default-locale=""><static-content language-id="en_US"><![CDATA[My name is auditya]]></static-content></root>
ARTICLE ADDED
APPROVED



there is no error in log but the created article does not show content in its body.



With regards,
V.Auditya
Attachment

Attachments: journal.png (51.8k)
Victor Zorin
RE: How to use liferay for Larger Sites
March 5, 2009 10:32 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

Try to set a default-locale in xml template to en_US.
Auditya manikanta Vadrevu
RE: How to use liferay for Larger Sites
March 8, 2009 10:12 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi victor,

even after adding the default locale also the content is not displayed.


See this Articles --- Files



With Regards,
V.Auditya
Victor Zorin
RE: How to use liferay for Larger Sites
March 8, 2009 11:10 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

Auditya, keep playing around locales.
We had a couple of issues like this before as liferay does not handle locales in a standard way when displaying article content.

We had articles coming up 'with no content' for some users and 'with content' for other users. After we ran scripts over liferay tables aligning user and article locales, problem was gone.
deva v
RE: How to use liferay for Larger Sites
June 1, 2009 2:58 AM
Answer

deva v

Rank: New Member

Posts: 2

Join Date: June 1, 2009

Recent Posts

This Post is a Very good guide to migrate larger sites automatically into liferay.





Thanks to Victor & Auditya
Lisa Simpson
RE: How to use liferay for Larger Sites
October 5, 2009 9:03 AM
Answer

Lisa Simpson

Rank: Liferay Legend

Posts: 2034

Join Date: March 5, 2009

Recent Posts

Can you guys be persuaded to write a wiki article about this????
Samujjwal Sahu
RE: How to use liferay for Larger Sites
January 28, 2013 2:03 AM
Answer

Samujjwal Sahu

Rank: New Member

Posts: 13

Join Date: May 22, 2012

Recent Posts

Hi Victor,
I have done all the steps as you have mentioned. And thanks for this helpful thread. But I am stuck in a place right now: Please help me with some input.

I am using Liferay 6.1 EE
Things that are working fine:
1. Creating a page
2. Creating JournalArticle by adding the PreContent and PostContent strings (to make the content XML) using default structure (static-content ) as well as using a fixed structure (dynamic-content)
3. Adding a Web Content Display portlet in the newly created page.
4. Setting the JournalArticle into that Web Content Display portlet.

BUT the portlet is showing blank.

I feel the problem lies with the content generation.
PreContent and Post-Content for Dynamic element:
String contentPre = "<?xml version=\"1.0\" ?>"
+ "<root available-locales=\"en_US\" default-locale=\"en_US\">"
+ "<dynamic-element name=\"var\" instance-id=\"" +instanceId
+"\" type=\"text_area\" index-type=\"text\"><dynamic-content><![CDATA[";
String contentPost = "]]></dynamic-content></dynamic-element></root>";


I am generating the instance-id usinf the below method:
protected String generateInstanceId() {
StringBuilder instanceId = new StringBuilder(8);

String key = PwdGenerator.KEY1 + PwdGenerator.KEY2 + PwdGenerator.KEY3;

for (int i = 0; i < 8; i++) {
int pos = (int)Math.floor(Math.random() * key.length());

instanceId.append(key.charAt(pos));
}
return instanceId.toString();
}


For default structures or static content the Precontent and postcontent is :
String contentPre = "<?xml version=\"1.0\" ?>"
+ "<root available-locales=\"en_US\" default-locale=\"en_US\">"
+ "<static-content language-id=\"en_US\"><![CDATA[";
String contentPost = "]]></static-content></root>";


As you can see that i have also set the Locales en_US but still its not showing up.

Please share your view on this:

Regards
Samujjwal
Victor Zorin
RE: How to use liferay for Larger Sites
January 28, 2013 8:39 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

A couple of questions to help in debugging:

1). do you have pages with given friendly urls created in your portal and target organisation/site?

2). if yes, do you have WebContent portlet deployed on these pages?

3). Do you see any publshed articles or even with empty content but with given title when you access Control Panel > Web Content?
Samujjwal Sahu
RE: How to use liferay for Larger Sites
January 28, 2013 11:13 PM
Answer

Samujjwal Sahu

Rank: New Member

Posts: 13

Join Date: May 22, 2012

Recent Posts

Hi Victor,
Thanks for your reply.
1). do you have pages with given friendly urls created in your portal and target organisation/site? - Yes

2). if yes, do you have WebContent portlet deployed on these pages? - Yes

3). Do you see any published articles or even with empty content but with given title when you access Control Panel > Web Content? - Yes

Yaah I am able to see all the above mentioned things.
I have been able to solve the problem. I was not using the below mentioned method:

JournalArticleLocalServiceUtil.updateJournalArticle(article, true);


After the addArticle() call i called the above mentioned method and it worked.

I more thing which i did is making the autoArticleId : true

Thanks for the reply Victor.

Regards
Samujjwal
Attachments: SampleTestPortlet.java (11.0k)
Victor Zorin
RE: How to use liferay for Larger Sites
January 29, 2013 12:17 AM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1176

Join Date: April 14, 2008

Recent Posts

Congtrats!
Samujjwal Sahu
RE: How to use liferay for Larger Sites
January 29, 2013 3:29 AM
Answer

Samujjwal Sahu

Rank: New Member

Posts: 13

Join Date: May 22, 2012

Recent Posts

emoticon
One more thing Victor,
How can we programmatically set a particular portlet in a layout template.
Using which util class can i fetch all the layouttemplate present in liferay? Even custom layouts.

And in which table the themes are stored?

I want my users to choose the theme and layout for the content that he will be uploading.

regards
Samujjwal
Jacques Traore
RE: How to use liferay for Larger Sites
April 21, 2013 7:14 PM
Answer

Jacques Traore

Rank: Junior Member

Posts: 46

Join Date: January 21, 2013

Recent Posts

Hi everybody,
I have a similar problem and I really hope you can help me because I am working on it for more than 2 months but I can't figure it out.
I am using Liferay 6.1.1/ Tomcat7/Oracle 11g.
I need to upload about 600 web content (with custom structure and template) in both English and French languages.
The SOAP's addArticle(....) works at 90%...
1- The uploaded articles are visible in control panel but not displayed in the asset publisher till I click on publish button. Why???
2- I don't know how to add the translation of the same article.

Thanks in advance,
jose fernandez
RE: How to use liferay for Larger Sites
May 30, 2013 2:26 AM
Answer

jose fernandez

Rank: New Member

Posts: 23

Join Date: May 26, 2008

Recent Posts

http://www.liferay.com/c/message_boards/find_message?messageId=25237833
Rob Zondag
RE: How to use liferay for Larger Sites
April 16, 2014 7:56 AM
Answer

Rob Zondag

Rank: New Member

Posts: 5

Join Date: August 7, 2012

Recent Posts

Hi Jose,

Very nice to point to this article but as far as I can see you haven't posted a solution yet ... or ... ?

All the best,

Rob