public class ViewFactory extends Object
ViewFactory class.
Modifier and Type | Field and Description |
---|---|
protected static HashMap<String,View> |
m_views
A mapping of views ids to the View objects
|
protected static File |
usersFile
File path of views.xml
|
Modifier and Type | Method and Description |
---|---|
void |
deleteUser(String name)
Removes the user from the list of users.
|
void |
deleteView(String name)
When this method is called view is to be deleted.
|
String |
getCategoryComments(String viewName,
String categoryName)
getCategoryComments
|
static ViewFactory |
getInstance()
Singleton static call to get the only instance that should exist for the
ViewFactory
|
View |
getView(String name)
Return a
Map of usernames to user instances. |
Map<String,View> |
getViews()
Return a
Map of usernames to user instances. |
static void |
init()
init
|
static void |
reload()
Parses the views.xml via the Castor classes
|
void |
renameUser(String oldName,
String newName)
When this method is called users name is changed, so also is the username
belonging to the group and the view.
|
void |
renameView(String oldName,
String newName)
When this method is called views name is changed.
|
void |
saveView(String name,
View details)
Adds a new user and overwrites the "users.xml"
|
void |
saveViews(Views views)
saveViews
|
protected static File usersFile
public static void init() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
init
IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public static ViewFactory getInstance()
public static void reload() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public void saveView(String name, View details) throws Exception
public void deleteUser(String name) throws Exception
public void renameUser(String oldName, String newName) throws Exception
public void renameView(String oldName, String newName) throws Exception
public void deleteView(String name) throws Exception
public void saveViews(Views views) throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
saveViews
views
- a Views
object.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public String getCategoryComments(String viewName, String categoryName)
getCategoryComments
Copyright © 2015. All Rights Reserved.