SDK

Introduction

The SDK allows you to use CloudBuddy Personal UI components such as Bucket Explorer, Folder Explorer, SaveAs dialog in the way you use your windows File Open dialog from your .NET applications.

Also the CloudBuddy Personal SDK provides UI less access to the CloudBuddy Personal windows services such as upload and download.

You can learn more about this API's by looking at our example below.

Creating your own application with CloudBuddy Personal

A step-by-step walk through of integrating CloudBuddy Personal with your custom project is given below.

Software pre-requisites:
1. MS Visual Studio 2005
2. The CloudBuddy Personal application (can be downloaded from here)

1. Download the CloudBuddy Personal SDK from here

2. Create a new Windows Application project in Visual Studio 2005


File -> New -> Project -> Windows Application


Newprojectcreation

3. Unzip the CloudBuddy Personal SDK to local folder

4. Add reference to the below mentioned list of DLLs in your project by right clicking on the project name-> Add Reference


Addreference

  1. CloudBuddy Personal Component
  2. CloudBuddy Personal Config
  3. CloudBuddy Personal Factory
  4. CloudBuddy Personal Logger
  5. CloudBuddy Personal Service
  6. CloudBuddy Personal UIFactory
  7. CodePlex.Resourceful
  8. SQLiteWrapper
  9. Log4Net
  10. Affirma.ThreeSharp
  11. sqlite3.dll

Now you are set to use the CloudBuddy Personal API in your project. If you are not sure as how to use these API's, refer the sample SDK project section below.


Working with the CloudBuddy Personal SDK sample application


  1. Download the sample from here
  2. Unzip the sample to your local folder
  3. Click on the APISample.sln file inside the /example/APISample folder to open the project in Visual Studio IDE
  4. Build the project and run the project
  5. The example application contains two forms CBAPISamples.cs and Info.cs

1.CBAPISamples.cs

The code below shows you how to retrieve a CBFactory instance and the S3 accounts that are configured with CloudBuddy Personal:



//Initializing the Configuration File

