Sample ExportRequisiteList interface usage
Use the ExportRequisiteList interface to determine and retrieve all the dependent objects for objects in a export list container object and hold them in a requisite list container object.
See IBM® Javadoc Documentation to view all of the available information on the parameters, returns, exceptions, and syntax for the ExportRequisiteList class.
This sample code shows the getRequisiteTypes() method that is being used to retrieve the dependent object types for all the objects in the export list container object that correspond to the objects in the requisite list container object.
Context ctx = null;
EnvironmentExporter envExporter = null;
ExportList exportList = null;
try
{
ctx = PIMContextFactory.getContext("Admin","xxx","MyCompany");
envExporter = ctx.getEnvironmentExporter();
exportList=envExporter.createExportList();
try{
exportList.addAllObjects(ExportList.Type.CATALOG, ExportList.ActionMode.CREATE_OR_UPDATE);
ExportRequisiteList requisites = exportList.getRequisites();
for(ExportList.Type objectType : requisites.getRequisiteTypes())
{
if (ExportList.Type.SPEC.equals(objectType))
{
exportList.addAllObjects(ExportList.Type.SPEC, ExportList.ActionMode.CREATE_OR_UPDATE);
}
}
}
catch(PIMInternalException exc)
{
System.out.println("Action Mode not permitted: " + exc.getMessage());
}
}
catch (PIMAuthorizationException ae)
{
// Expected a failure
System.out.println("Authorization Failure");
return;
}
catch(PIMInternalException ie)
{
System.out.println("Internal Error");
return;
}
catch(Exception e)
{
System.out.println(e.getMessage());
}