當前位置: 首頁>>代碼示例>>Java>>正文


Java SystemException類代碼示例

本文整理匯總了Java中com.liferay.portal.kernel.exception.SystemException的典型用法代碼示例。如果您正苦於以下問題:Java SystemException類的具體用法?Java SystemException怎麽用?Java SystemException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SystemException類屬於com.liferay.portal.kernel.exception包,在下文中一共展示了SystemException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: importContactsInBackground

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Override
public long importContactsInBackground(long userId, ExportImportConfiguration exportImportConfiguration,
        InputStream inputStream, String extension) throws PortalException {

    File file = null;

    try {

        file = FileUtil.createTempFile(extension);

        FileUtil.write(file, inputStream);

        return importContactsInBackground(userId, exportImportConfiguration, file);

    } catch (IOException ioe) {
        throw new SystemException(ioe);
    } finally {
        FileUtil.delete(file);
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:21,代碼來源:ContactLocalServiceImpl.java

示例2: exportTaskRecordsAsFile

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的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);
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:18,代碼來源:TaskRecordLocalServiceImpl.java

示例3: importTaskRecords

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Override
public void importTaskRecords(ExportImportConfiguration exportImportConfiguration, File file)
        throws PortalException {

    try {
        ImportController taskRecordImportController = ExportImportControllerRegistryUtil
                .getImportController(TaskRecord.class.getName());

        taskRecordImportController.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);
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:25,代碼來源:TaskRecordLocalServiceImpl.java

示例4: exportContactsAsFile

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Override
public File exportContactsAsFile(ExportImportConfiguration exportImportConfiguration) throws PortalException {

    try {
        ExportController contactExportController = ExportImportControllerRegistryUtil
                .getExportController(Contact.class.getName());

        return contactExportController.export(exportImportConfiguration);

    } catch (PortalException pe) {
        _log.error(pe);
        throw pe;
    } catch (Exception e) {
        _log.error(e);
        throw new SystemException(e);
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:18,代碼來源:ContactLocalServiceImpl.java

示例5: importContacts

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的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);
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:24,代碼來源:ContactLocalServiceImpl.java

示例6: onAfterCreate

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Override
public void onAfterCreate(PaymentFile model) throws ModelListenerException {
	String content = "On PaymentFile Created";
	String notificationType = "";
	String payload = DossierLogUtils.createPayload(null, model, 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();
	}
	super.onAfterCreate(model);
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:18,代碼來源:PaymentFileListenner.java

示例7: onAfterRemove

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Override
public void onAfterRemove(PaymentFile model) throws ModelListenerException {
	String content = "On PaymentFile Delete";
	String notificationType = "";
	String payload = DossierLogUtils.createPayload(null, model, 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();
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:18,代碼來源:PaymentFileListenner.java

示例8: onAfterUpdate

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Override
public void onAfterUpdate(PaymentFile model) throws ModelListenerException {
	String content = "On PaymentFile Update";
	String notificationType = "";
	String payload = DossierLogUtils.createPayload(null, model, null);
	
	ServiceContext serviceContext = new ServiceContext();
	serviceContext.setCompanyId(model.getCompanyId());
	serviceContext.setUserId(model.getUserId());
	
	try {
		boolean hasChangedStatus = modelBeforeUpdate.getPaymentStatus() == model.getPaymentStatus();
		if (hasChangedStatus && model.getPaymentStatus() ==1 ) {
			notificationType = NotificationType.DOSSIER_07;
		} else if (hasChangedStatus && model.getPaymentStatus() ==2 ) {
			notificationType = NotificationType.DOSSIER_08;
		}
		
		DossierLogLocalServiceUtil.addDossierLog(model.getGroupId(), model.getDossierId(), model.getUserName(), content,
				notificationType, payload, serviceContext);
	} catch (SystemException | PortalException e) {
		e.printStackTrace();
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:25,代碼來源:PaymentFileListenner.java

示例9: onAfterCreate

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Override
public void onAfterCreate(DossierFile model) throws ModelListenerException {
	_log.info("After Created........... ");
	ServiceContext serviceContext = new ServiceContext();
	serviceContext.setCompanyId(model.getCompanyId());
	serviceContext.setUserId(model.getUserId());
	try {
		// Binhth add message bus to processing KySO file
		Message message = new Message();
		DossierPart dossierPart = DossierPartLocalServiceUtil.fetchByTemplatePartNo(model.getGroupId(),
				model.getDossierTemplateNo(), model.getDossierPartNo());
		
		JSONObject msgDataESign = JSONFactoryUtil.createJSONObject();
		msgDataESign.put("userId", model.getUserId());
		msgDataESign.put("eSign", dossierPart.getESign());
		msgDataESign.put("fileEntryId", model.getFileEntryId());

		message.put("msgToEngine", msgDataESign);
		MessageBusUtil.sendMessage("kyso/engine/out/destination", message);
	} catch (SystemException | PortalException e) {
		e.printStackTrace();
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:24,代碼來源:DossierFileKySoListenner.java

示例10: onAfterRemove

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的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();
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:18,代碼來源:DossierFileListenner.java

示例11: updateFormData

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Indexable(type = IndexableType.REINDEX)
public RegistrationForm updateFormData(long groupId, long registrationId, String referenceUid, String formData,
		ServiceContext serviceContext) 
	throws PortalException, SystemException {

	RegistrationForm registrationForm = registrationFormPersistence.findByG_REGID_REFID(groupId, registrationId, referenceUid);

	String jrxmlTemplate = registrationForm.getFormReport();

	registrationForm.setFormData(formData);
	registrationForm.setIsNew(true);

	Message message = new Message();

	JSONObject msgData = JSONFactoryUtil.createJSONObject();
	msgData.put("className", RegistrationForm.class.getName());
	msgData.put("classPK", registrationForm.getPrimaryKey());
	msgData.put("jrxmlTemplate", jrxmlTemplate);
	msgData.put("formData", formData);
	msgData.put("userId", serviceContext.getUserId());

	message.put("msgToEngine", msgData);
	MessageBusUtil.sendMessage("jasper/engine/out/destination", message);

	return registrationFormPersistence.update(registrationForm);
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:27,代碼來源:RegistrationFormLocalServiceImpl.java

示例12: findDefaultAssetPublisherInstanceId

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的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.");
}
 
開發者ID:peerkar,項目名稱:liferay-gsearch,代碼行數:28,代碼來源:GSearchUtil.java

示例13: hasFolder

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
public static boolean hasFolder(
	long groupId, long parentFolderId, String name) {

	boolean result = false;

	DLFolder dlFolder = null;

	try {
		dlFolder = DLFolderLocalServiceUtil.fetchFolder(
			groupId, parentFolderId, name);
	}
	catch (SystemException e) {
		_log.error(e);
	}

	result = dlFolder != null ? true : false;

	return result;
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:20,代碼來源:DLFolderUtil.java

示例14: addRegistrationFormbaseonRegTemplate

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的package包/類
@Override
public void addRegistrationFormbaseonRegTemplate(long groupId, long companyId, long registrationId, String govAgencyCode,
		ServiceContext serviceContext) throws PortalException, SystemException {
	// get lstRegistrationTemplate
	List<RegistrationTemplates> lstRegistrationTemplate = RegistrationTemplatesLocalServiceUtil
			.getRegistrationTemplatesbyGOVCODE(groupId, govAgencyCode);

	// add registrationForm
	for (RegistrationTemplates registrationTemplates : lstRegistrationTemplate) {
		// create referenceUid
		String referenceUid = UUID.randomUUID().toString();

		RegistrationFormLocalServiceUtil.addRegistrationForm(groupId, companyId, registrationId, referenceUid,
				registrationTemplates.getFormNo(), registrationTemplates.getFormName(),
				registrationTemplates.getSampleData(), registrationTemplates.getFormScript(),
				registrationTemplates.getFormReport(), 0, false, false, serviceContext);
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:19,代碼來源:RegistrationFormActionsImpl.java

示例15: updateFileApproval

import com.liferay.portal.kernel.exception.SystemException; //導入依賴的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;
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:21,代碼來源:PaymentFileActionsImpl.java


注:本文中的com.liferay.portal.kernel.exception.SystemException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。