PackageTypeBehavior behavior = ContentManagerHelper.getPackageTypeBehavior(packageTypeId);
if (behavior != null) {
String packageTypeName = packageType.getName();
String archName = architecture.getName();
ValidatablePackageDetailsKey key = new ValidatablePackageDetailsKey(packageName, version,
packageTypeName, archName);
behavior.validateDetails(key, subject);
//update the details from the validation results
packageName = key.getName();
version = key.getVersion();
if (!architecture.getName().equals(key.getArchitectureName())) {
Query q = entityManager.createNamedQuery(Architecture.QUERY_FIND_BY_NAME);
q.setParameter("name", key.getArchitectureName());
architecture = (Architecture) q.getSingleResult();
}
}
} catch (PackageDetailsValidationException e) {
throw e;