SC Profile Manager dev blog


Profile Manager Implementation details

Posted in General by scprofile on June 13, 2008

I’ve think of a system which is based between the services : Configuration and FileAccess and the utils.

What is needed :
– an access to the files specifics to a profile
– an access to the common files of all the profiles

Objectif :
– Create a system bundle which will manage profiles and their datas
– Minimize all the modifications which need to be done on the FileAccessService and ConfigurationService

Modifications of the services

FileAccessService

Methods : (FileAccessServiceImpl)
– getPrivatePersistentFile
– getPrivatePersistentDirectory
– getScHomeDirLocation

Now by default, we use the profile directory to store and read the persistents files and directories. Consequently we need to add some methods for the common files and directories.

New prototypes :
public File getPrivatePersistentFile(String fileName)                        // Not changed
public File getCommonPersistentFile(String fileName)                        // New
private File getPrivatePersistentFile(String fileName, boolean commom)

The two first methods call the third one and set the last parameter.
The same system goes from the getPrivatePersistentDirectory method.

I have some interogations from the last method, what should we return ? the common home directoy ou the profile directory ?

ConfigurationService

The big question is : do we need to save common data in the configuration file or we let the plugins handle that with persistant files ?

Methods :
– createConfigurationFile
– getScHomeDirName
– getScHomeDirLocation

Creation of a new system service (System Bundle)

From my current investigation here is the methods of the ProfileService :
– getScCommonHomePath()
– getScProfileHomePath()
– getCurrentProfileName()
– getCurrentProfileId()
– getProfilesList()
– getProfile(String profileId)

– useLastProfile() –> boolean
– setUseLastProfile(boolean b)

– generateProfileId()
– generateProfilePath(String id, String name)

– addProfile(String id, String name, String path)
– updateProfileName(String id, String newName)
– deleteProfile(String id)

First start of the program

There are two models :
– Like Eclipse : we ask the user to create a profile and by default the checkbox to use a profile by default a every start isn’t checked.
– Like Firefox : we create a profile named “default” and use this profile by default. Later, the user can create anothers profiles and set to ask for a profile a the start of the program.

I think of using the Firefox model, it’s more userfriendly.

Main questions :
– how to block the start of the program to ask which profile it must use ?
– how to reboot all the settings when the user ask from another profile ?

GUI

Main frame

A new item in a menu (probably File) to switch profile. May be, also, add the profile name in the title bar (if the profile is default, it’s not displayed).

Profile Manager GUI

A system bundle merged with the ProfileService or a plugin.

A GUI to manage the profiles (add, update name, delete), define if the programm must ask for a profile at start and select another profile.

Default profile path : ~/.sip-communicator/SC-profile.id
The profile id is generated from the current date timestamp converted in an hexaform.

The user can also set another path but he need the rights to write.