|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcmsplugin.virtualdesktop.Desktop
public class Desktop
Constructor Summary | |
---|---|
Desktop()
Default constructor to build a new empty desktop. |
|
Desktop(File xmlFile)
Creates a new Desktop from an XML File. |
Method Summary | |
---|---|
void |
addTab(Tab tab)
Add the specified tab at the end of the current Tab list. |
static boolean |
canEditDesktop(Member mbr,
Data data)
Check that the specified Member is allowed to edit the Desktop of the specified Data. |
Service |
findService(String serviceId)
Find a service anywhere in this Desktop based on the specified service id. |
String |
getCss()
Retrieve the theme of this desktop. |
static Desktop |
getDesktop(JcmsContext context)
Retrieve the desktop associated to the specified JcmsContext. |
static Data |
getDesktopDataOwner(JcmsContext context)
Retrieve the Data for which the desktop is being displayed/edited in the current context. |
static Desktop |
getFromExtraDBData(Data data)
Retrieve the Desktop stored in the extradbdata of the specified Data, if any. |
static Desktop |
getFromExtraInfo(Data data)
Retrieve the Desktop stored in the extrainfo of the specified Data, if any. |
String |
getId()
Retrieves the id of this desktopElement |
long |
getLastAccessTime()
Retrieve the last access time of this desktop. |
Tab |
getSelectedTab()
Retrieve the Tab to open when accessing this Desktop. |
String |
getShortName()
Returns the short name of this class to use of all instance. |
Tab |
getTab(String tabId)
Retrieve a tab of this desktop from its id. |
List<Tab> |
getTabList()
Retrieve the list of tab of this Desktop. |
static boolean |
removeOldDesktopFromExtraInfo(Data data,
long expirationDelay)
Remove the Desktop from the extra info of the specified Data if the desktop last access time is older than the specified expiration delay. |
void |
removeTab(Tab tab)
Remove the specified tab from the current Tab list. |
void |
saveInExtraDBData(Data data)
Save this Desktop in the specified Data's extradbdata |
void |
saveInExtraInfo(Data data)
Save this Desktop in the specified data's extrainfo |
void |
setCss(String css)
Set the theme of this desktop. |
static void |
setDesktopDataOwner(JcmsContext context,
Data data)
Set the Data for which the Desktop will be edited in the current context. |
void |
setLastAccessTime()
Set the last access time of this desktop to current time. |
void |
setSelectedTab(Tab tab)
Set the Tab to be opened when accessing this Destkop |
String |
toString()
|
String |
toXml()
Serialize this Desktop into an XML String. |
String |
toXml(boolean outputId)
Serialize this Desktop into an XML String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Desktop()
public Desktop(File xmlFile) throws org.jdom.JDOMException, IOException, com.jalios.jcmsplugin.virtualdesktop.DesktopElement.ParseException
xmlFile
- a valid XML File
IOException
- if the File could not be read
org.jdom.JDOMException
- if the XML file could not be parsed
ParseException
- when xml could not be parse to create Desktop elements
com.jalios.jcmsplugin.virtualdesktop.DesktopElement.ParseException
Method Detail |
---|
public String getShortName()
public String getCss()
DesktopManager.getThemes()
public void setCss(String css)
css
- a theme name taken from DesktopManager.getThemes()
public long getLastAccessTime()
public void setLastAccessTime()
public List<Tab> getTabList()
public Tab getTab(String tabId)
tabId
- the id of the tab
public void addTab(Tab tab)
tab
- the Tab to add (if null, no operation is performed)public void removeTab(Tab tab)
tab
- the Tab to remove (if null, no operation is performed)public void setSelectedTab(Tab tab)
tab
- the Tab to openpublic Tab getSelectedTab()
public Service findService(String serviceId)
serviceId
- the id of the Service to look for.
public static Desktop getDesktop(JcmsContext context)
Create a new default desktop if none could be found.
Update the last access time of the desktop.
context
- the current JcmsContext
getFromExtraDBData(Data)
public static Data getDesktopDataOwner(JcmsContext context)
Usually returns the logged Member, except when an administrator has requested Desktop edition of a Workspace, Group or any other relevant Data.
context
- the current JcmsContext
public static void setDesktopDataOwner(JcmsContext context, Data data)
context
- the current JcmsContextdata
- the Data to be associated in the current contextpublic static boolean canEditDesktop(Member mbr, Data data)
Rules that applies as of current implementation depending on Data instance:
Workspace
: mbr must be administrator of the workspace.Group
: If data is a global group, mbr must be administrator. If data is a workspace's group, mbr must be administrator of the group's workspace.Member
: mbr must be administrator or the same Member as data.
mbr
- the Member for which right access are being checkeddata
- the Data in which the desktop will be saved
public void saveInExtraInfo(Data data)
data
- the Data for which the Desktop will be savedpublic static Desktop getFromExtraInfo(Data data)
data
- the Data for which the Desktop is being retrieved
saveInExtraInfo(Data)
public static boolean removeOldDesktopFromExtraInfo(Data data, long expirationDelay)
data
- the data from which to remove extra infoexpirationDelay
- delay (in minutes) above which the desktop is removed if has not been accessed
public void saveInExtraDBData(Data data)
data
- the Data for which the Desktop will be savedpublic static Desktop getFromExtraDBData(Data data)
data
- the Data for which the Desktop is being retrieved
saveInExtraDBData(Data)
public String toXml()
public String toXml(boolean outputId)
outputId
- false to skipt "id" attribute in xml element.
public final String getId()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |