Alfresco Business Reporting - Alfresco Summit 2013 - Tjarda Peelen
Developing for Glass & Alfresco
-
Upload
jared-ottley -
Category
Technology
-
view
94 -
download
1
description
Transcript of Developing for Glass & Alfresco
Google Glass
Developing for Glass & Alfresco
Jared OttleyEngineer@jottley
APIs
GDK – Glass Development Kit• Add-on to the Android SDK
GDK – Glass Development Kit
Real-time User Interaction Offline Functionality
Access To Hardware
Mirror
• RESTful API
POST /mirror/v1/timeline HTTP/1.1Host: www.googleapis.comAuthorization: Bearer {auth token}Content-Type: application/jsonContent-Length: 26
{ "text": "Hello world" }
Mirror
Platform Independence Common Infrastructure
Built-in Functionality
Must I use just one API
• Hybrid Approach
GDK and Mirror
What can I send to Glass
Card Attachments – Static
Text Image Video
Bundle
Live Card
Immersion
Who wants to see a demo
Use Case #1
• Publish Image to Glass• Document Library
Action• Repo Service• Google OAuth Client
White: Blank (no brand)
Sample Code – Insert To Timeline
//Get the Mirror APIMirror mirror = getMirrorApi(credential);
//Create a new TimelineItem ie CardTimelineItem item = new TimelineItem();
//Get the FileInfo for the NodeFileInfo fileInfo = fileFolderService.getFileInfo(nodeRef); //Set the file name as the title of the Carditem.setTitle(fileInfo.getName());
//Create insert action (mimetype, inputStream)Insert insert = mirror.timeline().insert(item, new InputStreamContent(fileInfo.getContentData().getMimetype(), fileFolderService.getReader(nodeRef).getContentInputStream()));
//execute insertinsert.execute();
Use Case #2
• Retrieve Image from Alfresco• GDK Glassware• Glass Web browser• Alfresco Share Proxy
White: Blank (no brand)
Sample Code – Retrieve from Alfrescoprivate void handleResult(Result result) { //This is very nasty. Hardcoded user and password. //Proxy will only show images within the browser.
//Need a new call to transform documents to images. String url = "http://admin:[email protected]:8081 \
/share/ proxy/alfresco/api/node/content/workspace/ \SpacesStore/" + result.getText() + "/glass";
//define activity intent to open a url Intent intent = new Intent(Intent.ACTION_VIEW, \ Uri.parse(url));
//load image startActivity(intent);}
Where is the code?
• All code is POC – offered with no support!
• https://github.com/jottley/stainedglass
• https://github.com/jottley/zxing
Q&A
@wabson @rwijangco
@tsgrp
@ZXing