CloudBuddy Personal.Initialize("cloudbuddy", AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
cbFactory = CBFactory.Instance; //Retrieving Instance of CBFactory

//Registering Client with the ClientID and setting the isAllResult
//isAllResult will enable you to receive notifications for all client's
//upload and download

cbFactory.RegisterClient(clientID, isAllResults);

//If CloudBuddy Personal is already installed, you can retrieve the accounts
//configured in CloudBuddy Personal. Otherwise you can build your accountlist
//and set it to this property.

cbFactory.ContextInfo.AccountInfoList = cbFactory.GetAccounts();
//set the current account accountList = cloudBuddyStore.ContextInfo.AccountInfoList ;
if (accountList != null && accountList.Count>0)

cloudBuddyStore.ContextInfo.CurrentAccount = accountList[0];



The following application level context variables is mandatory for CloudBuddy Personal Application.

//Retrieve the Config information and assign in the Application level Context Variables
//ClientID

cloudBuddyStore.ContextInfo.ClientID = CBAppConfig.Instance.ClientID;

//ISALLResults from Config file. isAllResult will enable you to receive notifications for all
//client's upload and download.

cloudBuddyStore.ContextInfo.ISALLResults = CBAppConfig.Instance.ISALLResults;

//Whether the pagination is needed or not
cloudBuddyStore.ContextInfo.ISPaginationNeeded = true;


//No.of Records to be displayed in ListView
cloudBuddyStore.ContextInfo.ListViewCount = CBAppConfig.Instance.ListViewCount;


//Whether the account details need to be displayed or not
cloudBuddyStore.ContextInfo.ISAccountDetailsVisibility = true;


// Checks whether the filter is applied or not.
cloudBuddyStore.ContextInfo.ISFilterApplied = false;


//What are the filters need to be applied. More than one filter should be separated
//by ?|?. File Extension only allowed in filters
//Single Filter eg. *.txt,*.doc
//Multiple Filter eg. *.txt|*.doc|*.ppt
//*.* is not allowed for filter condition

cloudBuddyStore.ContextInfo.Filter = null;


//Whether the metadata need to be retrieved during retrievel of files
cloudBuddyStore.ContextInfo.ISRetrieveMetaData = false;



The code below explains how to use a BucketExplorer



BucketExplorer bucketExplorer = null;

//To Show the FileView in Bucket Explorer
//Get an instance of Bucket Explorer with FileView

bucketExplorer = CBUIFactory.Instance.GetFileBucketExplorer();

//Allow Multiple Selection of Files

bucketExplorer.ListViewSelectionMode = FileViewPanel.ListViewSelection.Multiple;

//Hiding CloudBuddy Personal Toolbar

bucketExplorer.ISToolBarItemsVisible = false;

//Hiding Treeview Contextmenu

bucketExplorer.ISTreeviewContextMenuVisible = false;

//Hiding ListView Contextmenu

bucketExplorer.ISListViewContextMenuVisible = false;
bucketExplorer.Show();

//To Show MailView in Bucket Explorer
//Get an instance of Bucket Explorer with MailView

bucketExplorer = CBUIFactory.Instance.GetMailBucketExplorer();

//Allow Multiple Selection of Files

bucketExplorer.ListViewSelectionMode = FileViewPanel.ListViewSelection.Multiple;

//Hiding CloudBuddy Personal Toolbar

bucketExplorer.ISToolBarItemsVisible = false;

//Hiding Treeview Contextmenu

bucketExplorer.ISTreeviewContextMenuVisible = false;

//Hiding ListView Contextmenu
bucketExplorer.ISListViewContextMenuVisible = false;

//This Context variable ISRetrieveMetaData should be true.
//The MailView get builded based on the Metadata information.

cloudBuddyStore.ContextInfo.ISRetrieveMetaData = true;
bucketExplorer.Show();

The code below explains how to use a FolderExplorer



The code below explains how to use a CBSaveDialog



The code below explains how to use CloudBuddy PersonalLogger



2.Info.cs





The code below explains how to use ShareWizard



The following list gives you an overview of some properties of BucketExplorer, CBSaveDialog and ShareWizard.









Configuration for ShareWizard:

If you would like to share files using Template, then the following steps need to be done:(if CloudBuddy Personal is not installed on your machine)

  1. You need to create a folder called XML_LIST
  2. Inside that XML_LIST folder create a folder called temp and an XML file.
  3. The XML file should be in the following format:



The above sample XML file contains a Photo album template.


4. Then in your application give the template path in the App.Config as follows

under <appSettings> tag.


5. While using Template method in share option, CloudBuddy Personal service needs to run which is mandatory.


If CloudBuddy Personal is already installed, the above settings will be taken care of by the CloudBuddy Personal application itself.


ScreenShots:


Screen 1: CBAPISamples form contains options for viewing Bucket Explorer, Folder Explorer, SaveAsDialog, Upload File and Download File of CloudBuddy Personal.





Screen 2: Shows BucketExplorer




Screen 3: Displays the selected bucket name, folder name and the list of files selected in the corresponding folder of the current account.





Screen 4a and 4b: Displays the Folder Explorer and its corresponding information selected. The List of Files listbox displays Not Applicable because with FolderExplorer we can only browse through folders.





Screen 4a





Screen 4b



Screen 5a and 5b: Displays the SaveAsDialog of CloudBuddy Personal and the Destination path of the file name.





Screen 5a





Screen 5b



Screen 6a, 6b, 6c and 6d: Displays the ShareWizard of CloudBuddy Personal





Screen 6a





Screen 6b





Screen 6c





Screen 6d

Screen 7a, 7b: Displays the Upload File option of CloudBuddy Personal





Screen 7a





Screen 7b



Screen 8a, 8b: Displays the Download File option of CloudBuddy Personal





Screen 8a





Screen 8b