Showing posts with label Google. Show all posts
Showing posts with label Google. Show all posts

Saturday, August 16, 2014

Adding tables to Etherpad Lite



So I love the real-time sharing of Google Docs, so I installed our own Etherpad Lite... and then I wanted tables so I installed ep_tables, but it was a bear to try and copy existing tables into there, so I finally exported some tables and found the format and here's what I recommend, in this example of 2 lines:

{"payload":[["This is a sample row on table 1"," "," "]],"tblId":"1","tblClass":"data-tables"}

{"payload":[[" "," "," row 2 column 3"]],"tblId":"1","tblClass":"data-tables"}


... where each row of data is a line of text.  Just paste them in the document and it reformats into a table.
It turns out the plugin doesn't like line breaks (or tabs) in a row, so don't even try... and that's one reason I wouldn't try and put multiple rows inside one payload line like this:
{"payload":[["This is a sample row on table 1","",""],["",""," row 2 column 3"]],"tblId":"1","tblClass":"data-tables"}

Since you can't split each row onto a new line it is pretty unreadable.
Other hints:

  • Only use the 'Table' button at the top to manipulate the table and not the little mouse-overs... they just never did anything reliable for me.
  • I also installed styles and formatting, but I couldn't get them to apply inside the table.
  • I don't see the purpose of the tblId; I put rows with the same tblId in different places and they showed at their location in the document, with line breaks or whatever in between.


Tuesday, October 21, 2008

Google GData APIs

This is just so I can find the Java API for Google GData. (Go ahead: try googling "gdata api" and see if you can find it that way. I dare you.)

http://code.google.com/apis/gdata/javadoc/

Note that it's linked from the "Client Libraries" page.

Update: you can find it easily in a Google search on: "gdata javadoc"

Wednesday, September 17, 2008

lessons from setting up Google Apps with Single-SignOn

Here are my lessons learned from setting up Google apps with Single-SignOn, where I can manage email and contact settings via an API.

Premier
search for "google apps"; be sure to "compare editions"
  • - provisioning via API
  • - email migration API
  • - contact/doc sharing

Purchase & Configure
  • - free for a month (temporarily?)
  • - they verify you own it (HTML file or CNAME change)
  • - for mail, you set them with the MX records
  • - asynchronous setup steps

Provision New Accounts
search for "google apps apis"; look around for "client libraries" and "sample code"
  • - we really only need the "samples" codebase to show how to use their libraries
  • - peruse the INSTALL and README files
  • - after editing some properties, you can create/delete users; here's a huge test:
  • ant -f appsforyourdomain.xml sample.appsforyourdomain.run
  • - I commented out the call to 'deleteUser' so I could see the effect in the UI

Enable SSO (Single-SignOn)
  • - look at how to enable it in the admin area
  • - read links to SSO docs as you do things; I had to read a ton of things in their proper contexts before it started making sense

SSO Attempts
  • - open source projects: http://code.google.com/apis/apps/open_source_projects.html#sso
  • - Shibboleth: error in IdP, but it worked after tweaking build.xml; unable to install SP, so I stopped http://code.google.com/apis/apps/articles/shibboleth2.0.html
  • - JOSSO: easy to get sample up and running; unclear how to wire to Google, so I stopped
  • - ESOE: didn't even try it
  • - Google has best basic example as Java JSP project in "client libraries" and "sample code": http://code.google.com/p/google-apps-sso-sample/downloads/list
  • - Google instructions, which are awesome (from README in download): http://code.google.com/apis/apps/sso/saml_reference_implementation_web.html

Lessons Learned during SSO Attempts
  • - use this reference for key generation: http://code.google.com/apis/apps/articles/sso-keygen.html
  • - many lessons about keys and certificates: private key vs. public key vs. certificate
  • - keytool stores things in home directory, protected by a password
  • - openssl generates artifacts via stdout or to files you specify
  • - Google tutorial doesn't explain how to change the SP URL (to your google apps domain). I've modified their v1.0.1 JSP code, so in my version you only need to change the domain name in the "saml_demo.jsp" file.
  • - Furthermore, I was able to create a one-step, single link that logs you in automatically. You'll have to contact me directly if you want this.