Presentation is loading. Please wait.

Presentation is loading. Please wait.

#SummitNow Alfresco for Salesforce 5 November 2013 / 13 November 2013 Will Abson Jared Ottley

Similar presentations


Presentation on theme: "#SummitNow Alfresco for Salesforce 5 November 2013 / 13 November 2013 Will Abson Jared Ottley"— Presentation transcript:

1 #SummitNow Alfresco for Salesforce 5 November 2013 / 13 November 2013 Will Abson (wabson@alfresco.com)wabson@alfresco.com Jared Ottley (jottley@alfresco.com)jottley@alfresco.com Gregory Melahn (greg.melahn@alfresco.com)greg.melahn@alfresco.com

2 #SummitNow Part One (Business)  Overview and Demonstration Part Two (Technical)  How it Works  Building on Salesforce  Building on Alfresco Agenda

3 #SummitNow Part One

4 #SummitNow What does the App do? Allows Salesforce Users to attach Documents to Salesforce Objects and have them stored in Alfresco  Four Specific Salesforce Object Types supported ▪ Accounts ▪ Cases ▪ Contracts ▪ Opportunities Allows Salesforce Users to Edit, View and Delete the attached Alfresco Documents Creates Chatter about the Alfresco Documents

5 #SummitNow Finding the App Go to the Salesforce App Exchange  https://appexchange.salesforce.com/ https://appexchange.salesforce.com/ Enter some search criteria (e.g. ‘Alfresco’)

6 #SummitNow The App Exchange Listing

7 #SummitNow Installing the App

8 #SummitNow Demo

9 #SummitNow Demo

10 #SummitNow Part Two

11 #SummitNow Alfresco and SF Components Alfresco Repository Salesforce Salesforce Model Sample Layouts Alfresco Share Adv. Search Form Properties Config Security Profiles VisualForce Pages Apex Classes

12 #SummitNow Salesforce Model Salesforce Record Salesforce Attachment CRM Account CRM Case CRM Contract CRM Opportunity Document Type 10..N Stored in /Salesforce RecordsStored in /documentLibrary/Salesforce Attachments Assoc Additional Aspects

13 #SummitNow Application Packaging On the Salesforce side  (??)  Deployed on the AppExchange On the Alfresco side (MyAlfresco only)  Repo AMP ▪salesforce-repo-1.0.0.amp  Share AMP ▪salesforce-share-1.0.0.amp

14 #SummitNow How it Works API: OAuth + CMIS Salesforce Users Web browser

15 #SummitNow How it Works API: OAuth + CMIS Salesforce Users Web browser Upload: OAuth + CORS + CMIS

16 #SummitNow How it Works - Downloading a File OAuth + CMIS Salesforce Users Web browser 1.User clicks Download link for a file 2.Salesforce-side code checks the user’s access token is still valid  If not valid, the token is refreshed 3.Salesforce-side code checks the document is present in Alfresco, providing nodeRef  If not present, the user is forwarded to a ‘page not found’ page 4.Salesforce-side code access the content of the file from Alfresco Cloud via CMIS and streams it back to the user

17 #SummitNow How it Works - Uploading a File OAuth + CMIS Salesforce Users Web browser OAuth + CORS + CMIS 1.User clicks Attach File button in their browser, taken to New Document page 2.User selects file, enters Document Name and Document Type (drop-down) and hits Save 3.Page fires off POST request to trigger Apex remote action in Salesforce-side code, which creates empty content item in the Document Library 4.Browser does a CMIS PUT directly against Alfresco Cloud to upload the content itself  This works around Salesforce request body size restrictions  Access token from Salesforce is re-used

18 #SummitNow Cloud Sync Firewall Corporate UsersRemote Office Sync OAuth + CMIS Salesforce Users Web browser OAuth + CORS + CMIS

19 #SummitNow Building on Salesforce *Does not include SOAP and REST APIs Apex Visualforce

20 #SummitNow CMIS API Challenges

21 #SummitNow CMIS API Challenges - No CMIS Client Force.com has no concept of libraries Install packages from appexchange Limited to what to is exposed by developer Add classes from other projects Count against you code total No one has written a CMIS appexchange package No one has written CMIS classses that could be added Apex Web Callouts to CMIS endpoints Governance Limits Installer must approve connecting endpoints

22 #SummitNow CMIS API Challenges - Tenant Id Calls to Cloud CMIS API need tenant id CMIS provides no way to discover tenant id Two options: User provides Use REST API https://api.alfresco.com Apex JSON parser (requires new classes) JSON objects: Reserved words Limit to home network or ask user input

23 #SummitNow CMIS API Challenges - Verbosity CMIS is Verbose! Can reduce a little using filters Governance Limits Example: Alfresco.com Alfresco.com site list is 400+ (and growing) Document size is 2.5 MB Options: Paging CMIS Browser Bindings

