Java源码示例:com.liferay.portal.kernel.exception.PortalException
示例1
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;
}
示例2
@Override
public ActionConfig updateActionConfig(Long actionConfigId, long userId, long groupId, String actionCode,
String actionName, Boolean extraForm, String formScript, String sampleData, Boolean insideProcess,
Integer userNote, Integer syncType, Boolean pending, Boolean rollbackable, String notificationType,
String documentType, String mappingAction, ServiceContext serviceContext) throws PortalException, AuthenticationException {
BackendAuthImpl authImpl = new BackendAuthImpl();
if (authImpl.hasResource(serviceContext, StringPool.BLANK, StringPool.BLANK)) {
ActionConfig object = ActionConfigLocalServiceUtil.getActionConfig(actionConfigId);
object = ActionConfigLocalServiceUtil.updateActionConfig(object.getActionConfigId(), userId, groupId, actionCode,
actionName, extraForm, formScript, sampleData, insideProcess, userNote, syncType, pending,
rollbackable, notificationType, documentType, mappingAction);
return object;
} else {
throw new AuthenticationException();
}
}
示例3
/**
* @param dossierPartId
* @param contentType
* @return
* @throws PortalException
*/
public String getContent(long dossierPartId, int contentType) throws PortalException {
DossierPart object = dossierPartPersistence.fetchByPrimaryKey(dossierPartId);
String content = StringPool.BLANK;
if (contentType == 1) {
content = object.getFormScript();
}
if (contentType == 2) {
content = object.getFormReport();
}
if (contentType == 3) {
content = object.getSampleData();
}
return content;
}
示例4
protected void reindexResourceUser(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = ResourceUserLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<ResourceUser>() {
@Override
public void performAction(ResourceUser resourceUser) {
try {
Document document = getDocument(resourceUser);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index contact " + resourceUser.getResourceUserId(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}
示例5
protected void reindex(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = DeliverableLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Deliverable>() {
@Override
public void performAction(Deliverable 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();
}
示例6
@Override
public boolean deleteAllFileTemplate(long userId, long groupId, long serviceInfoId, ServiceContext serviceContext) {
boolean flag = false;
List<ServiceFileTemplate> fileTemplateList = ServiceFileTemplateLocalServiceUtil.getByServiceInfoId(serviceInfoId);
if (fileTemplateList != null && fileTemplateList.size() > 0) {
long fileEntryId = 0;
for (ServiceFileTemplate serviceFileTemplate : fileTemplateList) {
fileEntryId = serviceFileTemplate.getFileEntryId();
if (fileEntryId > 0) {
try {
DLAppLocalServiceUtil.deleteFileEntry(fileEntryId);
} catch (PortalException e) {
_log.debug(e);
//_log.error(e);
return false;
}
}
ServiceFileTemplateLocalServiceUtil.deleteServiceFileTemplate(serviceFileTemplate);
flag = true;
}
} else {
flag = true;
}
return flag;
}
示例7
@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 BusinessExceptionImpl.processException(e);
}
}
示例8
@Override
public long updateServiceInfoDB(long userId, long groupId, String serviceCode, String serviceName, String processText,
String methodText, String dossierText, String conditionText, String durationText, String applicantText,
String resultText, String regularText, String feeText, String administrationCode, String administrationName,
String domainCode, String domainName, Integer maxLevel, boolean public_) throws PortalException {
ServiceInfo serInfo = ServiceInfoLocalServiceUtil.updateServiceInfoDB(userId, groupId, serviceCode, serviceName, processText,
methodText, dossierText, conditionText, durationText, applicantText, resultText, regularText, feeText,
administrationCode, administrationName, domainCode, domainName, maxLevel, public_);
if (serInfo != null) {
return serInfo.getServiceInfoId();
}
return 0;
}
示例9
@Override
public StepConfig updateStepConfigDB(long userId, long groupId, String stepCode, String stepName, Integer stepType,
String dossierStatus, String dossierSubStatus, String menuGroup, String menuStepName, String buttonConfig)
throws PortalException {
return StepConfigLocalServiceUtil.updateStepConfigDB(userId, groupId, stepCode, stepName, stepType,
dossierStatus, dossierSubStatus, menuGroup, menuStepName, buttonConfig);
}
示例10
@Override
public FileEntry getFileEntry(long id, ServiceContext serviceContext) {
FileEntry fileEntry = null;
OfficeSite officeSite = OfficeSiteLocalServiceUtil.fetchOfficeSite(id);
try {
fileEntry = DLAppLocalServiceUtil.getFileEntry(officeSite.getLogoFileEntryId());
} catch (PortalException e) {
_log.error(e);
}
return fileEntry;
}
示例11
public static void cleanDossierLog(long groupId, long userId, ServiceContext serviceContext) throws PortalException {
Indexer<DossierLog> indexer = IndexerRegistryUtil
.nullSafeGetIndexer(DossierLog.class);
LinkedHashMap<String, Object> params = new LinkedHashMap<String, Object>();
params.put(Field.GROUP_ID, String.valueOf(groupId));
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(serviceContext.getCompanyId());
Sort[] sorts = new Sort[] { };
Hits hits = DossierLogLocalServiceUtil.searchLucene(params, sorts, QueryUtil.ALL_POS, QueryUtil.ALL_POS, searchContext);
long total = DossierLogLocalServiceUtil.countLucene(params, searchContext);
if (total > 0) {
List<Document> lstDocs = (List<Document>) hits.toList();
for (Document document : lstDocs) {
long dossierLogId = GetterUtil.getLong(document.get(DossierLogTerm.DOSSIER_LOG_ID));
long companyId = GetterUtil.getLong(document.get(Field.COMPANY_ID));
String uid = document.get(Field.UID);
DossierLog oldLog = DossierLogLocalServiceUtil.fetchDossierLog(dossierLogId);
if (oldLog == null) {
try {
indexer.delete(companyId, uid);
} catch (SearchException e) {
_log.debug(e);
//_log.error(e);
}
}
}
}
List<DossierLog> lstLogs = DossierLogLocalServiceUtil.findByGroup(groupId);
for (DossierLog dl : lstLogs) {
DossierLogLocalServiceUtil.deleteDossierLog(dl.getDossierLogId());
}
}
示例12
public static JSONObject getNotificationTemplates(
long userId, long companyId, long groupId,
LinkedHashMap<String, Object> params, Sort[] sorts, int start, int end,
ServiceContext serviceContext)
throws PortalException, SystemException {
return getNotificationTemplateBusiness().getNotificationTemplates(
userId, companyId, groupId, params, sorts, start, end,
serviceContext);
}
示例13
@Override
public void updateDossierPartDB(long userId, long groupId, String templateNo, String partNo, String partName,
String partTip, Integer partType, boolean multiple, String formScript, String formReport, boolean required,
boolean esign, String fileTemplateNo, String deliverableType, Integer deliverableAction, boolean eForm,
String sampleData, Integer fileMark, ServiceContext serviceContext) throws PortalException {
DossierPartLocalServiceUtil.updateDossierPartDB(userId, groupId, templateNo, partNo, partName, partTip,
partType, multiple, formScript, formReport, required, esign, fileTemplateNo, deliverableType,
deliverableAction, eForm, sampleData, fileMark, serviceContext);
}
示例14
@Override
public Notificationtemplate create(
long userId, long groupId, String notificationType, String emailBody,
String emailSubject, String sendEmail, String textMessage,
String textSMS, String expireDuration, String userUrlPattern,
String guestUrlPattern, String interval, String grouping,
ServiceContext serviceContext)
throws PortalException, SystemException {
return create(
userId, groupId, notificationType, emailBody, emailSubject,
sendEmail, textMessage, textSMS, expireDuration, userUrlPattern,
guestUrlPattern, interval, grouping, serviceContext);
}
示例15
@Override
public DossierPart updateDossierPart(long groupId, long dossierPartId, String templateNo, String partNo,
String partName, String partTip, int partType, boolean multiple, String formScript, String formReport,
String sampleData, boolean required, String fileTemplateNo, boolean eSign, String deliverableType,
int deliverableAction, ServiceContext context) throws PortalException {
return DossierPartLocalServiceUtil.updateDossierPart(groupId, dossierPartId, templateNo, partNo, partName,
partTip, partType, multiple, formScript, formReport, sampleData, required, fileTemplateNo, eSign,
deliverableType, deliverableAction, context);
}
示例16
@Override
public Dossier assignDossierToProcess(long dossierId, String dossierNote, String submissionNote, String briefNote,
String dossierNo, long folderId, long dossierActionId, String serverNo, ServiceContext context)
throws PortalException {
return DossierLocalServiceUtil.assignToProcess(dossierId, dossierNote, submissionNote, briefNote, dossierNo,
folderId, dossierActionId, serverNo, context);
}
示例17
protected ProcessOption getProcessOption(String serviceInfoCode, String govAgencyCode, String dossierTemplateNo,
long groupId) throws PortalException {
ServiceConfig config = ServiceConfigLocalServiceUtil.getBySICodeAndGAC(groupId, serviceInfoCode, govAgencyCode);
return ProcessOptionLocalServiceUtil.getByDTPLNoAndServiceCF(groupId, dossierTemplateNo,
config.getServiceConfigId());
}
示例18
@Override
public DossierStatistic insertDossierStatistic(long groupId, int month, int year, int remainingCount,
int receivedCount, int onlineCount, int undueCount, int overdueCount, int ontimeCount, int overtimeCount,
String govAgencyCode, String govAgencyName, String domainCode, String domainName, int administrationLevel,
boolean reporting, ServiceContext serviceContext) throws PortalException {
return DossierStatisticLocalServiceUtil.insert(groupId, month, year, remainingCount, receivedCount, onlineCount,
undueCount, overdueCount, ontimeCount, overtimeCount, govAgencyCode, govAgencyName, domainCode,
domainName, administrationLevel, reporting, serviceContext);
}
示例19
@Override
public ActionConfig updateActionConfigDB(long userId, long groupId, String actionCode, String actionName,
Boolean extraForm, String sampleData, Boolean insideProcess, Integer userNote, Integer syncType,
Integer eventType, Integer infoType, Boolean rollbackable, String notificationType, String documentType,
String formConfig, String mappingAction, int dateOption) throws PortalException {
return ActionConfigLocalServiceUtil.updateActionConfigDB(userId, groupId, actionCode, actionName, extraForm,
sampleData, insideProcess, userNote, syncType, eventType, infoType, rollbackable, notificationType,
documentType, formConfig, mappingAction, dateOption);
}
示例20
@Override
public String updateFormReport(long groupId, long dossierTemplateId, String partNo, String input,
ServiceContext context) throws PortalException {
long dossierPartId = getDosssierPartId(groupId, dossierTemplateId, partNo);
return DossierPartLocalServiceUtil.updateContent(dossierPartId, DOSSIER_PART_CONTENT_TYPE_REPORT, input,
context);
}
示例21
public RegistrationTemplates addRegistrationTemplates(long groupId, String govAgencyCode, String govAgencyName,
String formNo, String formName, boolean multiple, String formScript, String formReport, String sampleData,
ServiceContext serviceContext) throws PortalException, SystemException {
// TODO Add RegistrationTemplates
long userId = serviceContext.getUserId();
Date now = new Date();
User userAction = userLocalService.getUser(userId);
long registrationTemplateId = counterLocalService.increment(RegistrationTemplates.class.getName());
RegistrationTemplates object = registrationTemplatesPersistence.create(registrationTemplateId);
/// Add audit fields
object.setGroupId(groupId);
object.setCreateDate(now);
object.setModifiedDate(now);
object.setUserId(userAction.getUserId());
object.setUserName(userAction.getFullName());
// Add other fields
object.setRegistrationTemplateId(registrationTemplateId);
object.setGovAgencyCode(govAgencyCode);
object.setGovAgencyName(govAgencyName);
object.setFormNo(formNo);
object.setFormName(formName);
object.setMultiple(multiple);
object.setFormScript(formScript);
object.setFormReport(formReport);
object.setSampleData(sampleData);
return registrationTemplatesPersistence.update(object);
}
示例22
protected void reindexMComment(long companyId) throws PortalException {
final IndexableActionableDynamicQuery indexableActionableDynamicQuery = CommentLocalServiceUtil
.getIndexableActionableDynamicQuery();
indexableActionableDynamicQuery.setCompanyId(companyId);
indexableActionableDynamicQuery
.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Comment>() {
@Override
public void performAction(Comment comment) {
try {
Document document = getDocument(comment);
indexableActionableDynamicQuery.addDocuments(document);
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to index Comment " + comment.getCommentId(), pe);
}
}
}
});
indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());
indexableActionableDynamicQuery.performActions();
}
示例23
public Dossier initDossier(long groupId, long dossierId, String referenceUid, int counter, String serviceCode,
String serviceName, String govAgencyCode, String govAgencyName, 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 dossierTemplateNo, String password,
int viaPostal, String postalAddress, String postalCityCode, String postalCityName, String postalTelNo,
boolean online, boolean notification, String applicantNote, int originality,
ServiceInfo service,
ServiceProcess serviceProcess,
ProcessOption processOption,
ServiceContext context) throws PortalException;
示例24
@Override
public Response getFormsbyRegId(HttpHeaders header, long id) throws PortalException {
try {
long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
RegistrationFormActions action = new RegistrationFormActionsImpl();
RegistrationFormResultsModel result = new RegistrationFormResultsModel();
List<RegistrationForm> lstRegistrationForm = action.getFormbyRegId(groupId, id);
int total = lstRegistrationForm.size();
for (RegistrationForm registrationForm : lstRegistrationForm) {
_log.info("registrationFormXXXXXXX: "+registrationForm.getRemoved());
}
List<RegistrationFormModel> lstRegistrationFormModel = RegistrationFormUtils
.mappingToRegistrationFormResultsModel(lstRegistrationForm);
result.setTotal(total);
result.getData().addAll(lstRegistrationFormModel);
return Response.status(200).entity(result).build();
} catch (Exception e) {
return BusinessExceptionImpl.processException(e);
}
}
示例25
@Override
public Company createContext(Message message) {
try {
return _portal.getCompany((HttpServletRequest) message.getContextualProperty("HTTP.REQUEST"));
} catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn("Unable to get company", pe);
}
return null;
}
}
示例26
protected String getServiceName(String serviceCode, String templateNo, long groupId) throws PortalException {
try {
// ServiceInfo service = ServiceInfoLocalServiceUtil.getByCode(groupId, serviceCode);
// if (service != null) {
// List<ServiceConfig> configList = ServiceConfigLocalServiceUtil.getByServiceInfo(groupId,
// service.getServiceInfoId());
// if (configList != null && configList.size() > 0) {
// for (ServiceConfig config : configList) {
// ProcessOption option = ProcessOptionLocalServiceUtil.getByDTPLNoAndServiceCF(groupId,
// templateNo, config.getServiceConfigId());
// if (option != null) {
// return option.getOptionName();
// }
// }
// }
// }
ServiceInfo service = ServiceInfoLocalServiceUtil.getByCode(groupId, serviceCode);
if (service != null) {
return service.getServiceName();
}
} catch (Exception e) {
_log.debug(e);
throw new NotFoundException("NotFoundExceptionWithServiceCode");
}
return StringPool.BLANK;
}
示例27
@Override
public String updateFormScript(long groupId, long dossierTemplateId, String partNo, String input,
ServiceContext context) throws PortalException {
long dossierPartId = getDosssierPartId(groupId, dossierTemplateId, partNo);
return DossierPartLocalServiceUtil.updateContent(dossierPartId, DOSSIER_PART_CONTENT_TYPE_SCRIPT, input,
context);
}
示例28
public static NotificationQueue update(
NotificationQueue notificationQueue, ServiceContext serviceContext)
throws NoSuchNotificationQueueException {
try {
return getNotificationQueueBusiness().update(notificationQueue, serviceContext);
}
catch (SystemException | PortalException e) {
_log.debug(e);
return null;
}
}
示例29
@Override
public VotingResultResponse finderVotingStatistic(VotingResultRequest votingRequest)
throws PortalException, SystemException {
// LOG.info("***DossierStatisticFinderServiceImpl");
List<OpencpsVotingStatistic> votingList = OpencpsVotingStatisticLocalServiceUtil.searchVotingStatistic(
votingRequest.getGroupId(), votingRequest.getMonth(), votingRequest.getYear(),
votingRequest.getVotingCode(), votingRequest.getDomain(), votingRequest.getGovAgencyCode(),
votingRequest.getStart(), votingRequest.getEnd());
return VotingStatisticConverter.getVotingResultResponse().convert(votingList);
}
示例30
@Override
public RegistrationTemplates updateFormScript(long groupId, long registrationTemplateId, String formScript,
ServiceContext serviceContext) throws SystemException, PortalException {
return RegistrationTemplatesLocalServiceUtil.updateFormScript(groupId, registrationTemplateId, formScript,
serviceContext);
}