Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Namrata Hangal
Generate services for existing portal source
September 16, 2012 11:07 PM
Answer

Namrata Hangal

Rank: Regular Member

Posts: 161

Join Date: July 26, 2010

Recent Posts

Hi,

Is it possible to generate services for existing classes in portal source code?
For example, I need to use the exportLayoutAsFile method in LayoutExporter. I don't see any class like LayoutExporterLocalServiceUtil that I can use to access that method.

What should be the procedure I need to follow to be able to access this method without a Permissions error?
Michał Kolenda
RE: Generate services for existing portal source
September 17, 2012 12:42 AM
Answer

Michał Kolenda

Rank: New Member

Posts: 2

Join Date: September 17, 2012

Recent Posts

Hi,

Try to use LayoutLocalServiceUtil's exportLayoutsAsFile method. It creates a new LayoutExporter object and calls its exportLayoutsAsFile method.
Namrata Hangal
RE: Generate services for existing portal source
September 17, 2012 2:26 AM
Answer

Namrata Hangal

Rank: Regular Member

Posts: 161

Join Date: July 26, 2010

Recent Posts

Hi Michal,

I did, in fact, use the LayoutLocalServiceUtil but at the end of execution, I get a .zip file instead of a .lar file.
So I thought maybe it's because I need to call a service on LayoutExporter itself?

Here's the link to my other thread (from where it started emoticon) http://www.liferay.com/community/forums/-/message_boards/message/15973608
Michał Kolenda
RE: Generate services for existing portal source
September 17, 2012 3:09 AM
Answer

Michał Kolenda

Rank: New Member

Posts: 2

Join Date: September 17, 2012

Recent Posts

As far as I know, LAR files are actually ZIPs with .lar extensions.
Namrata Hangal
RE: Generate services for existing portal source
September 17, 2012 3:13 AM
Answer

Namrata Hangal

Rank: Regular Member

Posts: 161

Join Date: July 26, 2010

Recent Posts

Hmm.. maybe I can first export using my method and try importing it.
If Liferay rejects it, then it means that .lar is needed or there's something else missing emoticon