/** * Overriding the parent class's method to validate the enumerated attribute values * * @param obj : obj * @param dao : dao * @param operation : operation * @throws BizLogicException : BizLogicException * @return boolean */ @Override protected boolean validate(Object obj, DAO dao, String operation) throws BizLogicException { try { final StorageContainer container = (StorageContainer) obj; final Map similarContainerMap = container.getSimilarContainerMap(); final String containerPrefixKey = "simCont:"; final String parentContainerId = "_parentContainerId"; final List positionsToBeAllocatedList = new ArrayList(); final List usedPositionsList = new ArrayList(); for (int i = 1; i <= container.getNoOfContainers().intValue(); i++) { StorageContainerUtil.prepareContainerMap( dao, similarContainerMap, containerPrefixKey, positionsToBeAllocatedList, usedPositionsList, i, parentContainerId); } /*for (int i = 0; i < positionsToBeAllocatedList.size(); i++) { StorageContainerUtil.allocatePositionToSingleContainerOrSpecimen( positionsToBeAllocatedList.get(i), similarContainerMap, usedPositionsList, containerPrefixKey, parentContainerId); }*/ if (container.getNoOfContainers().intValue() > 1 && similarContainerMap.size() > 0) { for (int i = 1; i <= container.getNoOfContainers().intValue(); i++) { final int checkedButtonStatus = Integer.parseInt((String) similarContainerMap.get("checkedButton")); final String siteId = (String) similarContainerMap.get("simCont:" + i + "_siteId"); if (checkedButtonStatus == 2 || siteId == null) { final String parentContId = (String) similarContainerMap.get("simCont:" + i + "_parentContainerId"); final String positionDimensionOne = (String) similarContainerMap.get("simCont:" + i + "_positionDimensionOne"); final String positionDimensionTwo = (String) similarContainerMap.get("simCont:" + i + "_positionDimensionTwo"); if (parentContId.equals("-1") || positionDimensionOne.equals("-1") || positionDimensionTwo.equals("-1")) { throw this.getBizLogicException( null, "errors.item.required", ApplicationProperties.getValue("similarcontainers.location")); } } else { if (siteId.equals("-1")) { throw this.getBizLogicException( null, "errors.item.required", ApplicationProperties.getValue("storageContainer.site")); } } } } } catch (final ApplicationException exp) { this.logger.error(exp.getMessage(), exp); exp.printStackTrace(); throw this.getBizLogicException(exp, exp.getErrorKeyName(), exp.getMsgValues()); } return true; }