Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Missing code in Liferay in Action sourcecode file? Jaafar Altaie 1 luglio 2012 14.16
RE: Missing code in Liferay in Action sourcecode file? sheela mk 1 luglio 2012 23.20
RE: Missing code in Liferay in Action sourcecode file? Jaafar Altaie 3 luglio 2012 1.46
RE: Missing code in Liferay in Action sourcecode file? Jaafar Altaie 4 luglio 2012 0.50
RE: Missing code in Liferay in Action sourcecode file? Jaafar Altaie 6 luglio 2012 4.50
RE: Missing code in Liferay in Action sourcecode file? Hitoshi Ozawa 8 luglio 2012 6.42
RE: Missing code in Liferay in Action sourcecode file? Jaafar Altaie 8 luglio 2012 14.11
RE: Missing code in Liferay in Action sourcecode file? Hitoshi Ozawa 8 luglio 2012 14.35
RE: Missing code in Liferay in Action sourcecode file? Chinnadurai Duraisami 11 dicembre 2012 7.04
RE: Missing code in Liferay in Action sourcecode file? sheela mk 20 luglio 2013 1.57
RE: Missing code in Liferay in Action sourcecode file? Richard Sezov 23 luglio 2013 8.59
RE: Missing code in Liferay in Action sourcecode file? sheela mk 25 luglio 2013 1.06
RE: Missing code in Liferay in Action sourcecode file? adg teq 31 luglio 2013 3.16
RE: Missing code in Liferay in Action sourcecode file? adg teq 2 agosto 2013 17.38
RE: Missing code in Liferay in Action sourcecode file? adg teq 3 agosto 2013 12.06
RE: Missing code in Liferay in Action sourcecode file? David Ilechukwu 5 agosto 2013 4.31
RE: Missing code in Liferay in Action sourcecode file? Richard Sezov 5 agosto 2013 15.17
RE: Missing code in Liferay in Action sourcecode file? David Milne 29 settembre 2013 3.55
RE: Missing code in Liferay in Action sourcecode file? Mirto Silvio Busico 16 giugno 2014 10.37
Jaafar Altaie
Missing code in Liferay in Action sourcecode file?
1 luglio 2012 14.16
Risposta

Jaafar Altaie

Punteggio: Junior Member

Messaggi: 69

Data di Iscrizione: 26 aprile 2012

Messaggi recenti

I'd like to ask a question about the book LIferay in Action. I'm on chapter 4 of the book.

I' downloaded the latest copy of the sourcecode for the book (http://www.liferay.com/web/richard.sezov/documents/-/document_library/view/1388559/90601?_20_redirect=http%3A%2F%2Fwww.liferay.com%2Fweb%2Frichard.sezov%2Fdocuments%2F-%2Fdocument_library%2Fview%2F1388559%3F_20_redirect%3Dhttp%253A%252F%252Fwww.liferay.com%252Fweb%252Frichard.sezov%252Fdocuments%253Fp_p_id%253D20%2526p_p_lifecycle%253D0%2526p_p_state%253Dnormal%2526p_p_mode%253Dview%2526p_p_col_id%253Dcolumn-2%2526p_p_col_count%253D2), but I notice there's classes missing. When I run Service Builder not all the classes and packages are created that are in the book. When I look at the source code and try to copy the classes into the Eclipse project, I still see a lot of skeleton code which create a number of build errors. Am I missing something or is the sourcecode not yet complete?

Is it possible to obtain sourcecode that allows me to build the example in Chapter 4 end to end without adding or looking for additional classes or packages?

I would expect all the source code files to be available from the download to allow me to build an end to application using the examples in the book, so should I be looking elsewhere for missing files and complete classes?
Allegati: build-common-web.xml (0,2k)
sheela mk
RE: Missing code in Liferay in Action sourcecode file?
1 luglio 2012 23.20
Risposta

sheela mk

Punteggio: Regular Member

Messaggi: 111

Data di Iscrizione: 16 febbraio 2012

Messaggi recenti

Hai..Jaafar..You can check link..I 've attached all source code examples of Liferay in Action...

