本文整理汇总了Java中org.kuali.rice.krad.service.DocumentDictionaryService类的典型用法代码示例。如果您正苦于以下问题:Java DocumentDictionaryService类的具体用法?Java DocumentDictionaryService怎么用?Java DocumentDictionaryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocumentDictionaryService类属于org.kuali.rice.krad.service包,在下文中一共展示了DocumentDictionaryService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMergeUrl
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
protected HtmlData getMergeUrl(Asset asset) {
FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer = (FinancialSystemMaintenanceDocumentAuthorizerBase) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(CamsConstants.DocumentTypeName.ASSET_RETIREMENT_GLOBAL);
boolean isAuthorized = documentAuthorizer.isAuthorized(asset, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.MERGE, GlobalVariables.getUserSession().getPerson().getPrincipalId());
if (isAuthorized) {
Properties parameters = new Properties();
parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.MAINTENANCE_NEWWITHEXISTING_ACTION);
parameters.put(KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, AssetRetirementGlobal.class.getName());
parameters.put(CamsPropertyConstants.AssetRetirementGlobal.MERGED_TARGET_CAPITAL_ASSET_NUMBER, asset.getCapitalAssetNumber().toString());
parameters.put(KFSConstants.OVERRIDE_KEYS, CamsPropertyConstants.AssetRetirementGlobal.RETIREMENT_REASON_CODE + KFSConstants.FIELD_CONVERSIONS_SEPERATOR + CamsPropertyConstants.AssetRetirementGlobal.MERGED_TARGET_CAPITAL_ASSET_NUMBER);
parameters.put(CamsPropertyConstants.AssetRetirementGlobal.RETIREMENT_REASON_CODE, CamsConstants.AssetRetirementReasonCode.MERGED);
parameters.put(KFSConstants.REFRESH_CALLER, CamsPropertyConstants.AssetRetirementGlobal.RETIREMENT_REASON_CODE + "::" + CamsConstants.AssetRetirementReasonCode.MERGED);
String href = UrlFactory.parameterizeUrl(KFSConstants.MAINTENANCE_ACTION, parameters);
return new AnchorHtmlData(href, CamsConstants.AssetActions.MERGE, CamsConstants.AssetActions.MERGE);
}
else {
return new AnchorHtmlData("", "", "");
}
}
示例2: getReturnUrl
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
/**
* Overrides the base implementation to add in new parameters to the return url
* <ul>
* <li>{@link KFSConstants.DISPATCH_REQUEST_PARAMETER}</li>
* <li>{@link KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE}</li>
* <li>{@link KFSConstants.OVERRIDE_KEYS}</li>
* </ul>
* {@link KFSConstants.DISPATCH_REQUEST_PARAMETER}
*
* @see org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getReturnUrl(org.kuali.rice.krad.bo.BusinessObject,
* java.util.Map, java.lang.String)
*/
@Override
public HtmlData getReturnUrl(BusinessObject businessObject, LookupForm lookupForm, List returnKeys, BusinessObjectRestrictions businessObjectRestrictions) {
AssetAcquisitionType assetAcquisitionType = (AssetAcquisitionType) businessObject;
AssetGlobalService assetGlobalService = SpringContext.getBean(AssetGlobalService.class);
if (initializingAssetGlobal && !assetAcquisitionType.isActive()) {
// no return URL if we are initializing asset global and the record is inactive
return getEmptyAnchorHtmlData();
}
else if (assetGlobalService.getNewAcquisitionTypeCode().equalsIgnoreCase(assetAcquisitionType.getAcquisitionTypeCode())) {
// no return if the user is not authorized to initiate 'New' acquisition type.
DocumentAuthorizer documentAuthorizer = SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(CamsConstants.DocumentTypeName.ASSET_ADD_GLOBAL);
boolean isAuthorized = documentAuthorizer.isAuthorized(businessObject, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.USE_ACQUISITION_TYPE_NEW, GlobalVariables.getUserSession().getPerson().getPrincipalId());
if (!isAuthorized) {
return getEmptyAnchorHtmlData();
}
}
// return URL
Properties parameters = generateUrlParameters(businessObject, lookupForm, returnKeys);
return getReturnAnchorHtmlData(businessObject, parameters, lookupForm, returnKeys, businessObjectRestrictions);
}
示例3: checkNegativeOrZeroPayment
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
/**
* "Add Negative Payment" permission check.
*
* @param maintenanceDocument
* @param assetPaymentDetail
* @return
*/
protected boolean checkNegativeOrZeroPayment(MaintenanceDocument maintenanceDocument, AssetPaymentDetail assetPaymentDetail) {
boolean success = true;
FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer = (FinancialSystemMaintenanceDocumentAuthorizerBase) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(maintenanceDocument);
boolean isAuthorized = documentAuthorizer.isAuthorized(maintenanceDocument, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.ADD_NEGATIVE_PAYMENTS, GlobalVariables.getUserSession().getPerson().getPrincipalId());
if (!isAuthorized && assetPaymentDetail.getAmount() != null && assetPaymentDetail.getAmount().isNegative()) {
GlobalVariables.getMessageMap().putError(CamsPropertyConstants.AssetPaymentDetail.AMOUNT, CamsKeyConstants.AssetGlobal.ERROR_INVALID_PAYMENT_AMOUNT);
success = false;
}
// amount can not be zero for any user
if (assetPaymentDetail.getAmount().isZero()) {
GlobalVariables.getMessageMap().putError(CamsPropertyConstants.AssetPaymentDetail.AMOUNT, CamsKeyConstants.AssetGlobal.ERROR_INVALID_PAYMENT_AMOUNT);
success = false;
}
return success;
}
示例4: getDocumentDictionaryService
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
public DocumentDictionaryService getDocumentDictionaryService() {
if (documentDictionaryService == null) {
documentDictionaryService = KRADServiceLocatorWeb.getDocumentDictionaryService();
}
return documentDictionaryService;
}
示例5: setupServices
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
/**
* Wire up services and mocks, and plunk them the GRL as needed to get the maintenance document serialization
* functionality up and working.
*/
@BeforeClass
public static void setupServices() {
// create a mock LegacyDataAdapter that will answer all the questions it is asked appropriately
mockLegacyDataAdapter = mock(LegacyDataAdapter.class);
mockWorkflowDocumentService = mock(WorkflowDocumentService.class);
mockDocumentDictionaryService = mock(DocumentDictionaryService.class);
when(mockLegacyDataAdapter.areNotesSupported(any(Class.class))).thenReturn(Boolean.FALSE);
when(mockLegacyDataAdapter.isProxied(anyObject())).thenReturn(Boolean.FALSE);
xmlObjectSerializerServiceImpl.setLegacyDataAdapter(mockLegacyDataAdapter);
// create a DataObjectSerializerServiceImpl that will be used in KRAD to determine whether a given field is serialized
DataObjectSerializerServiceImpl dataObjectSerializerService = new DataObjectSerializerServiceImpl();
dataObjectSerializerService.setLegacyDataAdapter(mockLegacyDataAdapter);
// put needed mock and hand wired services into the GRL
GlobalResourceLoaderTestUtils.addMockService(KRADServiceLocatorWeb.LEGACY_DATA_ADAPTER, mockLegacyDataAdapter);
GlobalResourceLoaderTestUtils.addMockService(KRADServiceLocator.KRAD_SERIALIZER_SERVICE, dataObjectSerializerService);
GlobalResourceLoaderTestUtils.addMockService(KRADServiceLocator.XML_OBJECT_SERIALIZER_SERVICE,
xmlObjectSerializerServiceImpl);
GlobalResourceLoaderTestUtils.addMockService(KewApiServiceLocator.WORKFLOW_DOCUMENT_SERVICE,
mockWorkflowDocumentService);
GlobalResourceLoaderTestUtils.addMockService(KRADServiceLocatorWeb.DOCUMENT_DICTIONARY_SERVICE, mockDocumentDictionaryService);
when(mockWorkflowDocumentService.getDocument(anyString())).thenReturn(Document.Builder.create("1","1","1","1").build());
when(mockDocumentDictionaryService.getMaintainableClass(anyString())).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
return MaintainableImpl.class;
}
});
}
示例6: checkAuthorization
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
protected void checkAuthorization( HttpServletRequest request ) {
boolean authorized = false;
String principalName = ((AuthenticationService) GlobalResourceLoader.getResourceLoader().getService(new QName("kimAuthenticationService"))).getPrincipalName(request);
if ( LOG.isInfoEnabled() ) {
LOG.info("Logged In User: " + principalName);
}
if ( StringUtils.isNotBlank(principalName) ) {
Person person = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(principalName);
if ( person != null ) {
String principalId = person.getPrincipalId();
Map<String,String> permissionDetails = new HashMap<String,String>();
DocumentAuthorizer da = SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer("GLCP");
if ( da != null ) {
authorized = da.canInitiate("GLCP", person);
}
if ( !authorized ) {
da = SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer("LLCP");
if ( da != null ) {
authorized = da.canInitiate("LLCP", person);
}
}
}
}
if ( !authorized ) {
throw new RuntimeException( "You must be able to initiate the GLCP or LLCP documents to use this page. (Backdoor users are not recognized.)" );
}
}
示例7: getSeparateUrl
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
protected HtmlData getSeparateUrl(Asset asset) {
FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer = (FinancialSystemMaintenanceDocumentAuthorizerBase) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(CamsConstants.DocumentTypeName.ASSET_ADD_GLOBAL);
boolean isAuthorized = documentAuthorizer.isAuthorized(asset, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.SEPARATE, GlobalVariables.getUserSession().getPerson().getPrincipalId());
if (isAuthorized) {
String href = UrlFactory.parameterizeUrl(KFSConstants.MAINTENANCE_ACTION, getSeparateParameters(asset));
return new AnchorHtmlData(href, KFSConstants.MAINTENANCE_NEW_METHOD_TO_CALL, CamsConstants.AssetActions.SEPARATE);
}
else {
return new AnchorHtmlData("", "", "");
}
}
示例8: getTransferUrl
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
protected HtmlData getTransferUrl(Asset asset) {
boolean isAuthorized = true;
boolean assetMovable = false;
try {
assetMovable = getAssetService().isAssetMovableCheckByPayment(asset);
} catch (ValidationException ve) {
isAuthorized = false;
}
if (!assetMovable) {
FinancialSystemTransactionalDocumentAuthorizerBase documentAuthorizer = (FinancialSystemTransactionalDocumentAuthorizerBase)SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(CamsConstants.DocumentTypeName.ASSET_TRANSFER);
isAuthorized = documentAuthorizer.isAuthorized(asset, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.SEPARATE, GlobalVariables.getUserSession().getPerson().getPrincipalId());
}
if (isAuthorized) {
Properties parameters = new Properties();
parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
parameters.put(CamsPropertyConstants.AssetTransferDocument.CAPITAL_ASSET_NUMBER, asset.getCapitalAssetNumber().toString());
parameters.put(KFSConstants.PARAMETER_COMMAND, "initiate");
parameters.put(KFSConstants.DOCUMENT_TYPE_NAME, CamsConstants.DocumentTypeName.ASSET_TRANSFER);
String href = UrlFactory.parameterizeUrl(CamsConstants.StrutsActions.ONE_UP + CamsConstants.StrutsActions.TRANSFER, parameters);
return new AnchorHtmlData(href, KRADConstants.DOC_HANDLER_METHOD, CamsConstants.AssetActions.TRANSFER);
}
else {
return new AnchorHtmlData("", "", "");
}
}
示例9: getSeparateUrl
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
protected HtmlData getSeparateUrl(AssetPayment assetPayment) {
Asset asset = assetPayment.getAsset();
FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer = (FinancialSystemMaintenanceDocumentAuthorizerBase) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(CamsConstants.DocumentTypeName.ASSET_ADD_GLOBAL);
boolean isAuthorized = documentAuthorizer.isAuthorized(asset, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.SEPARATE, GlobalVariables.getUserSession().getPerson().getPrincipalId());
if (isAuthorized) {
Properties parameters = getSeparateParameters(assetPayment.getAsset());
parameters.put(CamsPropertyConstants.AssetGlobal.SEPERATE_SOURCE_PAYMENT_SEQUENCE_NUMBER, assetPayment.getPaymentSequenceNumber().toString());
String href = UrlFactory.parameterizeUrl(KFSConstants.MAINTENANCE_ACTION, parameters);
return new AnchorHtmlData(href, KFSConstants.MAINTENANCE_NEW_METHOD_TO_CALL, CamsConstants.AssetActions.SEPARATE);
} else {
return new AnchorHtmlData("", "", "");
}
}
示例10: validateNonMoveableAsset
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
/**
* User must be in work group CM_SUPER_USERS to retire a non-moveable asset.
*
* @param asset
* @param maintenanceDocument
* @return
*/
protected boolean validateNonMoveableAsset(Asset asset, MaintenanceDocument maintenanceDocument) {
boolean success = true;
FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer = (FinancialSystemMaintenanceDocumentAuthorizerBase) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(maintenanceDocument);
boolean isAuthorized = documentAuthorizer.isAuthorized(maintenanceDocument, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.RETIRE_NON_MOVABLE_ASSETS, GlobalVariables.getUserSession().getPerson().getPrincipalId());
if (!getAssetService().isAssetMovableCheckByAsset(asset) && !isAuthorized) {
GlobalVariables.getMessageMap().putError(CamsPropertyConstants.AssetRetirementGlobalDetail.CAPITAL_ASSET_NUMBER, CamsKeyConstants.Retirement.ERROR_INVALID_USER_GROUP_FOR_NON_MOVEABLE_ASSET, asset.getCapitalAssetNumber().toString());
success = false;
}
return success;
}
示例11: validateCapitalAssetAmountAboveThreshhold
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
/**
* Validate Capital Asset Amount above the threshold or below the amount for authorized user only.
*
* @param document
* @param assetAmount
* @param capitalizationThresholdAmount
* @return
*/
protected boolean validateCapitalAssetAmountAboveThreshhold(MaintenanceDocument document, KualiDecimal assetAmount, String capitalizationThresholdAmount) {
boolean success = true;
FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer = (FinancialSystemMaintenanceDocumentAuthorizerBase) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(document);
boolean isOverrideAuthorized = documentAuthorizer.isAuthorized(document, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.OVERRIDE_CAPITALIZATION_LIMIT_AMOUNT, GlobalVariables.getUserSession().getPerson().getPrincipalId());
if (assetAmount.isLessThan(new KualiDecimal(capitalizationThresholdAmount)) && !isOverrideAuthorized) {
success = false;
}
return success;
}
示例12: isAllowedRetireMultipleAssets
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
/**
* @see org.kuali.kfs.module.cam.document.service.AssetRetirementService#isAllowedRetireMultipleAssets(java.lang.String)
*/
@Override
public boolean isAllowedRetireMultipleAssets(MaintenanceDocument maintenanceDocument) {
FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer = (FinancialSystemMaintenanceDocumentAuthorizerBase) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(maintenanceDocument);
boolean isAuthorized = documentAuthorizer.isAuthorized(maintenanceDocument, CamsConstants.CAM_MODULE_CODE,
CamsConstants.PermissionNames.RETIRE_MULTIPLE, GlobalVariables.getUserSession().getPerson().getPrincipalId());
return isAuthorized;
}
示例13: getConditionallyReadOnlyPropertyNames
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
@Override
public Set<String> getConditionallyReadOnlyPropertyNames(MaintenanceDocument document) {
Set<String> fields = super.getConditionallyReadOnlyPropertyNames(document);
if (SpringContext.getBean(AssetService.class).isAssetFabrication(document)) {
fields.add(CamsPropertyConstants.Asset.ASSET_INVENTORY_STATUS);
fields.add(CamsPropertyConstants.Asset.VENDOR_NAME);
fields.add(CamsPropertyConstants.Asset.ACQUISITION_TYPE_CODE);
}
else {
// acquisition type code is read-only during edit
fields.add(CamsPropertyConstants.Asset.ACQUISITION_TYPE_CODE);
// fabrication fields are read-only
fields.addAll(Arrays.asList(CamsConstants.Asset.FABRICATION_INFORMATION_FIELDS));
}
Asset asset = (Asset) document.getNewMaintainableObject().getBusinessObject();
// if tag was created in a prior fiscal year, set tag number, asset type code and description as view only
if (SpringContext.getBean(AssetService.class).isAssetTaggedInPriorFiscalYear(asset)) {
AssetAuthorizer documentAuthorizer = (AssetAuthorizer) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(document);
boolean isAuthorized = documentAuthorizer.isAuthorized(document, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.EDIT_WHEN_TAGGED_PRIOR_FISCAL_YEAR, GlobalVariables.getUserSession().getPerson().getPrincipalId());
if (!isAuthorized) {
fields.addAll(SpringContext.getBean(ParameterService.class).getParameterValuesAsString(Asset.class, CamsConstants.Parameters.EDITABLE_FIELDS_WHEN_TAGGED_PRIOR_FISCAL_YEAR));
}
}
return fields;
}
示例14: filterLookupPositions
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
protected List<PositionContract> filterLookupPositions(List<PositionContract> rawResults)
{
DocumentDictionaryService documentDictionaryService = KRADServiceLocatorWeb.getDocumentDictionaryService();
List<PositionContract> results = new ArrayList<PositionContract>();
for (PositionContract positionObj : rawResults)
{
if ( ((PositionDocumentAuthorizer)(documentDictionaryService.getDocumentAuthorizer(this.getMaintenanceDocumentTypeName()))).canView(positionObj, GlobalVariables.getUserSession().getPerson()) )
{
results.add(positionObj);
}
}
return results;
}
示例15: buildMaintenanceActionLink
import org.kuali.rice.krad.service.DocumentDictionaryService; //导入依赖的package包/类
@Override
public void buildMaintenanceActionLink(Link actionLink, Object model, String maintenanceMethodToCall) {
super.buildMaintenanceActionLink(actionLink, model, maintenanceMethodToCall);
if (StringUtils.equals(actionLink.getLinkText(), "copy"))
{
DocumentDictionaryService documentDictionaryService = KRADServiceLocatorWeb.getDocumentDictionaryService();
Map<String, Object> context = actionLink.getContext();
PositionBo bo = ((PositionBo)context.get((String)"line"));
if ( ! (((PositionDocumentAuthorizer)(documentDictionaryService.getDocumentAuthorizer(this.getMaintenanceDocumentTypeName()))).canCopy(bo, GlobalVariables.getUserSession().getPerson())) )
{
actionLink.setRender(false);
return;
}
}
}