Developing Connections Plug-ins and applications is full of "What the??" moments, from what browser technologies and versions are supported through to common functions working in different ways in different parts of Connections, any of these can put a real dent in your delivery date but most are easy to cure and avoid with a little bit of hindsight and knowledge, here is that knowledge for you to take home and help you deliver on time.
2. Mark Myers
• A Member of the London
Developer Co-op
– Twitter: @stickfight
– Email: Mark@londc.com
– skype: stickfight
• Developer from a support
background
• 13+ years on IBM technology,
16+ years in IT
3. This Session
• Connections is a very powerful platform but
badly documented and a bit of a patchwork
• Most of the fun things you can do are not on
IBM official list of interfaces and methods
• There are tons of WTF moments that can cost
you a delivery date, lets see if we can head a
couple off at the pass.
4. This Session Content
• Its all in the Config – Lessons learnt and
examples of intergrading your code into
Connections user interface
• Into the database – Shhhh! we should not be
in here, it is the fun place
6. It’s all in the Config
• Front end Integration with connections is
based on 2 standards, IWidget 1.0 and
OpenSocial 2.5
• As neither are used much outside of
connections its best to avoid them as much as
possible and just use normal web standards
7. It’s all in the Config
IWidget 1.0 OpenSocial 2.5
Activity Streams X
Share Dialog X
Home Page X X
User Widgets X X
Profiles X
Communities X
You can only use certain standards in
certain places
8. It’s all in the Config
• The easiest way to
deal with this is to
store BOTH the
IWidget and Open
social config in your
project.
9. IWidget Config Example
This is the “context-root” you can either set
in in the ear file application.xml or ask your
admin to set it in websphere
11. Showing the Widgets
• You will have to provide your admins with
some XML so your widgets show up in the
right place.
• This will need to go in the widgets-config.xml
12. Showing the Widgets
• First you need a define the widget e.g.
<widgetDef defId=“UKICON 2014 Widget"
url="/ukicon2014/iwidgetConfig.xml"
modes="view"></widgetDef>
• And place it inside the
<definitions></definitions>
tag (there will be a load of other
stuff already in there)
13. Showing the Widgets
• Then tell connections where to show the
widget,
<widgetInstance uiLocation="col3" defIdRef="
UKICON 2014 Widget"/>
• And place it inside the
Column number
<page pageId=“XXX"></page>
tag “XXX” is the present page name
such as “communityOverview” or
“profilesView”
14. It’s a Database thing
• Sometimes the connections ATOM feeds are
not enough
– Not the data you need
– Not fast enough
– IBM don’t want you to do that but your clients do
, e.g. edit activity feeds.
• Its time to dig into the real data, the 12 db2
databases that back connections
15. It’s a Database thing – Tips #1
• Each database implements referential
integrity, however this does not work across
the different databases.
• When asking for database access, the read
only db2 role does not cut the mustard as it
lets you see the databases but not the
contents (all selects will return blank)
16. It’s a Database thing – Tips #2
• The 12 Databases are never really meant to
see each other, so there is a lot of reuse of
identifier names (fields and tables)
– This means that most of the automatic reverse
engineering tools (hibernate, JPA etc etc), get
really confused when you import multiple
databases as well as eating up a lot of memory
– Stick to static SQL if you have multiple database
apps.
17. It’s a Database thing – Connecting
• Recommended SQL client for dealing with
Connections Dev is Squirrel SQL
(http://squirrel-sql.sourceforge.net/)
– Java client So experiences the same issues as your
code
– Uses IBM’s own jar files.
– hellishly powerful
– FREE
18. It’s a Database thing – Connecting
• Downloaded and run the install Jar
– Only change on a default install is to select the
IBM DB2 option (just a tick box)
19. It’s a Database thing – Connecting
• When you first open it you will get a screen
like this (We need to do some config)
20. It’s a Database thing – Connecting
• Click on the big “Drivers” button on the left hand side, find
the “IBM DB2 App Driver” entry, you will see that like nearly
all the other entries, it has a red X by it,
21. It’s a Database thing – Connecting
• Now Double Click on the entry and in the pop up box, move
to the “Extra Class Path” Tab
22. It’s a Database thing – Connecting
• Next click on the “Add” button and go hunting for the driver
Jar files, these are best to get of the DB2 server, they are:
– db2jcc.jar
– db2jcc_licence_cu.jar
• You will tend to find them on any machine that has db2
installed in the directory
• X:Program FilesIBMSQLLIBjava
• Once you have added them, change the “Class Name” drop
down to
– com.ibm.db2.jcc.DB2Driver
24. It’s a Database thing – Connecting
• That’s you driver sorted, now make some connections
– Click on the “Aliases” button then the “+” button to add a new Aliases
25. It’s a Database thing – Connecting
• Select the driver you just setup, from the drop down field
• Then in the URL field put the connection string for the
database you want to get to in the format
jdbc:db2://XXX.XXX.XXX.XXX:50000/XXXX
(port 50000 is the default port for db2)
for example
• jdbc:db2://localdb2.ldc.com:50000/BLOGS
will get me the blogs database on my local server
27. It’s a Database thing – Connecting
• Then just use enter the username and password (hint, you
will NEVER get the lsuser account off your admin)
• Click “OK”
28. It’s a Database thing – Connecting
You now have an alias that you can
double click to connect to the
specified database,
You are going to have to create one
for each of the Connections
databases
You can make things easier by right
clicking on a alias and copying
29. It’s a Database thing – Connecting
Squirrel SQL makes it easy to backup tables, so you can work
locally to test your SQL
- “Create Table Script” to make a clone of the table
- “Create Data Script” to make a clone of the data
30. It’s a Database thing – Version
• The database fields are a moving target
• You need to be able to tell which version you
are connected to.
• Each database has its own schema version
31. It’s a Database thing – Version
Eg. for the home page db:
SELECT DBSCHEMAVER FROM
"HOMEPAGE"."HOMEPAGE_SCHEMA";
– Connections v4.0 BASE : 110
– Connections v4.5 BASE: 210
– Connections v4.5 CR4 : 213
• http://www.stickfight.co.uk/blog/Living-
Document-Connections-Db-Schema-Versions
32. It’s a Database thing – Clob
• IBM are fond of the CLOB data type
• Designed to store ASCII text data, including
formatted text such as HTML or PostScript.
• A pain to get via SQL
34. It’s a Database thing – Clob
SELECT DBMS_LOB.substr(VALUE, 3000)
FROM "BLOGS"."ROLLER_PROPERTIES"
where NAME = 'database.schema.version';
35. It’s a Database thing – User IDS
• In Connections each application and database
contains a separate user name table
• This table stores a foreign key that is the
global directory ID provided by the profile
database.
39. Summing Up #1
• The basic integration interfaces you will end
up using will be
– Standard Eclipse dynamic web project using your
framework of choice to make content + a few IBM
config files
– Command Line Jar
– Notes / Xpages
40. Summing Up #2
• Do NOT expect the IBM interfaces to deliver
on the marketing promise,
– The IBM devs are not given enough time to
complete any given interface or framework
• Do NOT treat connections as a unified frame
work
– Treat is like a Websphere box with access to db2,
Congnos, file net etc etc and a load of pre done
apps