24 #SummitNow CMIS API Challenges - Parsing XML Apex XML parser Gotcha: DateTime String dateString = property.getChildElement('value', CMIS_NS).getText(); dateString = dateString.replace('T', ' '); dateString= dateString.substring(0, dateString.length() - 6); relatedDoc.creationDate = DateTime.valueOf(dateString);

25 #SummitNow CMIS API Challenges - Child Objects Lacks support for including child objects If it did…. Governance Limit Heap Size Since it doesn’t… Governance Limit Callout Requests

26 #SummitNow CMIS API Challenge - Delete CMIS API allows delete of relationship using objectId using: https://api.alfresco.com/alfresco.com/public/cmis/versions/1.0/atom/entry?id=assoc:4240216&allVersions=true https://api.alfresco.com/alfresco.com/public/cmis/versions/1.0/atom/entry?id=assoc:4240216&allVersions=true Relationship MAY be deleted when the target is removed in a peer relationship (according to the spec). Any code should allow for a 404. Previously the relationship remained and target pointed to the archiveStore.

27 #SummitNow CMIS API Challenges – Secondary Types Lack of support of secondary types makes the the integration dependent on Alfresco extensions. Secondary type support would allow client to fallback to base type.

28 #SummitNow CMIS API Challenges - Sites folder Listing documents is achieved using a CMIS getObjectByPath call We know the path of the Salesforce Record item - /Sites/ /Salesforce Records/ But, the Sites folder may not always be named 'Sites', e.g. 'Sitios'! CMIS does not provide a way to specify a QName path, rather than a name path. So, we must find out what the sites folder is called, and store this This is done when the user selects the site to be used for document storage.

29 #SummitNow CMIS Workbench as Node Browser org.apache.chemistry.opencmis.binding.spi.type=atompub org.apache.chemistry.opencmis.binding.atompub.url=https:/ /api.alfresco.com/cmis/versions/1.0/atom org.apache.chemistry.opencmis.binding.auth.http.basic=fals e org.apache.chemistry.opencmis.binding.header.0=Authorizat ion:Bearer org.apache.chemistry.opencmis.binding.compression=true cmis.workbench.folder.includeAcls=false cmis.workbench.object.includeAcls=false cmis.workbench.version.includeAcls=false

30 #SummitNow Salesforce Governance http://www.salesforce.com/us/developer/docs/apexcode/Co ntent/apex_gov_limits.htm 10Total number of callouts (HTTP requests or Web services calls) in a transaction 6 MBTotal heap size 10,000 milliseconds Maximum CPU time on the Salesforce servers 5 MBFile size limit

31 #SummitNow Security Considerations Salesforce apply strict criteria to apps before they can be publicly listed on the AppExchange Partnership with Checkmarx to allow developers to check for common vulnerabilities in their Apex / Visualforce apps The AppExchange team are responsible for performing a final check across your app and any supporting services For Alfresco this covered the MyAlfresco service Developers do not have access to the tools used This feedback process takes (up to) 8 weeks

32 #SummitNow Future Ideas Access Salesforce Content from Alfresco Salesforce Chatter API (plug) Avoiding Salesforce Governance limits Salesforce Canvas Framework Alfresco Embed

33 #SummitNow Add permission set to multiple users Every user must have the ‘Alfresco Cloud Document Management User’ permission set applied to their account. This can be scripted through the Salesforce Developer Console.

34 #SummitNow Example User u = [select id from User where ]; PermissionSet ps = [Select p.Id From PermissionSet p where p.label = 'Alfresco Cloud Document Management User']; PermissionSetAssignment psa = new PermissionSetAssignment(AssigneeId = u.id, PermissionSetId = ps.id); insert psa;

35 #SummitNow More information Documentation https://appexchange.salesforce.com/servlet/servlet.FileDownload?file= 00P3000000Hd94DEAR Salesforce App Exchange Listing https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000 B34XIEAZ

36 #SummitNow

37 Known Issues and Limits We don’t support IE versions prior to IE 10 Maximum of number of documents that can be attached to a single Salesforce item is 100 Documents start out as V1.1, not 1.0 If you attach a document with the same name as an existing attachment to the same Salesforce Object, we name the attachment with a ‘- ’ suffix (up to three such attachments) Uploading a document that exceeds the Alfresco quota will fail, but a Salesforce Chatter entry will still be created (transactional integrity) The app uses the name of the Salesforce object to create the name of the folder in Alfresco where the files are uploaded. If you create two Salesforce objects with the same name, files attached to either object will be stored in the same folder Moderated sites that the Salesforce Admin is not yet a member of will still appear in the Sites dropdown

38 #SummitNow Force.com Limitations No local deployment process, deploy process is via an external API with only an Ant task to integrate this into your workflow Namespacing Formats not well documented The process of certifying an app is opaque and non-trivial


Download ppt "#SummitNow Alfresco for Salesforce 5 November 2013 / 13 November 2013 Will Abson Jared Ottley"

Similar presentations


Ads by Google