39
Automation for print, online and mobile © 2016 TypeSystems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com Type8 Plugin SDK Ben Hauser | VP Engineering

Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

Automation for print, online and mobile

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

Typefi 8 Plugin SDK Ben Hauser | VP Engineering

Page 2: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ 14:00 – 15:00 Typefi 8 Plugin SDK

+ 15:00 – 15:30 Break

+ 15:30 – 17:00 Typefi 8 Server API

Schedule

Page 3: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Ben Hauser

+ Based in Queensland, Australia

+ Joined Typefi in 2003

+ Built Typefi Engine

+ VP Engineering since 2011

Presenter

Page 4: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ The main idea in Typefi 8 was to rebuild Typefi Server from scratch.

+ Not just a rebuild but a total rethink of what the component could and should be.

+ This has been the central focus for the Typefi Engineering for the last few years.

Typefi 8

Page 5: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ InDesign

– Adds support for InDesign CC (2015).

– Retain support for InDesign CC (2014), CC, CS6.

– Buy in Desktop, Workgroup or Cloud versions.

Typefi 8 Overview (1 of 5)

Page 6: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Client

– Brand new UI that is modern, responsive and mobile-friendly. It looks and feels great.

– New client side technology stack based on modern best-of-breed tools Bootstrap and jQuery.

Typefi 8 Overview (2 of 5)

Page 7: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible
Page 8: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Server

– We created the backend architecture to be super fast and reliable.

– We've updated the technology stack to modern, best-of-breed tools. Java 8. Tomcat 8.

– We invented a new architecture based on plugins that attach to a core server backbone.

Typefi 8 Overview (3 of 5)

Page 9: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Filestore

– Your Filestore is now a hierarchy. You can organise assets into folders as complex and as deep as you like. No more long, flat lists of projects.

– You can share templates much more easily and more naturally now. You can point to a shared template from anywhere in the Filestore.

– Filestore access built in to Writer and Designer.

Typefi 8 Overview (4 of 5)

Page 10: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Workflows

– A powerful way to quickly create your own, custom publishing workflows.

– We have modelled workflows as a series of discrete steps called Actions.

– We crafted an intuitive Workflow Editor that runs in any browser and enables you to create complex workflows very quickly by simply clicking and dragging.

Typefi 8 Overview (5 of 5)

Page 11: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible
Page 12: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Getting Started With Typefi 8 Demo

Demo

Page 13: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

Typefi 8 Plugin SDK

Page 14: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ The Typefi 8 Plugin SDK (Software Development Kit) enables you to build your own Typefi Actions that can be used seamlessly in Typefi Workflows.

Typefi 8 Plugin SDK

Page 15: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Download it from here: ahem…coming soon!

SDK Documentation

Page 16: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Use SDK if:

– You want to use Typefi's UI.

– You want to create a custom Typefi Action.

+ Use API if:

– You have an existing UI.

– You want to create your own UI.

SDK vs API

Page 17: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

SDK Challenge

Page 18: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Create a Typefi Action that transforms Markdown documents into HTML.

SDK Challenge

Page 19: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

http://daringfireball.net/projects/markdown/

+Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

+The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

Markdown

Page 20: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible
Page 21: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ To create a Typefi Action we must first create a Typefi Plugin.

+ Typefi Actions are packaged inside Typefi Plugins.

+ A Typefi Plugin is, at its heart, just an Java (Apache Tomcat) webapp that adheres to a few conventions.

Typefi Plugins

Page 22: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

Apache Tomcat

ROOT

typefi-plugin-id

typefi-plugin-docx

typefi-plugin-xsl

typefi-plugin-md

Plugins Actions

Page 23: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ We implemented Typefi Plugins as webapps for two reasons:

1. Hot deploy. Webapps can be installed and uninstalled on-the-fly without restarting the server.

2. Webapps are totally isolated from each other. Each has its own private Java class loader. So your Plugin can bundle any version of any jar file without impacting anything else on the server.

Typefi Plugins

Page 24: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Install Eclipse IDE for Java EE Developers from:

– https://eclipse.org/downloads/

+ Install Apache Tomcat 8 from:

– http://tomcat.apache.org/

Installation (step 1 of x)

Page 25: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Open Eclipse and:

1. Click File / New / Project… / Web / Dynamic Web Project

2. Set Project name: typefi-plugin-md

3. Click Next > / Next >

4. Set Context root: typefi-plugin-md

5. Click Finish(note that the context root MUST start with the prefix “typefi-plugin-“. This enables Typefi Server to automatically detect your plugin when running in the same Tomcat instance)

Create Project (step 2 of x)

Page 26: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Typefi Plugins describe themselves via a descriptor

+ GET /descriptor

+ This endpoint must return a chunk of JSON that describes all the Actions (and their UIs) offered by your plugin. So I created the file:

+ WebContent/WEB-INF/conf/descriptor.json

Descriptor (step 3 of x)

Page 27: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

descriptor.json

Page 28: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

Descriptor.java

Page 29: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Show:

– http://localhost:8080/typefi-plugin-md/descriptor

– http://localhost:8080/actions

Page 30: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Let's now implement the Import Markdown Action.

+ The endpoint name is the “type” value as specified in the descriptor JSON above plus the string “/run”:

+ POST /md-to-html/run

Implement Action (step 4 of x)

Page 31: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

env

Page 32: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

action

Page 33: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ https://github.com/rjeschke/txtmark

+ Yet another markdown processor for the JVM.

+ It is easy to use.

+ It is flippin' fast.

+ It does not depend on other libraries.

Txtmark

Page 34: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ It is good behaviour for an action to write what’s going on to a log file.

+ The recommended format is:

– YYYY-MM-DDTHH:MM:SS.SSSZ XXXX MESSAGE

+ where:

– YYYY-MM-DDTHH:MM:SS.SSSZ is the ISO 8601 date in UTC.

– XXXX is the message category, one of:

• DBUG a debug message.

• INFO an informational message.

• WARN a warning message.

• ERRO an error message.

• FILE / PROG / STAT (used by the Typefi Engine).

Logging

Page 35: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible
Page 36: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Valid values for ActionResult.StatusCode:

– DONE

– CANCELLED

– DELETED

– FAILED

– INITIALIZED

– INPROGRESS

– PENDING

Error Handling

Page 37: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ Currently, an action MUST be licensed to run.

+ This is somewhat restrictive for 3rd parties.

+ We aim to make this more straightforward in a future release.

+ For the time being contact Typefi and we can issue licenses for your custom actions on a case-by-case basis.

Licensing

Page 38: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

+ POST /md-to-html/status

+ POST /md-to-html/cancel

Long Running Actions

Page 39: Type 8 Plugin SDKtypefiwebcontent.s3.amazonaws.com/UserConference/2016/...HTML). +The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible

© 2016 Typefi Systems Pty Ltd and its licensors. All rights reserved. Australia . USA . UK . Netherlands . typefi.com

Ben Hauser | VP Engineering [email protected]