net.neurowork.mobile.android.fw
Class ApplicationData

java.lang.Object
  extended by net.neurowork.mobile.android.fw.ApplicationData

public class ApplicationData
extends java.lang.Object

Singleton is used for read and admin the app.xml file From this class you can access to application Levels.

Author:
Jorge E. Villaverde, Jonatan Alcocer Luna

Field Summary
static java.lang.String IS_ENTRY_POINT_TAG
           
static java.lang.String IS_SIDE_MENU_TAG
           
static java.lang.String NEXT_LEVEL_TAG
           
static int SEARCH_LIMIT
           
 
Constructor Summary
ApplicationData()
           
 
Method Summary
 java.util.List<SearchResult> findAllGeoref(android.content.Context context)
          Returns a list with all geo-referrals
 java.util.List<SearchResult> findAllGeoref(android.content.Context context, java.util.Locale locale)
          Returns a list with all geo-referrals
 java.util.List<SearchResult> findAllLevelsImages(android.content.Context context)
          Returns all images associated to one level.
 java.util.List<SearchResult> findAllLevelsImages(android.content.Context context, java.util.Locale locale)
          Returns a list with all levelImages
 java.util.List<SearchResult> findWidthText(android.content.Context context, java.util.Locale locale, java.lang.String text)
          Returns a list with all search results
 java.util.List<SearchResult> findWidthText(android.content.Context context, java.lang.String text)
          Returns a list with all levelImages
 ActivityGenerator getAppCoverData(android.content.Context context)
          Returns an ActivityGenerator with data obtained after parsing cover file Se devuelve un ActivityGenerator con los datos obtenidos al parsear el fichero "portada".xml
 CoverActivityGenerator getAppCoverData(android.content.Context context, java.util.Locale locale)
          Returns an ActivityGenerator with data obtained after parsing cover file
 BannerDataItem getBanner()
           
 java.lang.String getCoverFileName()
           
 AppLevelDataItem getDataItem(android.content.Context context, NextLevel nextLevel)
          Returns the AppLevelDataItem associated to nextLevel
 EntryPoint getEntryPoint()
           
 java.lang.String getFormatsFileName()
           
 java.util.Map<java.lang.String,FormatStyle> getFormatStyleMap()
           
 ActivityGenerator getFromNextLevel(android.content.Context context, NextLevel nextLevel)
          Returns an ActivityGenerator (if exists), of a specific type
 java.util.List<AppLevel> getLevels()
           
 java.util.Map<java.lang.String,LevelTypeStyle> getLevelStyleTypeMap()
           
 ActiveMenus getMenu()
           
 AppLevel getNextAppLevel(NextLevel nextLevel)
          Returns the AppLevel associated with a nextLevel
 java.lang.String getRotation()
           
 serverPushDataItem getServerPush()
           
 java.lang.String getStylesFileName()
           
 java.lang.String getTitle()
           
 void initializeBackground(android.app.Activity activity, LevelTypeStyle levelTypeStyle)
          Initialize the specific background for a level
 void initializeBackground(android.app.Activity activity, java.lang.String activityType)
          Initialize the specific background for an activityType
 void initializeListFormat(android.app.Activity activity, java.lang.String activityType, android.widget.Button selection)
          Initialize the list's format and background, with the XML content, depending on a specific screen type.
 void initializeWidgetFormat(android.app.Activity activity, LevelTypeStyle levelStyle)
          Initialize the widget's components (textColor, textSize, textStyle, typeFace) with the XML content, depending on a specific screen type.
 void initializeWidgetFormat(android.app.Activity activity, java.lang.String activityType)
          Initialize the widget's components (textColor, textSize, textStyle, typeFace) with the XML content, depending on a specific screen type.
 void merge(ApplicationData appData)
          Add new levels to list
static ApplicationData mergeAppDataFromString(android.content.Context context, java.lang.String str)
          Check the app.xml file again and add the new data
static ApplicationData readApplicationData(android.content.Context context)
          Returns an ApplicationData with data obtained after parsing app.xml file