All examples are working fine..I tried it..
Allegati: liferayinactionportletexamples.zip (1.267,0k)
Jaafar Altaie
RE: Missing code in Liferay in Action sourcecode file?
3 luglio 2012 1.46
Risposta

Jaafar Altaie

Punteggio: Junior Member

Messaggi: 69

Data di Iscrizione: 26 aprile 2012

Messaggi recenti

Sheela,

Thanks a million. This looks more complete than the copy which I downloaded. I'll give it a try and let you know. Thanks again!!
Jaafar Altaie
RE: Missing code in Liferay in Action sourcecode file?
4 luglio 2012 0.50
Risposta

Jaafar Altaie

Punteggio: Junior Member

Messaggi: 69

Data di Iscrizione: 26 aprile 2012

Messaggi recenti

Sheela,

The code you provided is what I'm looking for. I imported this into Eclipse and it seems to be much more complete than the code which I previously downloaded. THANK YOU FOR YOUR HELP!
Jaafar Altaie
RE: Missing code in Liferay in Action sourcecode file?
6 luglio 2012 4.50
Risposta

Jaafar Altaie

Punteggio: Junior Member

Messaggi: 69

Data di Iscrizione: 26 aprile 2012

Messaggi recenti

Hi Sheela,

You mentioned that you tried the downloaded code it works. Were you able to create the entire inkwell example? On the whole the code which you gave me is much better than the version i previously downloaded, but I am still getting one particular error in ProductAdmintPortlet.java. The error is:

The method deleteProduct(long) in the type PRProductLocalServiceUtil is not applicable for the arguments (long, long)

It happens in the following line of the class:

public void deleteProduct(ActionRequest request, ActionResponse response)
throws Exception {
long productKey = ParamUtil.getLong(request, "resourcePrimKey");
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(
WebKeys.THEME_DISPLAY);

if (Validator.isNotNull(productKey)) {
PRProductLocalServiceUtil.deleteProduct(productKey, themeDisplay.getCompanyId());

SessionMessages.add(request, "productDeleted");

} else {
SessionErrors.add(request, "error-deleting");

}

}



The part of PRProductLocalServiceUtil.java which defines the above method is:

/**
* Removes the specified product from the database.
*
* @param productId
* @throws com.inkwell.internet.portlets.prodreg.sb.NoSuchProductException
* @throws com.liferay.portal.kernel.exception.SystemException
* @throws com.liferay.portal.kernel.exception.PortalException
*/
public static void deleteProduct(long productId)
throws com.inkwell.internet.productregistration.NoSuchProductException,
com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
getService().deleteProduct(productId);
}

/**
* Removes the specified product from the database.
*
* @param product
* @throws com.liferay.portal.kernel.exception.PortalException
* @throws com.liferay.portal.kernel.exception.SystemException
*/
public static void deleteProduct(
com.inkwell.internet.productregistration.model.PRProduct product)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
getService().deleteProduct(product);
}


So i can see that ProductAdminPOrtlet is looking for two arguments, but only one exists in PRProductLocalServiceUtil.java (the pparent class). So my questions are:

1) Would I have to to add the second argument in the parent class?
2) What is the best way to add/ modify these two classes to fix this build error

I have also attached both classes. Many thanks!!
Allegati: PRProductLocalServiceUtil.java (12,5k), ProductAdminPortlet.class (7,1k), ProductAdminPortlet.java (7,7k)
Hitoshi Ozawa
RE: Missing code in Liferay in Action sourcecode file?
8 luglio 2012 6.42
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7952

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

This is a little bit off the topic but there is a "Liferay in Action" errata page. I think you can contact the author there. :-)

http://www.manning-sandbox.com/forum.jspa?forumID=642
Jaafar Altaie
RE: Missing code in Liferay in Action sourcecode file?
8 luglio 2012 14.11
Risposta

Jaafar Altaie

Punteggio: Junior Member

Messaggi: 69

Data di Iscrizione: 26 aprile 2012

Messaggi recenti

Hitoshi,

