* See W-837427 As should be obvious, this method is a quick fix that should be refactored.
*
* @return the package manifest to be deployed
*/
public Package createSpecialDefaultPackageManifest() {
Package packageManifest = new Package();
// Only "wildcard-supported" component types appear in the deployment
// manifest, according to the code.
//
// However, custom object components have subcomponents which can be
// deployed without
// their parent custom objects. These subcomponents are found in .object
// files.
// The deployment code can only write a .object file to the deployment
// package; it can't
// write only the subcomponent. To prevent the whole custom object from
// being deployed
// we must remove the "*" from the deployment manifest. If the object
// really is being
// deployed, its name will appear in the manifest. See changelist
// 1452239.
//
List<String> componentTypes = getComponentFactory().getWildcardSupportedComponentTypes();
for (String componentType : componentTypes) {
if (!isEnabledRetrieveComponentType(componentType)) {
if (logger.isDebugEnabled()) {
logger.debug("Skipping disabled object type '" + componentType + "' from deployment");
}
continue;
}
PackageTypeMembers packageTypeMember = null;
if (componentType.equals("CustomObject")) {
packageTypeMember = createPackageTypeMembers(componentType, new String[0]);
} else if (!componentType.equals("Settings")){
packageTypeMember = createPackageTypeMembers(componentType, new String[] { "*" });
}
//Don't add any of the sharing rules to the default manifest. We will add them from the project manifest.
if (packageTypeMember != null && !Constants.SHARING_RULE_TYPES.contains(componentType)) {
packageManifest.getTypes().add(packageTypeMember);
}
}
return packageManifest;
}