|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcorinis.Core
public class Core
Core
initialises and provides core functionality
| Field Summary | |
|---|---|
static int |
ADMINGROUP
|
static int |
ADMINUSER
|
static int |
ALLGROUP
|
static int |
CMSEDITGROUP
|
static int |
CMSQMGROUP
|
static int |
FORUMMODERATOR
|
static int |
GUESTGROUP
|
static int |
GUESTUSER
|
corinis.modules.core.UserRightCacher |
rights
|
| Constructor Summary | |
|---|---|
Core(java.lang.ClassLoader cl,
javax.servlet.jsp.PageContext pcontext)
|
|
Core(javax.servlet.http.HttpServletRequest srequest,
javax.servlet.http.HttpServletResponse sresponse,
javax.servlet.ServletContext scontext)
|
|
Core(javax.servlet.jsp.PageContext pcontext)
|
|
Core(java.lang.String locationPath,
java.lang.String appName,
javax.servlet.http.HttpServletRequest srequest,
javax.servlet.http.HttpServletResponse sresponse,
javax.servlet.ServletContext scontext)
Inits the core class providing user and session managment also puts some stuff into the servlet context for faster use. |
|
| Method Summary | |
|---|---|
void |
activateMe(java.lang.String name,
java.lang.String id)
activate the user |
void |
addDom(org.w3c.dom.Node tree)
Adds a domtree from any function to the current one in the core module for later processing. |
boolean |
checkAuthority(java.lang.String authCode)
Checks if a user has a authority |
boolean |
checkAuthority(java.lang.String authCode,
corinis.modules.abstracts.Module mod)
Checks if a user has a authority |
java.lang.String |
encryptString(java.lang.String s)
Ecrypt Strings for password checking |
void |
fakeGuest()
Call this function fakes the current user as guest until called again. |
java.lang.String |
getApp()
Get the application name |
java.lang.String |
getAuthorityGroupByID(long id)
|
corinis.modules.cache.Cache |
getCache()
|
corinis.modules.core.CorinisContext |
getConfigurator()
Used to retrieve the core Context out of the Servlet Context |
dbConnectionBroker |
getConnectionPool()
Get the connection pool |
java.util.Hashtable |
getContextHashtable()
|
org.w3c.dom.Node |
getCoreTree()
Generates a core tree segment, with ip, username, userid, url |
corinis.modules.interfaces.IDataStore |
getDataStore(java.lang.Class dsClass)
|
org.w3c.dom.Document |
getDoc()
|
javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
A helper function that Returns the cached DocumentBuilder object from the core Context |
org.w3c.dom.Element |
getLanguageTree(java.lang.String lang,
corinis.modules.abstracts.Module module,
org.w3c.dom.Document doc)
Returns a tree containing the language strings of the requested module. |
corinis.modules.abstracts.Module |
getModule(java.lang.Class moduleClass)
Retrieve a module from the internal cache |
long |
getOfflineTime()
|
java.lang.String |
getProfilerField(long userid,
java.lang.String fieldname)
|
org.w3c.dom.Element |
getRoot()
|
javax.servlet.ServletContext |
getServletContext()
Get the servlet context |
javax.servlet.http.HttpServletRequest |
getServletRequest()
Get the servlet request class |
javax.servlet.http.HttpServletResponse |
getServletResponse()
Get the servlet response class |
corinis.modules.core.CorinisSession |
getSession()
Get the session class |
java.lang.String |
getSessionId()
A helper function to retrieve the current users Session ID. |
java.lang.String |
getTemplatePath()
Get the template path |
javax.xml.transform.Transformer |
getTransformer(java.lang.String xslfile)
Cache the XSL Transformers for greater Speed |
java.lang.String |
getURI()
A helper Function to return the URI from the request Object |
java.lang.String |
getUserActiveStatus(long id)
Get the ActiveStatus an id |
java.lang.String |
getUserById(long id)
Get the Username by an id |
java.lang.String |
getUserEmail()
Retrieve the current users email |
java.lang.String |
getUserEmail(long userid)
Retrieve the email of a user. |
long |
getUserId()
Get the user id. |
long |
getUserIdbyName(java.lang.String name)
Get the User ID by its name. |
java.lang.String |
getUserIP()
Get the user ip |
java.lang.String |
getUserName()
Get the user name |
org.w3c.dom.Element |
getUsers(dbConnectionBroker pool,
org.w3c.dom.Document doc)
Returns a list of users. |
corinis.modules.abstracts.data.DataView |
getView(java.lang.Class viewClass)
Retrieve a dataview from the internal cache |
boolean |
isAdmin()
|
boolean |
isDebug()
|
boolean |
isLoggedOn()
Checks if the current user is logged on |
boolean |
isUserActive(long id)
Checks if a given User is currently active |
boolean |
isUserOnline(java.lang.String id)
Checks the DB if a certain user is online |
boolean |
mAvail(java.lang.String module)
Checks if a module is available |
java.lang.String |
parseDom(org.w3c.dom.Node tree,
java.lang.String xslfile)
Parses a dom tree, without adding it to the core tree |
java.lang.String |
parseDom(java.lang.String xslfile)
Parses a saved dom that is stored in the core module. |
java.lang.String |
parseDomHtml(org.w3c.dom.Node tree,
java.lang.String xslfile)
Parses a dom tree, without adding it to the core tree. |
java.lang.String |
parseDomHtml(java.lang.String xslfile)
Parses a saved dom that is stored in the core module. |
java.lang.String |
parseXML(org.w3c.dom.Element root,
java.lang.String xslfile)
this function takes a document object and parses it with an xsl file. |
void |
printLog(java.lang.String what)
output an error to the logfile |
void |
printLog(java.lang.String what,
java.lang.Exception e)
output an error to the logfile |
long |
printTimeLog(java.lang.String what,
long last)
output a timestamp to the logfile |
void |
redirect(java.lang.String online,
java.lang.String offline,
java.lang.String timedout)
Redirects to a certain page based on the user state |
boolean |
reload()
This function reloads the Context. |
void |
reloadRights()
Reinitialise the right cachers |
boolean[] |
rightArray(long elementid,
java.lang.String module)
Returns an array of all rights the user has for the given element. |
boolean |
rightCreate(long elementid,
java.lang.String module)
Checks if the current user has the right to create the given element. |
boolean |
rightDelete(long elementid,
java.lang.String module)
Checks if the current user has the right to delete the given element. |
boolean |
rightModify(long elementid,
java.lang.String module)
Checks if the current user has the right to modify the given element. |
boolean |
rightQm(long elementid,
java.lang.String module)
Checks if the current user has the right to quality manage the given element. |
boolean |
rightSpecial1(long elementid,
java.lang.String module)
Checks if the current user has the special right 1 for the given element. |
boolean |
rightSpecial2(long elementid,
java.lang.String module)
Checks if the current user has the special right 2 for the given element. |
boolean |
rightSpecial3(long elementid,
java.lang.String module)
Checks if the current user has the special right 3 for the given element. |
boolean |
rightSpecial4(long elementid,
java.lang.String module)
Checks if the current user has the special right 4 for the given element. |
boolean |
rightSpecial5(long elementid,
java.lang.String module)
Checks if the current user has the special right 5 for the given element. |
org.w3c.dom.Element |
rightTree(long elementid,
java.lang.String module)
Create a nice right tree out of the element rights. |
boolean |
rightView(long elementid,
java.lang.String module)
Checks if the current user has the right to view the given element. |
boolean |
sendMessage(long toUser,
java.lang.String message,
java.lang.String addmessage,
int messagetype)
Creates the new message. |
boolean |
sendMessage(java.lang.String toname,
java.lang.String message,
java.lang.String addmessage,
int messagetype)
Creates the new entry (internal) |
void |
setAdmin(boolean isAdmin)
|
void |
setDoc(org.w3c.dom.Document doc)
Deprecated. YOU SHOULD NOT USE THIS :P |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int GUESTUSER
public static final int ADMINUSER
public static final int GUESTGROUP
public static final int ALLGROUP
public static final int ADMINGROUP
public static final int CMSEDITGROUP
public static final int CMSQMGROUP
public static final int FORUMMODERATOR
public corinis.modules.core.UserRightCacher rights
| Constructor Detail |
|---|
public Core(javax.servlet.jsp.PageContext pcontext)
public Core(java.lang.ClassLoader cl,
javax.servlet.jsp.PageContext pcontext)
public Core(javax.servlet.http.HttpServletRequest srequest,
javax.servlet.http.HttpServletResponse sresponse,
javax.servlet.ServletContext scontext)
public Core(java.lang.String locationPath,
java.lang.String appName,
javax.servlet.http.HttpServletRequest srequest,
javax.servlet.http.HttpServletResponse sresponse,
javax.servlet.ServletContext scontext)
locationPath - the path of there to find the .xml and .dat fileappName - the name of the app (unique!)srequest - the request headersresponse - the servlet responsescontext - the servlet context| Method Detail |
|---|
public long getOfflineTime()
public corinis.modules.abstracts.data.DataView getView(java.lang.Class viewClass)
viewClass - the class to get
public corinis.modules.abstracts.Module getModule(java.lang.Class moduleClass)
moduleClass - the class to load
public void printLog(java.lang.String what)
what - the log line to print (timestamped)
public void printLog(java.lang.String what,
java.lang.Exception e)
what - the log line to print (timestamped)
public long printTimeLog(java.lang.String what,
long last)
what - the log line to print (timestamped)public javax.xml.parsers.DocumentBuilder getDocumentBuilder()
public java.util.Hashtable getContextHashtable()
public javax.xml.transform.Transformer getTransformer(java.lang.String xslfile)
xslfile - the xsl file the transformer is for
public java.lang.String parseXML(org.w3c.dom.Element root,
java.lang.String xslfile)
root - the tree part to parsexslfile - the xsl to parse with
public org.w3c.dom.Element getLanguageTree(java.lang.String lang,
corinis.modules.abstracts.Module module,
org.w3c.dom.Document doc)
<MODULENAME> <STRINGNAME> - the converted language string ... </MODULENAME>
lang - the language to getmodule - the name of the moduledoc - the document object
public java.lang.String encryptString(java.lang.String s)
s - the password to encrypt
public boolean sendMessage(java.lang.String toname,
java.lang.String message,
java.lang.String addmessage,
int messagetype)
toname - user name of the receivermessage - the message that is sentaddmessage - additional message data (can be used for special messages)messagetype - a type for the message (to identify f.e. forum alert; system alert;...)
java.lang.Exception - on fatal errors
public boolean sendMessage(long toUser,
java.lang.String message,
java.lang.String addmessage,
int messagetype)
toUser - user name of the receivermessage - the message that is sentaddmessage - additional message data (can be used for special messages)messagetype - a type for the message (to identify f.e. forum alert; system alert;...)
public org.w3c.dom.Node getCoreTree()
public java.lang.String getURI()
public corinis.modules.core.CorinisContext getConfigurator()
public boolean mAvail(java.lang.String module)
module - the module Name/Class
public corinis.modules.core.CorinisSession getSession()
public javax.servlet.http.HttpServletRequest getServletRequest()
public javax.servlet.http.HttpServletResponse getServletResponse()
public dbConnectionBroker getConnectionPool()
public javax.servlet.ServletContext getServletContext()
public java.lang.String getApp()
public java.lang.String getUserName()
public java.lang.String getUserIP()
public java.lang.String getSessionId()
public long getUserId()
public void fakeGuest()
public java.lang.String getUserById(long id)
id - The id of the user
public java.lang.String getProfilerField(long userid,
java.lang.String fieldname)
userid - the userid of the user to get the profilerfield forfieldname - the name of the field to get
public java.lang.String getUserActiveStatus(long id)
id - The id of the user
public boolean isUserActive(long id)
id - The id of the user
public boolean isLoggedOn()
public long getUserIdbyName(java.lang.String name)
name - The users name
public java.lang.String getTemplatePath()
public void activateMe(java.lang.String name,
java.lang.String id)
name - the name od the userid - the id of the user
public void redirect(java.lang.String online,
java.lang.String offline,
java.lang.String timedout)
online - url to redirect when user is onlineoffline - url to redirect when user is offlinetimedout - url to redirect when user is timed outpublic boolean checkAuthority(java.lang.String authCode)
authCode - the authority to check for
public boolean checkAuthority(java.lang.String authCode,
corinis.modules.abstracts.Module mod)
authCode - the authority to check for
public org.w3c.dom.Element getUsers(dbConnectionBroker pool,
org.w3c.dom.Document doc)
pool - the connection pooldoc - the document object
public boolean isUserOnline(java.lang.String id)
id - the user id
public boolean reload()
public void reloadRights()
public org.w3c.dom.Document getDoc()
public void setDoc(org.w3c.dom.Document doc)
public org.w3c.dom.Element getRoot()
public void addDom(org.w3c.dom.Node tree)
tree - a dom-tree (normally returned from a function)public java.lang.String parseDom(java.lang.String xslfile)
xslfile - The xsl document to parse
public java.lang.String parseDomHtml(java.lang.String xslfile)
xslfile - The xsl document to parse
public java.lang.String parseDom(org.w3c.dom.Node tree,
java.lang.String xslfile)
xslfile - The xsl document to parsetree - a dom-tree (normally returned from a function)
public java.lang.String parseDomHtml(org.w3c.dom.Node tree,
java.lang.String xslfile)
xslfile - The xsl document to parsetree - a dom-tree (normally returned from a function)
public boolean rightModify(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightView(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightCreate(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightDelete(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightQm(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightSpecial1(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightSpecial2(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightSpecial3(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightSpecial4(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean rightSpecial5(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean[] rightArray(long elementid,
java.lang.String module)
elementid - the id of the element to check the right formodule - the module where to look for the element
public org.w3c.dom.Element rightTree(long elementid,
java.lang.String module)
<right> <rightcreate>T/F <rightview>T/F <rightmodify>T/F <rightdelete>T/F <rightqm>T/F <specialright1>T/F <specialright2>T/F <specialright3>T/F <specialright4>T/F <specialright5>T/F </right>
elementid - the id of the element to check the right formodule - the module where to look for the element
public boolean isDebug()
public java.lang.String getAuthorityGroupByID(long id)
id - the id of the group
public boolean isAdmin()
public void setAdmin(boolean isAdmin)
public java.lang.String getUserEmail(long userid)
userid - the user to get the email for
public java.lang.String getUserEmail()
public corinis.modules.interfaces.IDataStore getDataStore(java.lang.Class dsClass)
public corinis.modules.cache.Cache getCache()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||