本文整理汇总了Java中com.liferay.portal.kernel.portlet.PortletProvider类的典型用法代码示例。如果您正苦于以下问题:Java PortletProvider类的具体用法?Java PortletProvider怎么用?Java PortletProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PortletProvider类属于com.liferay.portal.kernel.portlet包,在下文中一共展示了PortletProvider类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TaskRecordSearch
import com.liferay.portal.kernel.portlet.PortletProvider; //导入依赖的package包/类
public TaskRecordSearch(PortletRequest portletRequest, String curParam, PortletURL iteratorURL) {
super(portletRequest, new TaskRecordDisplayTerms(portletRequest), new TaskRecordSearchTerms(portletRequest),
curParam, DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
TaskRecordDisplayTerms displayTerms = (TaskRecordDisplayTerms) getDisplayTerms();
TaskRecordSearchTerms searchTerms = (TaskRecordSearchTerms) getSearchTerms();
String portletId = PortletProviderUtil.getPortletId(User.class.getName(), PortletProvider.Action.VIEW);
String portletName = portletConfig.getPortletName();
if (!portletId.equals(portletName)) {
displayTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
searchTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
}
iteratorURL.setParameter(TaskRecordDisplayTerms.TASKRECORDID, String.valueOf(displayTerms.getTaskRecordId()));
iteratorURL.setParameter(TaskRecordDisplayTerms.STATUS, String.valueOf(displayTerms.getStatus()));
iteratorURL.setParameter(TaskRecordDisplayTerms.WORK_PACKAGE, displayTerms.getWorkPackage());
iteratorURL.setParameter(TaskRecordDisplayTerms.DESCRIPTION, displayTerms.getDescription());
iteratorURL.setParameter(TaskRecordDisplayTerms.USER_NAME, displayTerms.getUserName());
iteratorURL.setParameter(TaskRecordDisplayTerms.TICKET_URL, displayTerms.getTicketURL());
iteratorURL.setParameter(TaskRecordDisplayTerms.CREATE_DATE, displayTerms.getCreateDate());
iteratorURL.setParameter(TaskRecordDisplayTerms.MODIFIED_DATE, displayTerms.getModifiedDate());
iteratorURL.setParameter(TaskRecordDisplayTerms.FROM_DATE, displayTerms.getFromDate());
iteratorURL.setParameter(TaskRecordDisplayTerms.UNTIL_DATE, displayTerms.getUntilDate());
iteratorURL.setParameter(TaskRecordDisplayTerms.DURATION, String.valueOf(displayTerms.getDuration()));
try {
PortalPreferences preferences = PortletPreferencesFactoryUtil.getPortalPreferences(portletRequest);
String orderByCol = ParamUtil.getString(portletRequest, "orderByCol");
String orderByType = ParamUtil.getString(portletRequest, "orderByType");
if (Validator.isNotNull(orderByCol) && Validator.isNotNull(orderByType)) {
preferences.setValue(portletId, "task-records-order-by-col", orderByCol);
preferences.setValue(portletId, "task-records-order-by-type", orderByType);
} else {
orderByCol = preferences.getValue(portletId, "task-records-order-by-col", "modified-date");
orderByType = preferences.getValue(portletId, "task-records-order-by-type", "asc");
}
setOrderableHeaders(orderableHeaders);
if (Validator.isNotNull(orderableHeaders.get(orderByCol))) {
setOrderByCol(orderableHeaders.get(orderByCol));
} else {
_log.error(orderByCol + " is not an orderable header.");
setOrderByCol(orderByCol);
}
setOrderByType(orderByType);
} catch (Exception e) {
_log.error(e);
}
}
示例2: ContactSearch
import com.liferay.portal.kernel.portlet.PortletProvider; //导入依赖的package包/类
public ContactSearch(PortletRequest portletRequest, String curParam, PortletURL iteratorURL) {
super(portletRequest, new ContactDisplayTerms(portletRequest), new ContactSearchTerms(portletRequest), curParam,
DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
ContactDisplayTerms displayTerms = (ContactDisplayTerms) getDisplayTerms();
ContactSearchTerms searchTerms = (ContactSearchTerms) getSearchTerms();
String portletId = PortletProviderUtil.getPortletId(User.class.getName(), PortletProvider.Action.VIEW);
String portletName = portletConfig.getPortletName();
if (!portletId.equals(portletName)) {
displayTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
searchTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
}
iteratorURL.setParameter(ContactDisplayTerms.COMPANY, String.valueOf(displayTerms.getCompany()));
iteratorURL.setParameter(ContactDisplayTerms.CONTACT_ID, String.valueOf(displayTerms.getContactId()));
iteratorURL.setParameter(ContactDisplayTerms.CREATE_DATE, String.valueOf(displayTerms.getCreateDate()));
iteratorURL.setParameter(ContactDisplayTerms.EMAIL, String.valueOf(displayTerms.getEmail()));
iteratorURL.setParameter(ContactDisplayTerms.FAX, String.valueOf(displayTerms.getFax()));
iteratorURL.setParameter(ContactDisplayTerms.FULL_NAME, String.valueOf(displayTerms.getFullName()));
// TODO: add default impp
iteratorURL.setParameter(ContactDisplayTerms.MODIFIED_DATE, String.valueOf(displayTerms.getModifiedDate()));
iteratorURL.setParameter(ContactDisplayTerms.NAME, String.valueOf(displayTerms.getName()));
iteratorURL.setParameter(ContactDisplayTerms.PHONE, String.valueOf(displayTerms.getPhone()));
iteratorURL.setParameter(ContactDisplayTerms.USER_NAME, String.valueOf(displayTerms.getUserName()));
try {
PortalPreferences preferences = PortletPreferencesFactoryUtil.getPortalPreferences(portletRequest);
String orderByCol = ParamUtil.getString(portletRequest, "orderByCol");
String orderByType = ParamUtil.getString(portletRequest, "orderByType");
if (Validator.isNotNull(orderByCol) && Validator.isNotNull(orderByType)) {
preferences.setValue(portletId, "contacts-order-by-col", orderByCol);
preferences.setValue(portletId, "contacts-order-by-type", orderByType);
} else {
orderByCol = preferences.getValue(portletId, "contacts-order-by-col", "modified-date");
orderByType = preferences.getValue(portletId, "contacts-order-by-type", "asc");
}
setOrderableHeaders(orderableHeaders);
if (Validator.isNotNull(orderableHeaders.get(orderByCol))) {
setOrderByCol(orderableHeaders.get(orderByCol));
} else {
_log.error(orderByCol + " is not an orderable header.");
setOrderByCol(orderByCol);
}
setOrderByType(orderByType);
} catch (Exception e) {
_log.error(e);
}
}
示例3: MeasurementSearch
import com.liferay.portal.kernel.portlet.PortletProvider; //导入依赖的package包/类
public MeasurementSearch(PortletRequest portletRequest, String curParam, PortletURL iteratorURL) {
super(portletRequest, new MeasurementDisplayTerms(portletRequest), new MeasurementSearchTerms(portletRequest),
curParam, DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
MeasurementDisplayTerms displayTerms = (MeasurementDisplayTerms) getDisplayTerms();
MeasurementSearchTerms searchTerms = (MeasurementSearchTerms) getSearchTerms();
String portletId = PortletProviderUtil.getPortletId(User.class.getName(), PortletProvider.Action.VIEW);
String portletName = portletConfig.getPortletName();
if (!portletId.equals(portletName)) {
displayTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
searchTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
}
iteratorURL.setParameter(MeasurementDisplayTerms.CREATE_DATE, displayTerms.getCreateDate());
iteratorURL.setParameter(MeasurementDisplayTerms.DATA, displayTerms.getData());
iteratorURL.setParameter(MeasurementDisplayTerms.MEASUREMENT_ID,
String.valueOf(displayTerms.getMeasurementId()));
iteratorURL.setParameter(MeasurementDisplayTerms.STATUS, String.valueOf(displayTerms.getStatus()));
iteratorURL.setParameter(MeasurementDisplayTerms.USER_NAME, displayTerms.getUserName());
iteratorURL.setParameter(MeasurementDisplayTerms.MODIFIED_DATE, displayTerms.getModifiedDate());
iteratorURL.setParameter(MeasurementDisplayTerms.FROM, String.valueOf(displayTerms.getFrom()));
iteratorURL.setParameter(MeasurementDisplayTerms.UNTIL, String.valueOf(displayTerms.getUntil()));
try {
PortalPreferences preferences = PortletPreferencesFactoryUtil.getPortalPreferences(portletRequest);
String orderByCol = ParamUtil.getString(portletRequest, "orderByCol");
String orderByType = ParamUtil.getString(portletRequest, "orderByType");
if (Validator.isNotNull(orderByCol) && Validator.isNotNull(orderByType)) {
preferences.setValue(portletId, "measurements-order-by-col", orderByCol);
preferences.setValue(portletId, "measurements-order-by-type", orderByType);
} else {
orderByCol = preferences.getValue(portletId, "measurements-order-by-col", "modified-date");
orderByType = preferences.getValue(portletId, "measurements-order-by-type", "asc");
}
setOrderableHeaders(orderableHeaders);
if (Validator.isNotNull(orderableHeaders.get(orderByCol))) {
setOrderByCol(orderableHeaders.get(orderByCol));
} else {
_log.error(orderByCol + " is not an orderable header.");
setOrderByCol(orderByCol);
}
setOrderByType(orderByType);
} catch (Exception e) {
_log.error(e);
}
}