Java Code Examples for org.apache.commons.lang3.BooleanUtils#isNotTrue()
The following examples show how to use
org.apache.commons.lang3.BooleanUtils#isNotTrue() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ActionDeleteWithWorkPath0.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0) throws Exception { ActionResult<Wo> result = new ActionResult<>(); Work work = null; try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { Business business = new Business(emc); work = emc.find(id, Work.class); if (null == work) { throw new ExceptionEntityNotExist(id, Work.class); } WoControl control = business.getControl(effectivePerson, work, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowSave())) { throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId()); } } Wo wo = ThisApplication.context().applications() .deleteQuery(x_processplatform_service_processing.class, Applications.joinQueryUri("data", "work", work.getId(), path0), work.getJob()) .getData(Wo.class); result.setData(wo); return result; }
Example 2
Source File: ActionDeleteWithWorkPath1.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1) throws Exception { ActionResult<Wo> result = new ActionResult<>(); Work work = null; try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { Business business = new Business(emc); work = emc.find(id, Work.class); if (null == work) { throw new ExceptionEntityNotExist(id, Work.class); } WoControl control = business.getControl(effectivePerson, work, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowSave())) { throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId()); } } Wo wo = ThisApplication.context().applications() .deleteQuery(x_processplatform_service_processing.class, Applications.joinQueryUri("data", "work", work.getId(), path0, path1), work.getJob()) .getData(Wo.class); result.setData(wo); return result; }
Example 3
Source File: ActionGetWithWorkPath0.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<JsonElement> execute(EffectivePerson effectivePerson, String id, String path0) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<JsonElement> result = new ActionResult<>(); Business business = new Business(emc); Work work = emc.find(id, Work.class); if (null == work) { throw new ExceptionEntityNotExist(id, Work.class); } WoControl control = business.getControl(effectivePerson, work, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId()); } result.setData(this.getData(business, work.getJob(), path0)); return result; } }
Example 4
Source File: ActionComplexAppointFormMobile.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String formFlag) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo> result = new ActionResult<>(); Business business = new Business(emc); Work work = emc.find(id, Work.class); if (null == work) { throw new ExceptionWorkNotExist(id); } Wo wo = this.get(business, effectivePerson, work, Wo.class); WoControl control = wo.getControl(); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId()); } wo.setForm(this.referenceForm(business, work, formFlag)); result.setData(wo); return result; } }
Example 5
Source File: ActionGetWithWorkPath2.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<JsonElement> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<JsonElement> result = new ActionResult<>(); Business business = new Business(emc); Work work = emc.find(id, Work.class); if (null == work) { throw new ExceptionEntityNotExist(id, Work.class); } WoControl control = business.getControl(effectivePerson, work, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId()); } result.setData(this.getData(business, work.getJob(), path0, path1, path2)); return result; } }
Example 6
Source File: ActionComplexSnapFormMobile.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<Wo> execute(String id, EffectivePerson effectivePerson) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo> result = new ActionResult<>(); Business business = new Business(emc); WorkCompleted workCompleted = emc.find(id, WorkCompleted.class); if (null == workCompleted) { throw new ExceptionEntityNotExist(id, WorkCompleted.class); } Wo wo = this.get(business, effectivePerson, workCompleted, Wo.class); wo.setForm(this.getForm(business, workCompleted)); WorkCompletedControl control = wo.getControl(); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkCompletedAccessDenied(effectivePerson.getDistinguishedName(), id); } result.setData(wo); return result; } }
Example 7
Source File: ActionListWithWorkCompleted.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workCompletedId) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<List<Wo>> result = new ActionResult<>(); Business business = new Business(emc); WorkCompleted workCompleted = emc.find(workCompletedId, WorkCompleted.class); if (null == workCompleted) { throw new ExceptionEntityNotExist(workCompletedId, WorkCompleted.class); } WoControl control = business.getControl(effectivePerson, workCompleted, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkCompletedAccessDenied(effectivePerson.getDistinguishedName(), workCompleted.getTitle(), workCompleted.getId()); } List<String> ids = business.attachment().listWithJob(workCompleted.getJob()); List<Attachment> os = emc.list(Attachment.class, ids); List<Wo> wos = Wo.copier.copy(os); wos = wos.stream().sorted(Comparator.comparing(Wo::getCreateTime)).collect(Collectors.toList()); result.setData(wos); return result; } }
Example 8
Source File: ActionGetWithWorkPath5.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<JsonElement> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4, String path5) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<JsonElement> result = new ActionResult<>(); Business business = new Business(emc); Work work = emc.find(id, Work.class); if (null == work) { throw new ExceptionEntityNotExist(id, Work.class); } WoControl control = business.getControl(effectivePerson, work, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId()); } result.setData(this.getData(business, work.getJob(), path0, path1, path2, path3, path4, path5)); return result; } }
Example 9
Source File: ActionComplexAppointForm.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String formFlag) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo> result = new ActionResult<>(); Business business = new Business(emc); Work work = emc.find(id, Work.class); if (null == work) { throw new ExceptionWorkNotExist(id); } Wo wo = this.get(business, effectivePerson, work, Wo.class); WoControl control = wo.getControl(); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId()); } wo.setForm(this.referenceForm(business, work, formFlag)); result.setData(wo); return result; } }
Example 10
Source File: ActionGetWithWorkCompletedPath4.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<JsonElement> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<JsonElement> result = new ActionResult<>(); Business business = new Business(emc); WorkCompleted workCompleted = emc.find(id, WorkCompleted.class); if (null == workCompleted) { throw new ExceptionEntityNotExist(id, WorkCompleted.class); } WoControl control = business.getControl(effectivePerson, workCompleted, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkCompletedAccessDenied(effectivePerson.getDistinguishedName(), workCompleted.getTitle(), workCompleted.getId()); } if (BooleanUtils.isTrue(workCompleted.getMerged())) { Data data = workCompleted.getProperties().getData(); Object o = data.find(new String[] { path0, path1, path2, path3, path4 }); result.setData(gson.toJsonTree(o)); } else { result.setData(this.getData(business, workCompleted.getJob(), path0, path1, path2, path3, path4)); } return result; } }
Example 11
Source File: ActionCreateWithApplicationProcessForce.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
private List<Wo> refercenceWorkLog(Business business, List<WorkLog> list) throws Exception { List<Wo> os = new ArrayList<>(); for (WorkLog o : list) { Wo wo = Wo.copier.copy(o); if (BooleanUtils.isNotTrue(o.getConnected())) { this.referenceTask(business, wo); } else { /** 已经完成的不会有待办,返回一个空数组 */ wo.setTaskList(new ArrayList<WoTask>()); } this.referenceTaskCompleted(business, wo); os.add(wo); } SortTools.asc(os, false, "arrivedTime"); return os; }
Example 12
Source File: ActionComplexAppointFormMobile.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String formFlag) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo> result = new ActionResult<>(); Business business = new Business(emc); WorkCompleted workCompleted = emc.find(id, WorkCompleted.class); if (null == workCompleted) { throw new ExceptionEntityNotExist(id, WorkCompleted.class); } Wo wo = this.get(business, effectivePerson, workCompleted, Wo.class); wo.setForm(this.getForm(business, formFlag)); WorkCompletedControl control = wo.getControl(); if (BooleanUtils.isNotTrue(control.getAllowVisit())) { throw new ExceptionWorkCompletedAccessDenied(effectivePerson.getDistinguishedName(), id); } result.setData(wo); return result; } }
Example 13
Source File: ActionCheckMobile.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
ActionResult<Wo> execute(EffectivePerson effectivePerson,String mobile) throws Exception { ActionResult<Wo> result = new ActionResult<>(); try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { if (!Config.person().isMobile(mobile)) { throw new ExceptionInvalidMobile(mobile); } if (this.mobileExisted(emc, mobile)) { throw new ExceptionMobileExist(mobile); } if (BooleanUtils.isNotTrue(Config.collect().getEnable())) { throw new ExceptionDisableCollect(); } Wo wo = new Wo(); wo.setValue(true); result.setData(wo); return result; } }
Example 14
Source File: ConfigFactory.java From o2oa with GNU Affero General Public License v3.0 | 5 votes |
public static void sync() throws Exception { Node node = Config.currentNode(); if (BooleanUtils.isNotTrue(node.getIsPrimaryCenter())) { logger.info("{} is not primary center. sync config from primary center {}.", Config.node(), Config.nodes().primaryCenterNode()); syncFromPrimaryCenter(); Config.flush(); } }
Example 15
Source File: ActionExecute.java From o2oa with GNU Affero General Public License v3.0 | 5 votes |
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo> result = new ActionResult<>(); Business business = new Business(emc); Mapping mapping = emc.flag(flag, Mapping.class); if (null == mapping) { throw new ExceptionEntityNotExist(flag, Mapping.class); } if (BooleanUtils.isNotTrue(mapping.getEnable())) { throw new ExceptionDisable(mapping.getName()); } Application application = emc.flag(mapping.getApplication(), Application.class); if (null == application) { throw new ExceptionEntityNotExist(mapping.getApplication(), Application.class); } if (!business.editable(effectivePerson, application)) { throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName()); } if (!ThisApplication.mappingExecuteQueue.contains(mapping.getId())) { ThisApplication.mappingExecuteQueue.send(mapping.getId()); } else { throw new ExceptionAlreadyAddQueue(); } Wo wo = new Wo(); wo.setValue(true); result.setData(wo); return result; } }
Example 16
Source File: RelationalTableRegistrationHelperServiceImpl.java From herd with Apache License 2.0 | 4 votes |
/** * Prepares for relational table registration by validating database entities per specified relational table registration create request. This method * returns storage attributes required to perform relation table registration. * * @param relationalTableRegistrationCreateRequest the relational table registration create request * @param appendToExistingBusinessObjectDefinition boolean flag that determines if the format should be appended to an existing business object definition * * @return the relational storage attributes DTO */ RelationalStorageAttributesDto prepareForRelationalTableRegistrationImpl(RelationalTableRegistrationCreateRequest relationalTableRegistrationCreateRequest, Boolean appendToExistingBusinessObjectDefinition) { // Validate that specified namespace exists. namespaceDaoHelper.getNamespaceEntity(relationalTableRegistrationCreateRequest.getNamespace()); // Create a business object definition key. BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(relationalTableRegistrationCreateRequest.getNamespace(), relationalTableRegistrationCreateRequest.getBusinessObjectDefinitionName()); // Ensure that a business object definition with the specified key doesn't already exist. if (BooleanUtils.isNotTrue(appendToExistingBusinessObjectDefinition) && businessObjectDefinitionDao.getBusinessObjectDefinitionByKey(businessObjectDefinitionKey) != null) { throw new AlreadyExistsException(String.format("Business object definition with name \"%s\" already exists for namespace \"%s\".", businessObjectDefinitionKey.getBusinessObjectDefinitionName(), businessObjectDefinitionKey.getNamespace())); } // Get the latest format version for this business format, if it exists. BusinessObjectFormatEntity latestVersionBusinessObjectFormatEntity = businessObjectFormatDao.getBusinessObjectFormatByAltKey( new BusinessObjectFormatKey(relationalTableRegistrationCreateRequest.getNamespace(), relationalTableRegistrationCreateRequest.getBusinessObjectDefinitionName(), relationalTableRegistrationCreateRequest.getBusinessObjectFormatUsage(), FileTypeEntity.RELATIONAL_TABLE_FILE_TYPE, null)); // If the latest version exists, fail with an already exists exception. if (latestVersionBusinessObjectFormatEntity != null) { throw new AlreadyExistsException(String .format("Format with file type \"%s\" and usage \"%s\" already exists for business object definition \"%s\".", latestVersionBusinessObjectFormatEntity.getFileType().getCode(), latestVersionBusinessObjectFormatEntity.getUsage(), latestVersionBusinessObjectFormatEntity.getBusinessObjectDefinition().getName())); } // Validate that specified data provider exists. dataProviderDaoHelper.getDataProviderEntity(relationalTableRegistrationCreateRequest.getDataProviderName()); // Get the storage. StorageEntity storageEntity = storageDaoHelper.getStorageEntity(relationalTableRegistrationCreateRequest.getStorageName()); // Only RELATIONAL storage platform is supported for the relational table registration feature. Assert.isTrue(storageEntity.getStoragePlatform().getName().equals(StoragePlatformEntity.RELATIONAL), String.format( "Cannot register relational table in \"%s\" storage of %s storage platform type. Only %s storage platform type is supported by this feature.", storageEntity.getName(), storageEntity.getStoragePlatform().getName(), StoragePlatformEntity.RELATIONAL)); // Get and return the relational storage attributes required to access relation table schema. return getRelationalStorageAttributes(storageEntity); }
Example 17
Source File: ActionUploadCallback.java From o2oa with GNU Affero General Public License v3.0 | 4 votes |
ActionResult<Wo<WoObject>> execute(EffectivePerson effectivePerson, String workId, String callback, String site, String fileName, byte[] bytes, FormDataContentDisposition disposition) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo<WoObject>> result = new ActionResult<>(); Business business = new Business(emc); /* 后面要重新保存 */ Work work = emc.find(workId, Work.class); /** 判断work是否存在 */ if (null == work) { throw new ExceptionWorkNotExistCallback(callback, workId); } /** 统计待办数量判断用户是否可以上传附件 */ WoControl control = business.getControl(effectivePerson, work, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowProcessing())) { throw new ExceptionWorkAccessDeniedCallback(callback, effectivePerson.getDistinguishedName(), work.getTitle(), work.getId()); } if (StringUtils.isEmpty(fileName)) { fileName = this.fileName(disposition); } /* 调整可能的附件名称 */ fileName = this.adjustFileName(business, work.getJob(), fileName); /** 禁止不带扩展名的文件上传 */ // if (StringUtils.isEmpty(fileName)) { // throw new ExceptionEmptyExtension(fileName); // } StorageMapping mapping = ThisApplication.context().storageMappings().random(Attachment.class); Attachment attachment = this.concreteAttachment(work, effectivePerson, site); attachment.saveContent(mapping, bytes, fileName); attachment.setType((new Tika()).detect(bytes, fileName)); // emc.beginTransaction(Work.class); emc.beginTransaction(Attachment.class); emc.persist(attachment, CheckPersistType.all); // work.getAttachmentList().add(attachment.getId()); emc.commit(); WoObject woObject = new WoObject(); woObject.setId(attachment.getId()); Wo<WoObject> wo = new Wo<>(callback, woObject); result.setData(wo); return result; } }
Example 18
Source File: AbstractComponentGenerationStrategy.java From cuba with Apache License 2.0 | 4 votes |
@Nullable protected Component createDatatypeField(ComponentGenerationContext context, MetaPropertyPath mpp) { Range mppRange = mpp.getRange(); Element xmlDescriptor = context.getXmlDescriptor(); Class type = mppRange.asDatatype().getJavaClass(); MetaProperty metaProperty = mpp.getMetaProperty(); if (DynamicAttributesUtils.isDynamicAttribute(metaProperty)) { CategoryAttribute categoryAttribute = DynamicAttributesUtils.getCategoryAttribute(metaProperty); if (categoryAttribute != null) { CategoryAttributeConfiguration configuration = categoryAttribute.getConfiguration(); if (categoryAttribute.getDataType() == PropertyType.ENUMERATION && BooleanUtils.isNotTrue(categoryAttribute.getIsCollection())) { return createEnumField(context); } if (Boolean.TRUE.equals(categoryAttribute.getLookup()) && configuration.hasOptionsLoader()) { return createLookupField(context, categoryAttribute); } } } if (xmlDescriptor != null && "true".equalsIgnoreCase(xmlDescriptor.attributeValue("link"))) { return createDatatypeLinkField(context); } boolean hasMaskAttribute = xmlDescriptor != null && xmlDescriptor.attribute("mask") != null; if (type.equals(String.class)) { return hasMaskAttribute ? createMaskedField(context) : createStringField(context, mpp); } else if (type.equals(UUID.class)) { return createUuidField(context); } else if (type.equals(Boolean.class)) { return createBooleanField(context); } else if (type.equals(java.sql.Date.class) || type.equals(Date.class) || type.equals(LocalDate.class) || type.equals(LocalDateTime.class) || type.equals(OffsetDateTime.class)) { return createDateField(context); } else if (type.equals(Time.class) || type.equals(LocalTime.class) || type.equals(OffsetTime.class)) { return createTimeField(context); } else if (Number.class.isAssignableFrom(type)) { if (hasMaskAttribute) { return createMaskedField(context); } Field currencyField = createCurrencyField(context, mpp); if (currencyField != null) { return currencyField; } return createNumberField(context); } return null; }
Example 19
Source File: ActionUpdateCallback.java From o2oa with GNU Affero General Public License v3.0 | 4 votes |
ActionResult<Wo<WoObject>> execute(EffectivePerson effectivePerson, String id, String workId, String callback, String fileName, byte[] bytes, FormDataContentDisposition disposition) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo<WoObject>> result = new ActionResult<>(); Business business = new Business(emc); /* 后面要重新保存 */ Work work = emc.find(workId, Work.class); /** 判断work是否存在 */ if (null == work) { throw new ExceptionWorkNotExistCallback(callback, workId); } Attachment attachment = emc.find(id, Attachment.class); if (null == attachment) { throw new ExceptionAttachmentNotExistCallback(callback, id); } if (StringUtils.isEmpty(fileName)) { fileName = this.fileName(disposition); } if(!fileName.equalsIgnoreCase(attachment.getName())){ fileName = this.adjustFileName(business, work.getJob(), fileName); } /** 禁止不带扩展名的文件上传 */ // if (StringUtils.isEmpty(FilenameUtils.getExtension(fileName))) { // throw new ExceptionEmptyExtension(fileName); // } /** 禁止不同的扩展名上传 */ // if // (!Objects.equals(StringUtils.lowerCase(FilenameUtils.getExtension(fileName)), // attachment.getExtension())) { // throw new ExceptionExtensionNotMatch(fileName, attachment.getExtension()); // } /** 统计待办数量判断用户是否可以上传附件 */ WoControl control = business.getControl(effectivePerson, work, WoControl.class); if (BooleanUtils.isNotTrue(control.getAllowProcessing())) { throw new ExceptionAccessDenied(effectivePerson, work); } // if (business.attachment().multiReferenced(attachment)) { // throw new ExceptionMultiReferenced(attachment.getName(), // attachment.getId()); // } StorageMapping mapping = ThisApplication.context().storageMappings().get(Attachment.class, attachment.getStorage()); emc.beginTransaction(Attachment.class); attachment.updateContent(mapping, bytes, fileName); attachment.setType((new Tika()).detect(bytes, fileName)); emc.commit(); WoObject woObject = new WoObject(); woObject.setId(attachment.getId()); Wo<WoObject> wo = new Wo<>(callback, woObject); result.setData(wo); return result; } }
Example 20
Source File: BooleanWebStorageEntry.java From openemm with GNU Affero General Public License v3.0 | 4 votes |
public boolean isNotTrue() { return BooleanUtils.isNotTrue(getValue()); }