static ApplicationData readApplicationData(android.content.Context context, java.util.Locale locale)
          Returns an ApplicationData with data obtained after parsing app.xml file
 void setBanner(BannerDataItem banner)
           
 void setCoverFileName(java.lang.String coverFileName)
           
 void setEntryPoint(EntryPoint home)
           
 void setFormatsFileName(java.lang.String formatsFileName)
           
 void setFormatStyleMap(java.util.Map<java.lang.String,FormatStyle> formatStyleMap)
           
 void setLevels(java.util.List<AppLevel> levels)
           
 void setLevelStyleTypeMap(java.util.Map<java.lang.String,LevelTypeStyle> levelStyleTypeMap)
           
 void setMenu(ActiveMenus menu)
           
 void setRotation(java.lang.String rotation)
           
 void setServerPush(serverPushDataItem serverPush)
           
 void setStylesFileName(java.lang.String stylesFileName)
           
 void setTitle(java.lang.String title)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEXT_LEVEL_TAG

public static final java.lang.String NEXT_LEVEL_TAG
See Also:
Constant Field Values

IS_ENTRY_POINT_TAG

public static final java.lang.String IS_ENTRY_POINT_TAG
See Also:
Constant Field Values

IS_SIDE_MENU_TAG

public static final java.lang.String IS_SIDE_MENU_TAG
See Also:
Constant Field Values

SEARCH_LIMIT

public static final int SEARCH_LIMIT
See Also:
Constant Field Values
Constructor Detail

ApplicationData

public ApplicationData()
Method Detail

readApplicationData

public static ApplicationData readApplicationData(android.content.Context context)
                                           throws InvalidFileException
Returns an ApplicationData with data obtained after parsing app.xml file

Parameters:
context -
Returns:
ApplicationData
Throws:
InvalidFileException

readApplicationData

public static ApplicationData readApplicationData(android.content.Context context,
                                                  java.util.Locale locale)
                                           throws InvalidFileException
Returns an ApplicationData with data obtained after parsing app.xml file

Parameters:
context -
locale -
Returns:
ApplicationData
Throws:
InvalidFileException

mergeAppDataFromString

public static ApplicationData mergeAppDataFromString(android.content.Context context,
                                                     java.lang.String str)
Check the app.xml file again and add the new data

Parameters:
context -
str -
Returns:

merge

public void merge(ApplicationData appData)
Add new levels to list

Parameters:
appData -

getDataItem

public AppLevelDataItem getDataItem(android.content.Context context,
                                    NextLevel nextLevel)
Returns the AppLevelDataItem associated to nextLevel

Parameters:
context -
nextLevel -
Returns:

getAppCoverData

public ActivityGenerator getAppCoverData(android.content.Context context)
Returns an ActivityGenerator with data obtained after parsing cover file Se devuelve un ActivityGenerator con los datos obtenidos al parsear el fichero "portada".xml

Parameters:
context -
Returns:
ActivityGenerator

getAppCoverData

public CoverActivityGenerator getAppCoverData(android.content.Context context,
                                              java.util.Locale locale)
Returns an ActivityGenerator with data obtained after parsing cover file

Parameters:
context -
locale -
Returns:
CoverActivityGenerator

getNextAppLevel

public AppLevel getNextAppLevel(NextLevel nextLevel)
Returns the AppLevel associated with a nextLevel

Parameters:
NextLevel - nextLevel
Returns:
AppLevel

getFromNextLevel

public ActivityGenerator getFromNextLevel(android.content.Context context,
                                          NextLevel nextLevel)
Returns an ActivityGenerator (if exists), of a specific type

Parameters:
Context - context
NextLevel - nextLevel
Returns:
ActivityGenerator

findAllLevelsImages

public java.util.List<SearchResult> findAllLevelsImages(android.content.Context context)
Returns all images associated to one level.

Parameters:
context -
Returns:

findAllLevelsImages

