• Nenhum resultado encontrado

CHAPTER 5 TV-ANYTIME STANDARDS IMPLEMENTATION

5.5 User Preferences

5.5.2 Process

1. Asx

58 Figure 26. Class Asx UML.

Class Asx extends abstract class HttpServlet. It handles the HTTP requests and responses.

The main methods are listed in Table 3.

Name Function Asx.doGet() Handles the HTTP GET method.

Asx.doPost() Handles the HTTP POST method.

Asx.processRequest() Processes requests for both HTTP GET and POST method.

Table 3. Class Asx function explanation.

2. Preference Data

59

There is a table in database for storing users' Preference Data setting. The table structure is shown in Table 4:

Column Name Description

usr_id The user ID. It is referenced to column id in User Table.

observation_period Observation Period, defined as the total number of hours.

tvchannels A string of TvChannel ids, which are separated by commas.

categories A string of Category ids, which are separated by commas.

Table 4. Database PreferenceData Table.

Within this table, column 'tvchannels' stores a sequence of TvChannel Ids as a string. The Ids are separated by commas. Column 'categories' stores a sequence of Category Ids as a string. Commas separate these Ids as well.

60 Figure 27. Class PreferenceData UML.

There are seven private parameters in a PreferenceData object. Since the user logged in to this application, every operation is personnel related. Thus, the user's information must be available. The User object saves it. Parameter 'dbExistance' is a Boolean value. Once some user has set his or her preference and saved this setting into database successfully, this value will be set as 'true'.

Otherwise it will be 'false'. Parameter 'paraExistance' is a Boolean value also.

When the user changes (he or she has already set the setting) or sets (the first time he or she uses this service) the preference setting, this value will be 'true'.

It is 'false' if nothing was modified. The meaning of String object 'tvChannels' and 'categories' is obviously. The 'observation_period' parameter indicates

61

how many hours before current time point the user expects the filter to cut her/his preference TV programs. Whenever the user opens the setting page, there is an informing message shown to them, which tells them what the situation is. For instance, 'Your preference setting is shown below. You may change and update them. ' -- The user has set his preferences before; 'Welcome to set your TV guides preference! ' -- This is the first time that user uses this function; and so forth. The content of this message depends on both Parameter 'dbExistance' and Parameter 'paraExistance'.

3. Preference EPG Data

Figure 28. PreferenceEpgData UML.

Parameter Type Function

tvChannels Vector A vector of TvChannel objects. These TV Channels are user's favourite ones.

62

programByChannels Hashtable Stores all user favourite Program objects by some TV channel.

programByHour Hashtable Stores all user favourite Program objects by some period.

date Date The date when the programs were broadcast.

user User The User object.

uri String The TV guide URI.

Table 5. PreferenceEpgData class Parameter list.

Class PreferenceEpgData handles the user preferred EPG objects. The functions of most methods are very clear according to their names. The method insertAllPrograms(Vector) inserts all required programs into the PreferenceEpgData object for further usage.

4. Parameter Factory

Figure 29. ParameterFactory UML.

Name Function Class ParameterFactory Class ParametrFactory handles HTTP servlet

requests and returns different object based on the different requests.

ParameterFactory.createPreference Creates a PreferenceData object, which contains

63

Data(HttpServletRequest) nothing, but information about some special user.

ParameterFactory.createPreference EpgData(HttpServletRequest)

Creates a PreferenceEpgData object, which contains only the information about some special user and the date of the EPG.

Table 6. ParameterFactory function explanation.

5. MobTV Servers and MobTV Services

Figure 30. MobTV service structure.

‘MobTvServer’ -like classes provide all services and functions the users can access.

Name Function interface MobTvServiceProvider This is an interface. There is simply one

method service() defined.

abstract class AbstractMobTvServer This is an abstract class, which implements the interface

64

MobTvServiceProvider. It is a base class for all MobTvServers. In addition to method(s) defined in interface fi.vtt.tte.mobtv.middletier.MobTvServic eProvider this abstract class adds some methods that can be used in all subclasses.

AbstractMobTvServer.service(Object) This method overrides method MobTvServiceProvider.service(Object).

AbstractMobTvServer.service(Object, boolean)

The second parameter of this method is used when HTML version needs different functionality.

AbstractMobTvServer.createDaoFactory() Creates DaoFactory for data access operations. Might return null in case of error.

MobTvServer This class extends abstract class

AbstractMobTvServer.

MobTvServer.service(Object) This method provides the services for client. The method call is directed to specific class' service-method depending on the class of the parameter.

Subclasses should override this method.

MobTvServer.service(Object, boolean) Desired class is dynamically loaded and its service-method is used.

MobTvServerForPreferenceEpgData This class only has one method:

service(Object).

MobTvServerForPreferenceEpgData.service The parameter object is an instance of

65

(Object) PreferenceEpgData. This method

retrieves the programs from the database and returns the PreferenceEpgData object.

MobTvServerForPreferenceData This class only has one method:

service(Object).

MobTvServerForPreferenceData.service(Ob ject)

The parameter object is an instance of PreferenceData. This method retrieves the programs from the database and returns the PreferenceData object.

Table 7. MobTV Service Provider function explanation.

6. URI Parameter Factory class

Class UriParameterFactory generates the correct Uniform Resource Identifier (URI) based on type action the user wants to do.

Figure 31. Class UriParameterFactory UML.

There are many methods in this class handling different situations. These three are what we most need to explain. Two create() methods are private. Method createUriParameters() are protected and can be called by others. When it is called, it analyses the parameter 'Object'. If the Object is instance of

66

PreferenceEpgData object, it means that the user wants to watch his/her preferred TV guide, method create(PreferenceEpgData, boolean, String) is called and returns a valid EPG URI as a String object; if it is instance of PreferenceData object, e.g., the user is doing something with the preference setting, the corresponding setting page will be shown.

No documento HELSINKI UNIVERSITY OF TECHNOLOGY (páginas 66-75)

Documentos relacionados