You are here

You are here

Finding a Folder using data from an external system

The SpringCM File It application is used for rapid integration into a third party system since the developer embedding it does not have to worry about writing a user interface, develop code to create/rename folders, or manage taxonomy changes.  This is all done simply through the query string parameters used to display the File It application in an iframe.

Given all this native functionality, it can still be useful to access the EOS folders that are created by the File It application programmatically.  A common use case is to create sub-folders in the EOS parent folder and then upload documents to them.  The primary call to work with an EOS folder via the API is the FindOrCreateEOSFolder method.  Note that parameters are identical to what is passed on the query string to invoke the File It application.

Inputs

  • token – Authentication token used in all SOAP calls
  • objectId – The object ID from the external system, the same one used when accessing this object via the File It application query string
  • objectType – The object type from the external system, the same one used when accessing this object via the File It application query string
  • folderName – The folder name in SpringCM, the same one used when accessing this object via the File It application query string
  • folderPath – The folder path in SpringCM, the same one used when accessing this object via the File It application query string
  • loadExtendedMetadata – Whether metadata on the folder is loaded, should generally return false as this will be the object id and type which the system already knows.

Output

  • This method returns an SCMFolder that can be used in subsequent API calls.

It should be noted that EOS folders could be used without the File It application.  When used via the API, they provide a convenient way to create folders and index them with external system data.  It also leaves open the possibility of leveraging the File It application at a later point.

A note to Salesforce developers

As stated at the start of this guide, using the SOAP API from Salesforce is deprecated and new development should be done using the REST API.  The following note is stated for legacy purposes.

When working with a Salesforce implementation that uses SpringCM’s managed package using this API method needs additional consideration.  The managed package provides the Salesforce administrator the ability to define templates for creating the folder name and folder path in SpringCM.  A developer who wants to programmatically access an EOS folder created by the SpringCM managed package will commonly know the Salesforce object id and type, but will not know how the Salesforce administrator has configured the folder name and path parameters.  To help with this situation, the managed packaged includes an Apex utilities class that can be called with a Salesforce object id and type and will return the folder name and path configured for that object.  See the Finding and Creating Folders Associated with Salesforce Objects article for more information.

Vertical Tabs

c#
string objectId = "005893245"; //Sample object id
string objectType = "MyERP.Invoice"; //Should be in the form Application.ObjectType
string folderName = "005893245"; //Can be a friendly name, does not need to be the object id
string folderPath = "/MyERP/Invoices"; //Path to the folder, the folderName from above will be appended
 
SCMFolder folder = springCMService.FindOrCreateEOSFolder(token,objectId,objectType,folderName,folderPath,true);
 
Console.WriteLine("Found or created folder with Id {0}",folder.Id);
java
String objectId = "005893245"; //Sample object id
String objectType = "MyERP.Invoice"; //Should be in the form Application.ObjectType
String folderName = "005893245"; //Can be a friendly name, does not need to be the object id
String folderPath = "/MyERP/Invoices"; //Path to the folder, the folderName from above will be appended
 
SCMFolder folder = springCMService.findOrCreateEOSFolder(token,objectId,objectType,folderName,folderPath,true);
 
System.out.println("Found or created folder with Id: "+folder.getId());