Thanks a bunch! I tried that forum. The author doesn't always reply and the format of the page makes it really hard to paste code. Altogether not very helpful. Sorry!!
Hitoshi Ozawa
RE: Missing code in Liferay in Action sourcecode file?
8 luglio 2012 14.35
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7952

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

The author doesn't always reply and the format of the page makes it really hard to paste code. Altogether not very helpful.


Well, seems liferay.com haven't improved too much yet.
Chinnadurai Duraisami
RE: Missing code in Liferay in Action sourcecode file?
11 dicembre 2012 7.04
Risposta

Chinnadurai Duraisami

Punteggio: New Member

Messaggi: 20

Data di Iscrizione: 28 novembre 2012

Messaggi recenti

Hi Sheela,
I downloaded your code for testing the product registration. Unfortunately, i am getting lot of errors. I am using liferay-plugins-sdk-6.1.1 and liferay-portal-6.1.1-ce-ga2.
Could you please help me. These all are few of them.

177. ERROR in C:\Chinna\Tools\liferay-plugins-sdk-6.1.1\portlets\product-registration-portlet\docroot\WEB-INF\src\com\inkwell\internet\productregistration\service\persistence\PRUserPersistenceImpl.java (at line 2815)
@BeanReference(type = UserPersistence.class)
^^^^
The attribute type is undefined for the annotation type BeanReference

25. ERROR in C:\Chinna\Tools\liferay-plugins-sdk-6.1.1\portlets\parts-inventory-portlet\docroot\WEB-INF\src\com\liferay\training\parts\service\persistence\PartPersistenceImpl.java (at line 1170)
Object[] values = orderByComparator.getOrderByValues(part);
^^^^^^^^^^^^^^^^
The method getOrderByValues(Part) is undefined for the type OrderByComparator

regards,
Chinna
sheela mk
RE: Missing code in Liferay in Action sourcecode file?
20 luglio 2013 1.57
Risposta

sheela mk

Punteggio: Regular Member

Messaggi: 111

Data di Iscrizione: 16 febbraio 2012

Messaggi recenti

Hai..All..

Liferay in Action..Source code..product registration portlet..example..

I wants to execute the same in Liferay 6.1.1 ga2 version..

Due to version problem..its not executing it seems,,

Pls let..me know..How to upgrade this application..into Liferay 6.1.1 ga2 version..n execute it successfully..


thanks,,
Sheela
Richard Sezov
RE: Missing code in Liferay in Action sourcecode file?
23 luglio 2013 8.59
Risposta

Richard Sezov

LIFERAY STAFF

Punteggio: Regular Member

Messaggi: 200

Data di Iscrizione: 7 febbraio 2007

Messaggi recenti

Hi!
Liferay in Action was completed a few months before Liferay 6.1 came out, so the code was written for 6.0. It should only take a few minor steps to get it running in 6.1, though. Here's what I would do:

1. Extract the Liferay in Action plugins sdk and the latest 6.1 Plugins SDK into two separate folders.
2. Copy the portlets from the
1portlets
folder in the Liferay in Action SDK to the
1portlets
folder in the 6.1 SDK.
3. Set up the 6.1 SDK with Liferay IDE and a Liferay 6.1 runtime.
4. Import the portlets using Liferay IDE.
5. Re-run Service Builder. This should take care of most of the errors.
6. There were minor API updates between 6.0 and 6.1, most notably the asset API now requires a Map locale instead of a String (because it was internationalized).
7. Fix all these, and the portlets should run.

I would love to spend some time doing this myself, but I'm very busy right now getting the documentation together for 6.2. For that reason, I don't want to promise anything necessarily, for fear of disappointing people. But I will try to get to it and make a 6.1 version available.

Thanks for your interest in the book, and I hope this helps!

--Rich
sheela mk
RE: Missing code in Liferay in Action sourcecode file?
25 luglio 2013 1.06
Risposta

sheela mk

Punteggio: Regular Member

Messaggi: 111

Data di Iscrizione: 16 febbraio 2012

Messaggi recenti

Hai..Richard..

