Try Gliffy for FREE
No signup required
Consider these ideas as you build your integration with Gliffy. The following suggestions stem from our experience with building Gliffy integrations and from the feedback of our users.
The user experience for many applications might look something like the following (your particular integration may have a different flow, but this is a good guideline for content management systems interested in adding Gliffy functionality).
This application flow is based heavily on our Confluence Plugin. (Note that the Confluence Plugin doesn't currently use the Gliffy API) Try out the Gliffy Plugin for Confluence to see this flow in action.
This suggestion is particularly useful for customers who are building content management systems that include Gliffy drawing capabilities. It is important to give your users a way to add Gliffy drawings in an intuitive way. Simply providing wiki-text isn't sufficient as users wont be able to easily find Gliffy. The best way we've found to solve this problem is to include an 'Add Gliffy Diagram' link in a prominent place on all pages that might include Gliffy Drawings. For wikis, you might want this where you have links to 'Add Page'.
We have developed several client libraries in different languages that address the complexity of OAuth and making calls to the REST API. Using a client library in your target language is a quick way to jumpstart your integration. Since the client libraries are open sourced under the Apache license, you are free to modify it to your needs.
Gliffy only allows Premium account holders to create private diagrams. This is to encourage customers to upgrade their Basic accounts to Premium accounts.
Developers: It is important that you check the expiration date of your account prior to creating diagrams for users. If the account expiration date is in the past, all newly created diagrams will be public by default, and the account MAY NOT create private diagrams. If the expiration date has passed, the UI of the home application should notify the user that they may only create private diagrams if they upgrade to a Premium Gliffy account.
In the future, we may release an Enterprise version of Gliffy, which will enable you to have an isolated hosted environment (i.e. a private sandbox at yourcompany.gliffy.com) or even host Gliffy in your own environment. Gliffy Enterprise will support the Gliffy API just like Gliffy Online does. By creating a global variable in your code that references the $API_ROOT for all requests, your integration with Gliffy will be able to support Gliffy Enterprise with a single configuration change.
We suggest you wrap the Gliffy editor in your own html page for several reasons:
One easy way to accomplish this task is through an iFrame. Here's an example from the PHP client library that wraps the Gliffy editor:
<html>
<head>
<script type="text/javascript">
// After the user is done editing, we want to refresh the page that contains
// the diagram image so that the new image will show up
function returnToHomeApplication() {
opener.location='index.php';
}
</script>
</head>
<body onbeforeunload="returnToHomeApplication();">
<iframe src ="<?php echo $diagramEditorLink ?>"
width="100%"
height="100%"
frameborder="0"
marginheight="0"
marginwidth="0">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Call the delete OAuth token request when your user logs out of your application. By deleting the OAuth token, any URL's created while the token was active will become invalid. This is a good idea as it will enhance the security of your integration.