本文整理匯總了Java中com.liferay.portal.kernel.exception.PortalException類的典型用法代碼示例。如果您正苦於以下問題:Java PortalException類的具體用法?Java PortalException怎麽用?Java PortalException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PortalException類屬於com.liferay.portal.kernel.exception包,在下文中一共展示了PortalException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: insert
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
@Override
public Registration insert(long groupId, long companyId, String applicantName, String applicantIdType, String applicantIdNo,
String applicantIdDate, String address, String cityCode, String cityName, String districtCode,
String districtName, String wardCode, String wardName, String contactName, String contactTelNo,
String contactEmail, String govAgencyCode, String govAgencyName, int registrationState,
String registrationClass, ServiceContext serviceContext) throws SystemException, PortalException {
List<Registration> listRegistration = RegistrationLocalServiceUtil.getRegistrationByGID_UID(groupId,
serviceContext.getUserId());
if (listRegistration.size() == 0) {
return RegistrationLocalServiceUtil.insert(groupId, companyId, applicantName, applicantIdType, applicantIdNo,
applicantIdDate, address, cityCode, cityName, districtCode, districtName, wardCode, wardName,
contactName, contactTelNo, contactEmail, govAgencyCode, govAgencyName, 0, "", serviceContext);
} else {
Registration registration = listRegistration.get(0);
int state = registration.getRegistrationState();
if (state == 2) {
return RegistrationLocalServiceUtil.insert(groupId, companyId, applicantName, applicantIdType, applicantIdNo,
applicantIdDate, address, cityCode, cityName, districtCode, districtName, wardCode, wardName,
contactName, contactTelNo, contactEmail, govAgencyCode, govAgencyName, 0, "", serviceContext);
} else {
return registration;
}
}
}
示例2: deleteGroupTaskRecords
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
/**
*
* @param groupId
* @return
* @since 1.5.2
*/
@Override
public List<TaskRecord> deleteGroupTaskRecords(long groupId) throws PortalException {
List<TaskRecord> taskRecords = taskRecordPersistence.findByGroupId(groupId);
for (TaskRecord taskRecord : taskRecords) {
try {
deleteTaskRecord(taskRecord);
} catch (Exception e) {
_log.error(e);
}
}
return taskRecords;
}
示例3: exportTaskRecordsAsFile
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
@Override
public File exportTaskRecordsAsFile(ExportImportConfiguration exportImportConfiguration) throws PortalException {
try {
ExportController taskRecordExportController = ExportImportControllerRegistryUtil
.getExportController(TaskRecord.class.getName());
return taskRecordExportController.export(exportImportConfiguration);
} catch (PortalException pe) {
_log.error(pe);
throw pe;
} catch (Exception e) {
_log.error(e);
throw new SystemException(e);
}
}
示例4: create
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
@Override
public Employee create(
long userId, long companyId, long groupId, String employeeNo,
String fullName, String email, String gender, Date birthDate,
String telNo, String mobile, String title, String workingStatus,
Date recruitDate, Date leaveDate, ServiceContext serviceContext)
throws NoSuchUserException, UnauthenticationException,
UnauthorizationException, DuplicateEmployeeNoException,
DuplicateEmployeeEmailException, PortalException {
Employee ett = null;
ett = EmployeeLocalServiceUtil.addEmployee(
userId, groupId, fullName, employeeNo, GetterUtil.get(gender, 0),
birthDate, telNo, mobile, email, GetterUtil.get(workingStatus, 1),
0l, title, false, recruitDate, leaveDate, serviceContext);
return ett;
}
示例5: getformdatabyRegidRefid
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
@Override
public Response getformdatabyRegidRefid(HttpServletRequest request, HttpHeaders header, Company company,
Locale locale, User user, ServiceContext serviceContext, long registrationId, String referenceUid)
throws PortalException {
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
RegistrationForm registrationForm = RegistrationFormLocalServiceUtil.findFormbyRegidRefid(groupId,
registrationId, referenceUid);
return Response.status(200).entity(registrationForm.getFormData()).build();
} catch (Exception e) {
return processException(e);
}
}
示例6: parseDocumentTypeData
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
/**
* Parse document type data.
*
* @param fileEntryTypeId
* @return JSON object
* @throws PortalException
*/
protected JSONObject parseDocumentTypeData(TermCollector tc, Locale locale) throws PortalException {
long fileEntryTypeId = Long.valueOf(tc.getTerm());
if (fileEntryTypeId == 0) {
return null;
}
DLFileEntryType type = _dLFileEntryTypeService.getFileEntryType(fileEntryTypeId);
JSONObject item = JSONFactoryUtil.createJSONObject();
item.put("frequency", tc.getFrequency());
item.put("groupName", _groupLocalService.getGroup(type.getGroupId()).getName(
locale, true));
item.put("name", type.getName(locale, true));
item.put("term", fileEntryTypeId);
return item;
}
示例7: getformScriptbyRegidRefid
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
@Override
public Response getformScriptbyRegidRefid(HttpServletRequest request, HttpHeaders header, Company company,
Locale locale, User user, ServiceContext serviceContext, long registrationId, String referenceUid)
throws PortalException {
BackendAuth auth = new BackendAuthImpl();
try {
if (!auth.isAuth(serviceContext)) {
throw new UnauthenticationException();
}
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
RegistrationForm registrationForm = RegistrationFormLocalServiceUtil.findFormbyRegidRefid(groupId,
registrationId, referenceUid);
return Response.status(200).entity(registrationForm.getFormScript()).build();
} catch (Exception e) {
return processException(e);
}
}
示例8: onAfterRemove
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
@Override
public void onAfterRemove(DossierFile model) throws ModelListenerException {
String content = "On DossiserFile Delete";
String notificationType = "";
String payload = DossierLogUtils.createPayload(model, null, null);
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(model.getCompanyId());
serviceContext.setUserId(model.getUserId());
try {
DossierLogLocalServiceUtil.addDossierLog(model.getGroupId(), model.getDossierId(), model.getUserName(),
content, notificationType, payload, serviceContext);
} catch (SystemException | PortalException e) {
e.printStackTrace();
}
}
示例9: validateRemove
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
private void validateRemove(long processStepId) throws PortalException {
ProcessStep processStep = processStepPersistence.findByPrimaryKey(processStepId);
// List<ProcessStepRole> processStepRoles =
// processStepRolePersistence.findByP_S_ID(processStepId);
List<ProcessAction> preActions = processActionPersistence.findByPRE_CODE(processStep.getStepCode(),
processStep.getGroupId());
List<ProcessAction> postActions = processActionPersistence.findByPOST_CODE(processStep.getStepCode(),
processStep.getGroupId());
if (preActions.size() != 0 || postActions.size() != 0) {
throw new HasChildrenException("HasChildrenException");
}
}
示例10: findDefaultAssetPublisherInstanceId
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
/**
* Try to find an asset publisher instance id on a layout
*
* @param layout
* @return portlet instance id
* @throws PortalException
* @throws SystemException
*/
public static String findDefaultAssetPublisherInstanceId(Layout layout)
throws PortalException, SystemException {
LayoutTypePortlet layoutType =
(LayoutTypePortlet) layout.getLayoutType();
List<Portlet> portlets = layoutType.getAllPortlets();
for (Portlet p : portlets) {
if (AssetPublisherPortletKeys.ASSET_PUBLISHER.equals(
p.getRootPortletId())) {
return p.getInstanceId();
}
}
throw new PortalException(
"Couldn't find asset publisher on page " + layout.getFriendlyURL() +
". Please check configuration.");
}
示例11: updateFileApproval
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
@Override
public PaymentFile updateFileApproval(long groupId, long id, String referenceUid, String approveDatetime,
String accountUserName, String govAgencyTaxNo, String invoiceTemplateNo, String invoiceIssueNo,
String invoiceNo, ServiceContext serviceContext)
throws SystemException, PortalException, java.text.ParseException {
PaymentFile paymentFile = PaymentFileLocalServiceUtil.updateFileApproval(groupId, id, referenceUid,
approveDatetime, accountUserName, govAgencyTaxNo, invoiceTemplateNo, invoiceIssueNo, invoiceNo,
serviceContext);
// Add PaymentFileSync
Dossier dossier = DossierLocalServiceUtil.getDossier(paymentFile.getDossierId());
// TODO review serverNo on this
DossierSyncLocalServiceUtil.updateDossierSync(groupId, serviceContext.getUserId(), paymentFile.getDossierId(),
dossier.getReferenceUid(), false, 3, paymentFile.getPrimaryKey(), paymentFile.getReferenceUid(),
StringPool.BLANK);
return paymentFile;
}
示例12: getDossier
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
protected Dossier getDossier(String id, long groupId) throws PortalException {
// TODO update logic here
long dossierId = GetterUtil.getLong(id);
Dossier dossier = null;
if (dossierId != 0) {
dossier = DossierLocalServiceUtil.fetchDossier(dossierId);
}
if (Validator.isNull(dossier)) {
dossier = DossierLocalServiceUtil.getByRef(groupId, id);
}
return dossier;
}
示例13: getPreferences
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
protected PortletPreferences getPreferences(long groupId)
throws PortalException {
long ownerId = groupId;
int ownerType = PortletKeys.PREFS_OWNER_TYPE_GROUP;
long plid = 0;
com.liferay.portal.kernel.model.PortletPreferences portletPreferences = _portletPreferencesLocalService
.getPortletPreferences(ownerId, ownerType, plid,
ch.inofix.data.constants.PortletKeys.DATA_MANAGER);
PortletPreferences preferences = PortletPreferencesFactoryUtil
.fromDefaultXML(portletPreferences.getPreferences());
return preferences;
}
示例14: reindex
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
protected void reindex(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = DossierPartLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<DossierPart>() {
@Override
public void performAction(DossierPart object) {
try {
Document document = getDocument(object);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index contact " + object.getPrimaryKey(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}
示例15: importContacts
import com.liferay.portal.kernel.exception.PortalException; //導入依賴的package包/類
@Override
public void importContacts(ExportImportConfiguration exportImportConfiguration, File file) throws PortalException {
try {
ImportController contactImportController = ExportImportControllerRegistryUtil
.getImportController(Contact.class.getName());
contactImportController.importFile(exportImportConfiguration, file);
} catch (PortalException pe) {
Throwable cause = pe.getCause();
if (cause instanceof LocaleException) {
throw (PortalException) cause;
}
throw pe;
} catch (SystemException se) {
throw se;
} catch (Exception e) {
throw new SystemException(e);
}
}