Forums de discussion

Portlet plugin: AnnouncementsDeliveryImpl cannot be resolved to a type

thumbnail
Ivano Carrara, modifié il y a 12 années.

Portlet plugin: AnnouncementsDeliveryImpl cannot be resolved to a type

Expert Publications: 346 Date d'inscription: 03/07/05 Publications récentes
Hi all,

In my portlet plugin I create a new User - at the same time I need to set up the delivery methods for Alarm and Announcements. So at first I'll use the below statement:

AnnouncementsDelivery announcementsDelivery = new AnnouncementsDeliveryImpl();


but in the IDE editor I get the error "AnnouncementsDeliveryImpl cannot be resolved to a type".

My includes are the below:
import com.liferay.portlet.announcements.model.AnnouncementsDelivery;
import com.liferay.portlet.announcements.model.AnnouncementsEntryConstants;
import com.liferay.portlet.announcements.model.impl.AnnouncementsDeliveryImpl;
import com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalServiceUtil;


Please, what I'm missing ?

Thank you in advance!

Ivano C.
thumbnail
Juan Carrey, modifié il y a 12 années.

RE: Portlet plugin: AnnouncementsDeliveryImpl cannot be resolved to a type

Junior Member Publications: 31 Date d'inscription: 15/08/11 Publications récentes
AnnouncementsDeliveryLocalServiceUtil.createAnnouncementsDelivery(long id);

The id can be provided by :

CounterLocalServiceUtil.increment();

or
CounterServiceUtil.increment()


When you are coding your portlet, you will have access (Classpath) to :

tomcat/lib
tomcat/lib/ext
your WEB-INF/lib
your WEB-INF/classes

but the AnnouncementsDeliveryImpl is in tomcat/webapps/ROOT/WEB-INF/lib/portal-impl.jar

Regards
thumbnail
Ravi Kumar Gupta, modifié il y a 12 années.

RE: Portlet plugin: AnnouncementsDeliveryImpl cannot be resolved to a type

Liferay Legend Publications: 1302 Date d'inscription: 24/06/09 Publications récentes
Never use any IMPL files in code. Rather read comment on those files and use proper Utility class.