本文整理汇总了Java中org.kuali.rice.kim.impl.permission.GenericPermissionBo类的典型用法代码示例。如果您正苦于以下问题:Java GenericPermissionBo类的具体用法?Java GenericPermissionBo怎么用?Java GenericPermissionBo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenericPermissionBo类属于org.kuali.rice.kim.impl.permission包,在下文中一共展示了GenericPermissionBo类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCreateNewUrl
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
/**
* This overridden method ...
*
* @see org.kuali.rice.krad.lookup.KualiLookupableImpl#getCreateNewUrl()
*/
@Override
public String getCreateNewUrl() {
String url = "";
if (getLookupableHelperService().allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_PERMISSION_DOCUMENT_TYPE_NAME)) {
Properties parameters = new Properties();
parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, GenericPermissionBo.class.getName());
if (StringUtils.isNotBlank(getReturnLocation())) {
parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
}
url = UrlFactory.parameterizeUrl(KRADConstants.MAINTENANCE_ACTION, parameters);
url = "<a title=\"Create a new record\" href=\"" + url + "\"><img src=\"images/tinybutton-createnew.gif\" alt=\"create new\" width=\"70\" height=\"15\"/></a>";
}
return url;
}
示例2: getMaintenanceDocumentTypeName
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
@Override
protected String getMaintenanceDocumentTypeName() {
//using DCL idiom to cache genericPermissionDocumentTypeName.
//see effective java 2nd ed. pg. 71
String g = genericPermissionDocumentTypeName;
if (g == null) {
synchronized (this) {
g = genericPermissionDocumentTypeName;
if (g == null) {
genericPermissionDocumentTypeName = g = getMaintenanceDocumentDictionaryService().getDocumentTypeName(
GenericPermissionBo.class);
}
}
}
return g;
}
示例3: saveDataObject
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
/**
* Saves the responsibility via the responsibility update service
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
*/
@Override
public void saveDataObject() {
if (getDataObject() instanceof GenericPermissionBo) {
GenericPermissionBo genericPermissionBo = (GenericPermissionBo)getDataObject();
boolean permissionExists = false;
if (genericPermissionBo.getId() != null) {
permissionExists = KimApiServiceLocator.getPermissionService().getPermission(genericPermissionBo.getId()) != null;
}
if (genericPermissionBo.getTemplateId() != null) {
genericPermissionBo.setTemplate(
PermissionTemplateBo.from(
KimApiServiceLocator.getPermissionService().getPermissionTemplate(genericPermissionBo.getTemplateId())));
}
PermissionBo perm = GenericPermissionBo.toPermissionBo(genericPermissionBo);
if (permissionExists) {
KimApiServiceLocator.getPermissionService().updatePermission(PermissionBo.to(perm));
} else {
KimApiServiceLocator.getPermissionService().createPermission(PermissionBo.to(perm));
}
} else {
throw new RuntimeException(
"Cannot save object of type: " + getDataObjectClass() + " with permission service");
}
}
示例4: saveDataObject
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
/**
* Saves the responsibility via the responsibility update service
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
*/
@Override
public void saveDataObject() {
if (getDataObject() instanceof PersistableBusinessObject) {
GenericPermissionBo genericPermissionBo = (GenericPermissionBo)getDataObject();
boolean permissionExists = false;
if (genericPermissionBo.getId() != null) {
permissionExists = KimApiServiceLocator.getPermissionService().getPermission(genericPermissionBo.getId()) != null;
}
if (genericPermissionBo.getTemplateId() != null) {
genericPermissionBo.setTemplate(
PermissionTemplateBo.from(
KimApiServiceLocator.getPermissionService().getPermissionTemplate(genericPermissionBo.getTemplateId())));
}
PermissionBo perm = GenericPermissionBo.toPermissionBo(genericPermissionBo);
if (permissionExists) {
KimApiServiceLocator.getPermissionService().updatePermission(PermissionBo.to(perm));
} else {
KimApiServiceLocator.getPermissionService().createPermission(PermissionBo.to(perm));
}
} else {
throw new RuntimeException(
"Cannot save object of type: " + getDataObjectClass() + " with permission service");
}
}
示例5: processAfterNew
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
/**
* Pre-populates the ID field of the new PermissionBo to be created.
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
*/
@Override
public void processAfterNew(MaintenanceDocument document, Map<String, String[]> parameters) {
super.processAfterNew(document,parameters);
GenericPermissionBo permissionBo = (GenericPermissionBo) document.getNewMaintainableObject().getDataObject();
initializePermissionId(permissionBo);
}
示例6: processAfterCopy
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
/**
* Pre-populates the ID field of the new PermissionBo to be created.
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
*/
@Override
public void processAfterCopy(MaintenanceDocument document, Map<String, String[]> parameters) {
super.processAfterCopy(document,parameters);
GenericPermissionBo permissionBo = (GenericPermissionBo) document.getNewMaintainableObject().getDataObject();
initializePermissionId(permissionBo);
permissionBo.setVersionNumber(null);
}
示例7: initializePermissionId
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
private void initializePermissionId(Object dataObject) {
if (dataObject instanceof GenericPermissionBo) {
GenericPermissionBo permissionBo = (GenericPermissionBo) dataObject;
if (StringUtils.isBlank(permissionBo.getId())) {
DataFieldMaxValueIncrementer incrementer = MaxValueIncrementerFactory.getIncrementer(
KimImplServiceLocator.getDataSource(), KimConstants.SequenceNames.KRIM_PERM_ID_S);
permissionBo.setId(incrementer.nextStringValue());
}
}
}
示例8: setupNewFromExisting
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
@Override
public void setupNewFromExisting(MaintenanceDocument document, Map<String, String[]> parameters) {
String attrName = "";
String attrValue = "";
GenericPermissionBo permissionBo = (GenericPermissionBo) document.getNewMaintainableObject().getDataObject();
initializePermissionId(permissionBo);
permissionBo.setActive(true);
for (String paramName : parameters.keySet()) {
String[] parameterValues = parameters.get(paramName);
if (paramName.equals(DETAIL_OBJECTS_ATTRIBUTE_NAME)) {
if (parameterValues.length > 0) {
attrName = parameterValues[0];
}
}
if (paramName.equals(DETAIL_OBJECTS_ATTRIBUTE_VALUE)) {
if (parameterValues.length > 0) {
attrValue = parameterValues[0];
}
}
}
if (StringUtils.isNotEmpty(attrName) && StringUtils.isNotEmpty(attrValue)) {
Map<String, String> details = new HashMap<String, String>();
details.put(attrName, attrValue);
permissionBo.setDetails(details);
}
document.getNewMaintainableObject().setDataObject(permissionBo);
}
示例9: processAfterCopy
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
/**
* Pre-populates the ID field of the new PermissionBo to be created.
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
*/
@Override
public void processAfterCopy(MaintenanceDocument document, Map<String, String[]> parameters) {
super.processAfterCopy(document,parameters);
// get id for new permission
String newId = getSequenceAccessorService().getNextAvailableSequenceNumber(KimConstants.SequenceNames.KRIM_PERM_ID_S).toString();
((GenericPermissionBo)document.getNewMaintainableObject().getDataObject()).setId(newId);
}
示例10: getBoClass
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Class getBoClass() {
return GenericPermissionBo.class;
}
示例11: processCustomRouteDocumentBusinessRules
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
@Override
protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) {
boolean rulesPassed = super.processCustomRouteDocumentBusinessRules( document );
try {
GenericPermissionBo newPerm = (GenericPermissionBo)getNewBo();
GenericPermissionBo oldPerm = (GenericPermissionBo)getOldBo();
rulesPassed &= validateDetailValuesFormat(newPerm.getDetailValues());
if(StringUtils.isNotBlank(newPerm.getNamespaceCode()) && StringUtils.isNotBlank(newPerm.getName()) && StringUtils.isBlank(newPerm.getId())){
rulesPassed &= validateNamespaceCodeAndName(newPerm.getNamespaceCode(), newPerm.getName());
}
// rule case for copy
if(StringUtils.isNotBlank(newPerm.getNamespaceCode()) &&
StringUtils.isNotBlank(newPerm.getName()) &&
StringUtils.isNotBlank(oldPerm.getId()) &&
StringUtils.isNotBlank(newPerm.getId()) &&
!StringUtils.equals(oldPerm.getId(), newPerm.getId())){
rulesPassed &= validateNamespaceCodeAndName(newPerm.getNamespaceCode(), newPerm.getName());
}
// rule case for edit
if(StringUtils.isNotBlank(newPerm.getNamespaceCode()) &&
StringUtils.isNotBlank(newPerm.getName()) &&
StringUtils.isNotBlank(oldPerm.getId()) &&
StringUtils.isNotBlank(newPerm.getId()) &&
StringUtils.equals(oldPerm.getId(), newPerm.getId()) &&
( !StringUtils.equals(oldPerm.getNamespaceCode(), newPerm.getNamespaceCode()) ||
!StringUtils.equals(oldPerm.getName(), newPerm.getName())
)
) {
rulesPassed &= validateNamespaceCodeAndName(newPerm.getNamespaceCode(), newPerm.getName());
}
// detailValues
// get the type from the template for validation
if(StringUtils.isNotBlank(newPerm.getTemplateId())){
Template template = KimApiServiceLocator.getPermissionService().getPermissionTemplate(newPerm.getTemplateId());
if ( template == null ) {
GlobalVariables.getMessageMap().addToErrorPath( MAINTAINABLE_ERROR_PATH );
GlobalVariables.getMessageMap().putError( DETAIL_VALUES_PROPERTY, ERROR_MISSING_TEMPLATE, newPerm.getTemplateId() );
GlobalVariables.getMessageMap().removeFromErrorPath( MAINTAINABLE_ERROR_PATH );
rulesPassed &= false;
} else {
KimType kimType = KimApiServiceLocator.getKimTypeInfoService().getKimType(template.getKimTypeId());
Map<String, String> details = newPerm.getDetails();
// check that add passed attributes are defined
for ( String attributeName : details.keySet() ) {
if ( kimType.getAttributeDefinitionByName(attributeName) == null ) {
GlobalVariables.getMessageMap().addToErrorPath( MAINTAINABLE_ERROR_PATH );
GlobalVariables.getMessageMap().putError( DETAIL_VALUES_PROPERTY, ERROR_UNKNOWN_ATTRIBUTE, attributeName, template.getNamespaceCode(), template.getName() );
GlobalVariables.getMessageMap().removeFromErrorPath( MAINTAINABLE_ERROR_PATH );
rulesPassed &= false;
}
}
// if all attributes are known, pass to the service for validation
if ( !GlobalVariables.getMessageMap().hasErrors() ) {
PermissionTypeService service = getPermissionTypeService( kimType.getServiceName() );
if ( service != null ) {
List<RemotableAttributeError> validationErrors = service.validateAttributes( kimType.getId(), details);
if ( validationErrors != null && !validationErrors.isEmpty() ) {
for ( RemotableAttributeError error : validationErrors ) {
GlobalVariables.getMessageMap().addToErrorPath( MAINTAINABLE_ERROR_PATH );
for (String errMsg : error.getErrors()) {
GlobalVariables.getMessageMap().putError( DETAIL_VALUES_PROPERTY, ERROR_ATTRIBUTE_VALIDATION, error.getAttributeName(), errMsg );
}
GlobalVariables.getMessageMap().removeFromErrorPath( MAINTAINABLE_ERROR_PATH );
}
rulesPassed &= false;
}
}
}
}
}
// check each permission name against the type
} catch ( RuntimeException ex ) {
LOG.error( "Error in processCustomRouteDocumentBusinessRules()", ex );
throw ex;
}
return rulesPassed;
}
示例12: processCustomRouteDocumentBusinessRules
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
@Override
protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) {
boolean rulesPassed = super.processCustomRouteDocumentBusinessRules( document );
try {
GenericPermissionBo perm = (GenericPermissionBo)getNewBo();
GenericPermissionBo orgBo = (GenericPermissionBo)getOldBo();
rulesPassed &= validateDetailValuesFormat(perm.getDetailValues());
if(StringUtils.isNotBlank(perm.getNamespaceCode()) && StringUtils.isNotBlank(perm.getName()) && StringUtils.isBlank(perm.getId())){
rulesPassed &= validateNamespaceCodeAndName(perm.getNamespaceCode(), perm.getName());
}
// rule case for copy
if(StringUtils.isNotBlank(perm.getNamespaceCode()) &&
StringUtils.isNotBlank(perm.getName()) &&
StringUtils.isNotBlank(orgBo.getId()) &&
StringUtils.isNotBlank(perm.getId()) &&
!StringUtils.equals(orgBo.getId(), perm.getId())){
rulesPassed &= validateNamespaceCodeAndName(perm.getNamespaceCode(), perm.getName());
}
// rule case for edit
if(StringUtils.isNotBlank(perm.getNamespaceCode()) &&
StringUtils.isNotBlank(perm.getName()) &&
StringUtils.isNotBlank(orgBo.getId()) &&
StringUtils.isNotBlank(perm.getId()) &&
StringUtils.equals(orgBo.getId(), perm.getId()) &&
( !StringUtils.equals(orgBo.getNamespaceCode(), perm.getNamespaceCode()) ||
!StringUtils.equals(orgBo.getName(), perm.getName())
)
) {
rulesPassed &= validateNamespaceCodeAndName(perm.getNamespaceCode(), perm.getName());
}
// detailValues
// get the type from the template for validation
Template template = null;
if(StringUtils.isNotBlank(perm.getTemplateId())){
template = KimApiServiceLocator.getPermissionService().getPermissionTemplate(perm.getTemplateId());
if ( template == null ) {
GlobalVariables.getMessageMap().addToErrorPath( MAINTAINABLE_ERROR_PATH );
GlobalVariables.getMessageMap().putError( DETAIL_VALUES_PROPERTY, ERROR_MISSING_TEMPLATE, perm.getTemplateId() );
GlobalVariables.getMessageMap().removeFromErrorPath( MAINTAINABLE_ERROR_PATH );
rulesPassed &= false;
} else {
KimType kimType = KimApiServiceLocator.getKimTypeInfoService().getKimType(template.getKimTypeId());
Map<String, String> details = perm.getDetails();
// check that add passed attributes are defined
for ( String attributeName : details.keySet() ) {
if ( kimType.getAttributeDefinitionByName(attributeName) == null ) {
GlobalVariables.getMessageMap().addToErrorPath( MAINTAINABLE_ERROR_PATH );
GlobalVariables.getMessageMap().putError( DETAIL_VALUES_PROPERTY, ERROR_UNKNOWN_ATTRIBUTE, attributeName, template.getNamespaceCode(), template.getName() );
GlobalVariables.getMessageMap().removeFromErrorPath( MAINTAINABLE_ERROR_PATH );
rulesPassed &= false;
}
}
// if all attributes are known, pass to the service for validation
if ( !GlobalVariables.getMessageMap().hasErrors() ) {
PermissionTypeService service = getPermissionTypeService( kimType.getServiceName() );
if ( service != null ) {
List<RemotableAttributeError> validationErrors = service.validateAttributes( kimType.getId(), details);
if ( validationErrors != null && !validationErrors.isEmpty() ) {
for ( RemotableAttributeError error : validationErrors ) {
GlobalVariables.getMessageMap().addToErrorPath( MAINTAINABLE_ERROR_PATH );
for (String errMsg : error.getErrors()) {
GlobalVariables.getMessageMap().putError( DETAIL_VALUES_PROPERTY, ERROR_ATTRIBUTE_VALIDATION, error.getAttributeName(), errMsg );
}
GlobalVariables.getMessageMap().removeFromErrorPath( MAINTAINABLE_ERROR_PATH );
}
rulesPassed &= false;
}
}
}
}
}
// check each permission name against the type
} catch ( RuntimeException ex ) {
LOG.error( "Error in processCustomRouteDocumentBusinessRules()", ex );
throw ex;
}
return rulesPassed;
}
示例13: canCreate
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
/**
* This overridden method ...
*
* @see org.kuali.rice.kns.document.authorization.MaintenanceDocumentPresentationControllerBase#canCreate(java.lang.Class)
*/
@Override
public boolean canCreate(Class boClass) {
return super.canCreate( GenericPermissionBo.class );
}
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:GenericPermissionMaintenanceDocumentPresentationController.java
示例14: getBoClass
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //导入依赖的package包/类
/**
* This overridden method ...
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#getBoClass()
*/
@Override
public Class<? extends PersistableBusinessObject> getBoClass() {
return GenericPermissionBo.class;
}