Skip to main content
Published: September 28 2005, 5:52:00 PMUpdated: November 28 2020, 1:26:22 PM

How do I use the SetPictureManagerDetails, GetPictureManagerDetails, and GetPictureManagerOptions calls in the Java SDK?

Using PictureManager functionality through the Java SDK is very easy.
The following methods show how to make these calls to do various functions.
These functions can be used once a valid apiContext object is created.
Note that there are System.out statements which are for demonstration purposes.

/* Using the GetPictureManagerDetails call */
public void MyGetPictureManagerDetails() throws Exception
{
/* create the call object, passing the apiContext to it */
GetPictureManagerDetailsCall oGetPictureManagerDetails = new GetPictureManagerDetailsCall(apiContext);
/* make the call */
oGetPictureManagerDetails.getPictureManagerDetails();
/* extract the SOAP object */
PictureManagerDetailsType oPictureManagerDetails = oGetPictureManagerDetails.getReturnedPictureManagerDetails();
/* extract the storage used */
Integer iStorageUsed = oPictureManagerDetails.getStorageUsed();
System.out.println("Storage Used: "+ iStorageUsed);
/* extract the storage available */
Integer iStorageAvailable = oPictureManagerDetails.getTotalStorageAvailable();
System.out.println("Storage Available: "+ iStorageAvailable);
/* extract the SOAP array object of Picture Manager Folders */
PictureManagerFolderType[] oPictureManagerFolderTypes = oPictureManagerDetails.getFolder();
System.out.println("Folders in the PictureManger are:");
/* loop through the array and extract the name of each folder */
for (int i=0; i<oPictureManagerFolderTypes.length; i++)
{
System.out.println(oPictureManagerFolderTypes[i].getName());
}
/* extract the subscription level */
PictureManagerSubscriptionLevelCodeType oPictureManagerSubscriptionLevel = oPictureManagerDetails.getSubscriptionLevel();
System.out.println("The current Subscription Level: " + oPictureManagerSubscriptionLevel.getValue());
}


/* Using the GetPictureManagerOptions call */
public void MyGetPictureManagerOptions() throws Exception
{
/* create the call object, passing the apiContext to it */
GetPictureManagerOptionsCall oGetPictureManagerOptions = new GetPictureManagerOptionsCall(apiContext);
/* make the call */
oGetPictureManagerOptions.getPictureManagerOptions();;
/* extract the SOAP array object of Picture Display Types
PictureManagerPictureDisplayType[] oPictureManagerPictureDisplayTypes = oGetPictureManagerOptions.getReturnedPictureType();
System.out.println("Picture Manager Picture Display Types: ");
/* loop throug the array and extract each display type */
for (int i=0; i<oPictureManagerPictureDisplayTypes.length; i++)
{
System.out.println(oPictureManagerPictureDisplayTypes[i].getDisplayType());
}
/* extract the subscription types available */
PictureManagerSubscriptionType[] oPictureManagerSubscriptionTypes = oGetPictureManagerOptions.getReturnedSubscription();
System.out.println("Picture Manager SubscriptionTypes: ");
/* loop through the array and extract each subscription type */
for (int i=0; i<oPictureManagerSubscriptionTypes.length; i++)
{
System.out.println(oPictureManagerSubscriptionTypes[i].getSubscriptionLevel());
}
}


/* Using the SetPictureManagerDetails call to add a folder */
public void AddFolder() throws Exception
{
/* create the call object, passing the apiContext to it */
SetPictureManagerDetailsCall oSetPictureManagerDetails = new SetPictureManagerDetailsCall(apiContext);
/* set the action to add a folder */
oSetPictureManagerDetails.setAction(PictureManagerActionCodeType.Add);
/* create a folder, giving it a name */
PictureManagerFolderType oPictureManagerFolderType = new PictureManagerFolderType();
oPictureManagerFolderType.setName("My New Folder");
/* create the folder array, and add the folder we created to it */
PictureManagerFolderType[] oPictureManagerFolderTypeArray = {oPictureManagerFolderType};
/* create the Picture Manager Details Type object */
PictureManagerDetailsType oPictureManagerDetailsType= new PictureManagerDetailsType();
/* set the folder array we created */
oPictureManagerDetailsType.setFolder(oPictureManagerFolderTypeArray);
/* set the call object's details */
oSetPictureManagerDetails.setPictureManagerDetails(oPictureManagerDetailsType);
/* make the call */
oSetPictureManagerDetails.setPictureManagerDetails();
}

How well did this answer your question?
Answers others found helpful