iPhone App
clusterinfo.at
Mobile devices such as Apple’s iPhone or various Google Android driven devices are
getting increasingly popular. With such devices and the possibility to access the internet
wirelessly it is possible to gain information everywhere on earth. For representing infor-
mation so called Apps (mobile applications) are used. Such applications are fast, easy to
use and often fit just one special purpose.
This paper deals with the implementation of the iPhone application clusterinfo.at. This
app represents the mobile userinterface to the existing web portal. To access the infor-
mation a REST based webservice API has been developed which provides various services
like searching. Every request is covered in a result set which only contains metadata about
the information found. The client needs to post a second request with the result set to get
all records.
1
Statutory Declaration
I declare that I have authored this thesis independently, that I have not used other than
the declared sources / resources, and that I have explicitly marked all material which has been
quoted either literally or by content from the used sources.
Date Signature
2
Contents
Contents
Contents i
List of Figures ii
1 Introduction 1
2 Implementation 2
2.1 Server-Side API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.1 Categories for section: /getBrowseCategories . . . . . . . . . . . . . . 3
2.1.2 Search: /search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.3 Result set: /getResultSet . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.4 User in role: /isUserInRole . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.5 Promoted events: /getPromotedEvents . . . . . . . . . . . . . . . . . . 8
2.1.6 Detail: /getDetail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.7 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Client-Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.1 Newsticker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
i
List of Figures
List of Figures
1 iPhone - Server: Request - Response example . . . . . . . . . . . . . . . . . . . 12
2 Simple class-diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Section view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4 Category view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5 Section "person" - user not logged in . . . . . . . . . . . . . . . . . . . . . . . . 15
6 Wrong password or username . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7 User logged in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
8 Company . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
9 Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
10 Person . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
11 Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
12 Search in section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
13 Search in category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
14 Static message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
15 Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
16 Event detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ii
Listings
Listings
1 Example response for all categories in section "event". . . . . . . . . . . . . . . 3
2 Result-Set for records in category "Kongress". . . . . . . . . . . . . . . . . . . . 5
3 Result-Set for search in category. . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 Result-Set for search in section. . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5 Response from isUserInRole, the user has no rights. . . . . . . . . . . . . . . . 7
6 Promoted events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7 Details for "event" with ID 415 . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
8 No/invalid API key provided . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
9 Wrong/too few arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
10 Access of secure service in public environment . . . . . . . . . . . . . . . . . . . 11
iii
1 Introduction
1 Introduction
The clusterinfo.at iPhone application is the mobile access point for the existing clusterinfo.at
web portal and CRM system. For accessing the portal a completely new REST-API has been
developed which provides direct access to the database.
Like the web portal, the App allows the user to search the public database.
Further features:
• Search in category
This paper also provides a detailed documentation of the implemented REST webservice
API, the implementation of the client and an overview of the functionality of the application.
1
2 Implementation
2 Implementation
The CIS (clusterinformation system) provides a REST webservice to access all information of
the clustersystem. The webservice provides public and secure (HTTP-Basic-Auth, username/-
password) access over SSL (secure socket layer). The service responds with an XML document
encoded in ISO-8859-1 over the following URLs:
• Public: https://www.clusterinfo.at/mobile/services/<service>
• Secure: https://www.clusterinfo.at/mobile/services/secure/<service>
For several requests (e.g. /search) the webservice only returns a result set. In this case,
the webservice executes a query and returns an XML response with "metadata" about the
search like the "set id" generated on the server and the number of records found.
The set contains all records found (on the server). The results (records) can be requested
with another service later on - this means that not all records are returned intermediately to the
client. This mechanism has several advantages: fast and small response, instant information
about the search, "browsing" through the set or only get a range of records.
2
2 Implementation
All services can be accessed either publicly or securely except /isUserInRole, which can
only be accessed securely. For every request the apiKey attribute (access token) has to be
provided to ensure an authorized access from the iPhone application.
The root node (<result>) of the XML response has the following attributes:
Arguments:
• Request: /getBrowseCategories?apiKey=1234&type=event
• Response:
1 <? xml version = " 1.0 " encoding = " ISO -8859 -1 " ? >
2 < r:result status = " OK " xmlns:r = " http: // www . healthgate . at /←-
HTSMobileResult " >
3 < r:category type = " FIXED " >
4 < r:id > 7999999999999001 </ r:id >
5 < r:catName > Kongress </ r:catName >
6 </ r:category >
7 < r:category type = " FIXED " >
8 < r:id > 7999999999999002 </ r:id >
9
3
2 Implementation
4
2 Implementation
This service is the main service for searching in sections, categories and for retrieving records
in categories. Therefore the API needs several arguments:
Arguments:
• Search in section:
• Search in category:
• Records in category:
• Request: /search?categoryId=7999999999999001&type=event&apiKey=1234
• Response:
1 <? xml version = " 1.0 " encoding = " ISO -8859 -1 " ? >
2 < r:result status = " OK " resultSetId = " 1 2 8 5 2 4 8 3 1 7 9 5 7 9 1 1 4 3 1 0 7 1 3 3 " ←-
searchHits = " 2 " xmlns:r = " http: // www . healthgate . at / HTSMobileResult " / >
5
2 Implementation
• Request: /search?categoryId=7999999999999001&type=event&query=zukunft&apiKey=1234
• Response:
1 <? xml version = " 1.0 " encoding = " ISO -8859 -1 " ? >
2 < r:result status = " OK " resultSetId = " 1 2 8 5 2 4 8 4 5 4 2 7 9 9 1 1 4 3 1 0 7 1 3 3 " ←-
searchHits = " 1 " xmlns:r = " http: // www . healthgate . at / HTSMobileResult " / >
• Request: /search?type=event&query=zukunft&apiKey=1234
• Response:
1 <? xml version = " 1.0 " encoding = " ISO -8859 -1 " ? >
2 < r:result status = " OK " resultSetId = " 1 2 8 5 2 4 8 5 3 2 8 6 1 9 1 1 4 3 1 0 7 1 3 3 " ←-
searchHits = " 1 " xmlns:r = " http: // www . healthgate . at / HTSMobileResult " / >
Arguments:
6
2 Implementation
• Request: /getResultSet?setId=128524852912191143107133&from=1&to=3&apiKey=1234
Check if the current session user has a given role - either returns true or false in the XML
response.
This is a secure service. Public access is not permitted.
Arguments:
• Request: /secure/isUserInRole?apiKey=1234&roleName=clusterRights
• Response:
1 <? xml version = " 1.0 " encoding = " ISO -8859 -1 " ? >
2 < r:result status = " OK " xmlns:r = " http: // www . healthgate . at /←-
HTSMobileResult " >
3 < r:userInRole > false </ r:userInRole >
4 </ r:result >
7
2 Implementation
Returns all promoted events - the returned XML is equal to the response when the service
/search?type=event is requested.
• Request: /getPromotedEvents?apiKey=1234
• Response:
1 <? xml version = " 1.0 " encoding = " ISO -8859 -1 " ? >
2 < r:result status = " OK " searchHits = " 1 " xmlns:r = " http: // www . healthgate . at←-
/ HTSMobileResult " xmlns:e = " http: // www . healthgate . at / HTSMobileEvent " >
3 < r:event >
4 < e :v er ans ta lt ung sI d > 415 </ e :v era ns ta ltu ng sI d >
5 < e:titel > Zukunft skonfere nz 2010 - next generation </ e:titel >
6 < e: v e ra n st a lt u n gs A rt > Kongress </ e : ve r a ns t al t u ng s Ar t >
7 < e:inhalt > - Human Resources und I n n o v a t i o n s m a n a g e m e n t </←-
e:inhalt >
8 < e:veranstalter > Human . technology Styria GmbH </ e:veranstalter >
9 < e:zielpublikum / >
10 < e:sfgLink cType = " URL " / >
11 < e:eventLink cType = " URL " / >
12 < e:anfahrt / >
13 < e:gebuehrMitgl > 35 </ e:gebuehrMitgl >
14 < e: g e bu e hr N ic h t Mi t gl > 160 </ e: g eb u e hr N ic h tM i t gl >
15
8
2 Implementation
Arguments:
• type: {company|person|event}
• Request: /getDetail?recordId=415&type=event&apiKey=1234
• Response:
1 <? xml version = " 1.0 " encoding = " ISO -8859 -1 " ? >
2 < r:result status = " OK " searchHits = " 1 " xmlns:r = " http: // www . healthgate . at←-
/ HTSMobileResult " xmlns:e = " http: // www . healthgate . at / HTSMobileEvent " >
3 < r:event >
4 < e :v er ans ta lt ung sI d > 415 </ e :v era ns ta ltu ng sI d >
5 < e:titel > Zukunft skonfere nz 2010 - next generation </ e:titel >
6 < e: v e ra n st a lt u n gs A rt > Kongress </ e : ve r a ns t al t u ng s Ar t >
7 < e:inhalt > - Human Resources und Innovationsmanagement , ... </←-
e:inhalt >
8
9 < e:veranstalter > Human . technology Styria GmbH </ e:veranstalter >
10 < e:zielpublikum / >
9
2 Implementation
The webservice returns a number of various error messages indicated by the status attribute
("ERROR") of the <result> node.
Error messages:
10
2 Implementation
11
2 Implementation
2.2 Client-Side
Client REST-Webservice
1 Request
2 Response
cluster
information
system
3 Request
4 Response
1. Client-Request: The client request the result set for the query, e.g. "zukunft":
/search?type=event&query=zukunft&apiKey=1234.
2. Webservice-Response: The server responds with the result set containing the set id and
the number of found records - searchHits (see listing 4 for example).
3. Client-Request: If the webservice returns searchHits > 0 the client performs the next
request to get a number of records or all records from the set
(e.g. /getResultSet?setId=128524852912191143107133&from=1&to=3&apiKey=1234)
otherwise the client does not need to perform additional requests.
4. Webservice-Response: The service returns all records belonging to the given result set.
12
2 Implementation
AboutViewController
CIUser CISettingsCell
clusterinfo_atAppDelegate SettingsTableViewController
PeopleSectionTableViewController
CIActivityView
CITickerView
AddressAnnotation
CILoadNextCell
CIMapViewController
CIEntityTableViewController
CIDetailTableViewController
CIURLConnection
CIParser
2.2.1 Newsticker
The newsticker shows messages from a static XML-File (parsed with CITickerMessageParser)
and promoted events (service /getPromotedEvents). All messages are loaded at program
startup. If the user performs a login or logout the messages are flushed and reloaded.
13
3 Functionality of the iPhone application
3.1 Sections/Categories
Figures 3 and 4 show the main view for each section and category.
14
3 Functionality of the iPhone application
Figure 8: Company Figure 9: Event Figure 10: Person Figure 11: Address
15
3 Functionality of the iPhone application
3.4 Search
The application provides functionality for searching a whole section as well as searching a single
category. In order to perform a search request the table needs to be scrolled down.
The application provides searching a whole section (figure 12) and searching only in a section
(figure 13) - to do this, the table need to scrolled down.
16
3 Functionality of the iPhone application
3.5 Newsticker
The newsticker displays promoted events (indicated by ">", figure 15) which can be touched
in order to show further details (figure 16) and static messages (figure 14).
Figure 14: Static message Figure 15: Event Figure 16: Event detail
17