/** * Creates a value object representing the current settings for the landingpage. * * @param domObj The technical landingpage to be represented as value object. * @return A value object representation of the given landingpage. */ public static VOPublicLandingpage toVOLandingpage(PublicLandingpage domObj) { if (domObj == null) { return null; } VOPublicLandingpage voObj = new VOPublicLandingpage(); updateValueObject(voObj, domObj); voObj.setMarketplaceId(domObj.getMarketplace().getMarketplaceId()); voObj.setNumberServices(domObj.getNumberServices()); voObj.setFillinCriterion(domObj.getFillinCriterion()); // LandingpageProductAssembler is NOT called because of cyclic depency // between projects 'oscm-marketplaceservice-intsvc' and // 'oscm-serviceprovisioning-intsvc'. Please call the // LandingpageProductAssembler in LandingpageServiceBean! return voObj; }
/** * Copies all attributes in Landingpage object according to the values specified in the value * object. * * @param domObj The domain object from which the attributed of the value object should be copied * in. * @param voObj The value object containing the values to be copied. */ private static void copyAttributes(PublicLandingpage domObj, VOPublicLandingpage voObj) { domObj.setNumberServices(voObj.getNumberServices()); domObj.setFillinCriterion(voObj.getFillinCriterion()); }
/** * Validates the given Landingpage object that reflects the settings in the given value object. * * @param voObj The value object containing the values to be validated. * @throws ValidationException Thrown if the attributes at the value object do not meet all * constraints. */ public static void validate(VOPublicLandingpage voObj) throws ValidationException { BLValidator.isNotNull("marketplaceId", voObj.getMarketplaceId()); BLValidator.isNonNegativeNumber("numberServices", voObj.getNumberServices()); BLValidator.isNotNull("fillinCriterion", voObj.getFillinCriterion()); BLValidator.isNotNull("landingpageServices", voObj.getLandingpageServices()); }