Thanks for the reply..Now its running fine..with seperate..Liferay sdk 6.1.1..


Thanks and Regard,
Sheela
adg teq
RE: Missing code in Liferay in Action sourcecode file?
31 luglio 2013 3.16
Risposta

adg teq

Punteggio: New Member

Messaggi: 3

Data di Iscrizione: 13 luglio 2013

Messaggi recenti

hi Sheela,

would you mind sharing your results (upgraded source code) with us?

thanks in advance
adg teq
RE: Missing code in Liferay in Action sourcecode file?
2 agosto 2013 17.38
Risposta

adg teq

Punteggio: New Member

Messaggi: 3

Data di Iscrizione: 13 luglio 2013

Messaggi recenti

hi,
has anyone succeeded in upgrading the book examples for liferay 6.1.1 and can share them with us?
I'm new to liferay and I'm trying to learn it from Rich's nice book. should I move back to the 6.0 version?
adg teq
RE: Missing code in Liferay in Action sourcecode file?
3 agosto 2013 12.06
Risposta

adg teq

Punteggio: New Member

Messaggi: 3

Data di Iscrizione: 13 luglio 2013

Messaggi recenti

Problem Solved!
I downloaded liferay 6.0 and the examples worked fine. gotta accept my post as answer. it's good to come to a deserted forum like this and talk to yourself until the answer is inspired to yourself emoticon
but aside from kidding, i can't understand why a point change in version should alter so many package names. it's so frightening for a noob.
David Ilechukwu
RE: Missing code in Liferay in Action sourcecode file?
5 agosto 2013 4.31
Risposta

David Ilechukwu

Punteggio: Regular Member

Messaggi: 116

Data di Iscrizione: 7 giugno 2010

Messaggi recenti

Great to know you solved the problem.
Richard Sezov
RE: Missing code in Liferay in Action sourcecode file?
5 agosto 2013 15.17
Risposta

Richard Sezov

LIFERAY STAFF

Punteggio: Regular Member

Messaggi: 200

Data di Iscrizione: 7 febbraio 2007

Messaggi recenti

I spent some time today modifying the two portlets from Liferay in Action to work on Liferay 6.1. Beyond rebuilding the services, there wasn't much to change.

I've uploaded a 6.1 SDK with the portlets in it here. I hope this helps everybody with running the examples in the book, and thanks for reading!

--Rich
David Milne
RE: Missing code in Liferay in Action sourcecode file?
29 settembre 2013 3.55
Risposta

David Milne

Punteggio: New Member

Messaggi: 1

Data di Iscrizione: 29 settembre 2013

Messaggi recenti

Thanks for that - I'm getting an error in slogan-contest-portlet in docroot/html/view.jsp, relating to searchContainer not being found ?
Mirto Silvio Busico
RE: Missing code in Liferay in Action sourcecode file?
16 giugno 2014 10.37
Risposta

Mirto Silvio Busico

Punteggio: Regular Member

Messaggi: 105

Data di Iscrizione: 18 gennaio 2012

Messaggi recenti

Sorry to restart the thread; but I'm trying to build the product registration portlet on Liferay 6.2 Ce GA2

I get a lot of build error:
 1
 2BUILD FAILED
 3/LH/plugins/sdk62ga2/build-common-plugin.xml:482: The following error occurred while executing this line:
 4/LH/plugins/sdk62ga2/build-common.xml:1001: The following error occurred while executing this line:
 5/LH/plugins/sdk62ga2/build-common.xml:251: The following error occurred while executing this line:
 6/LH/plugins/sdk62ga2/build-common.xml:1278: The following error occurred while executing this line:
 7/LH/plugins/sdk62ga2/build-common.xml:219: The following error occurred while executing this line:
 8/LH/plugins/sdk62ga2/build-common.xml:496: The following error occurred while executing this line:
 9/LH/plugins/sdk62ga2/build-common.xml:620: /LH/plugins/sdk62ga2/portlets/product-registration-portlet/src does not exist.


I got the code from the Manning site of Liferay in action
What can I do?

Thanks