public java.util.List<SearchResult> findAllLevelsImages(android.content.Context context,
                                                        java.util.Locale locale)
Returns a list with all levelImages

Parameters:
context -
locale -
Returns:

findWidthText

public java.util.List<SearchResult> findWidthText(android.content.Context context,
                                                  java.lang.String text)
Returns a list with all levelImages

Parameters:
context -
text -
Returns:

findWidthText

public java.util.List<SearchResult> findWidthText(android.content.Context context,
                                                  java.util.Locale locale,
                                                  java.lang.String text)
Returns a list with all search results

Parameters:
context -
locale -
text -
Returns:

findAllGeoref

public java.util.List<SearchResult> findAllGeoref(android.content.Context context)
Returns a list with all geo-referrals

Parameters:
context -
Returns:

findAllGeoref

public java.util.List<SearchResult> findAllGeoref(android.content.Context context,
                                                  java.util.Locale locale)
Returns a list with all geo-referrals

Parameters:
context -
locale -
Returns:

initializeWidgetFormat

public void initializeWidgetFormat(android.app.Activity activity,
                                   java.lang.String activityType)
Initialize the widget's components (textColor, textSize, textStyle, typeFace) with the XML content, depending on a specific screen type.

Parameters:
activity -
typeScreen -
currWidget -

initializeWidgetFormat

public void initializeWidgetFormat(android.app.Activity activity,
                                   LevelTypeStyle levelStyle)
Initialize the widget's components (textColor, textSize, textStyle, typeFace) with the XML content, depending on a specific screen type.

Parameters:
activity -
typeScreen -
currWidget -

initializeBackground

public void initializeBackground(android.app.Activity activity,
                                 java.lang.String activityType)
Initialize the specific background for an activityType

Parameters:
activity -
activityType -

initializeBackground

public void initializeBackground(android.app.Activity activity,
                                 LevelTypeStyle levelTypeStyle)
Initialize the specific background for a level

Parameters:
activity -
activityType -

initializeListFormat

public void initializeListFormat(android.app.Activity activity,
                                 java.lang.String activityType,
                                 android.widget.Button selection)
Initialize the list's format and background, with the XML content, depending on a specific screen type.

Parameters:
activity -
activityType -
selection -

setTitle

public void setTitle(java.lang.String title)

getTitle

public java.lang.String getTitle()

setCoverFileName

public void setCoverFileName(java.lang.String coverFileName)

getCoverFileName

public java.lang.String getCoverFileName()

getStylesFileName

public java.lang.String getStylesFileName()

setStylesFileName

public void setStylesFileName(java.lang.String stylesFileName)

getFormatsFileName

public java.lang.String getFormatsFileName()

setFormatsFileName

public void setFormatsFileName(java.lang.String formatsFileName)

getEntryPoint

public EntryPoint getEntryPoint()

setEntryPoint

public void setEntryPoint(EntryPoint home)

getMenu

public ActiveMenus getMenu()

setMenu

public void setMenu(ActiveMenus menu)

getRotation

public java.lang.String getRotation()

setRotation

public void setRotation(java.lang.String rotation)

setLevels

public void setLevels(java.util.List<AppLevel> levels)

getLevels

public java.util.List<AppLevel> getLevels()

getLevelStyleTypeMap

public java.util.Map<java.lang.String,LevelTypeStyle> getLevelStyleTypeMap()

setLevelStyleTypeMap

public void setLevelStyleTypeMap(java.util.Map<java.lang.String,LevelTypeStyle> levelStyleTypeMap)

getFormatStyleMap

public java.util.Map<java.lang.String,FormatStyle> getFormatStyleMap()

setFormatStyleMap

public void setFormatStyleMap(java.util.Map<java.lang.String,FormatStyle> formatStyleMap)

getServerPush

public serverPushDataItem getServerPush()

setServerPush

public void setServerPush(serverPushDataItem serverPush)

getBanner

public BannerDataItem getBanner()

setBanner

public void setBanner(BannerDataItem banner)