|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.novell.emframe.dev.Plugin
com.novell.emframe.dev.PropertyBookPage
Base class used to create property book pages that edits an eDirectory object. Most PropertyBookPages will want to
extend DirPropertyBookPage instead of just PropertyBookPage to take advantage of eDirectory Access Service
features.
A PropertyBookPage consists of Business Logic, Presentation Logic, and a Plug-in Descriptor:
Business Logic
AuthenticationBroker.
PropertyBookPages can also make their own connection to any back end resource, and the PropertyBookPage is
responsible for cleaning up any connections made. Current iManager credentials can also be obtained through the
AuthenticationBroker to assist in single sign-on. The AuthenticationBroker can be obtained from the
PropertyPageContext object (which extends the PluginContext object) passed into many methods using
context.getAuthenticationBroker().Presentation Logic
Plug-in Descriptor
All elements of a PropertyBookPage are zipped up in a module file with a .npm extension. See the iManager 2.x Developer Kit for more information on writing PropertyBookPages, the iManager file structure of where to put the different elements of the PropertyBookPage, and how to build .npm files.
Do NOT hardcode the "nps" name in any paths to files in JSPs or referenced by your business logic. The web application name "nps" may change in the future, and you can use the PluginContext method context.getModulesPath() to return the path in your JSP file to the webapps/nps/portal/modules directory.
Helper classes
The PropertyPageContext and TaskContext objects are based upon PluginContext.
The PluginContext given in many methods allows you access to all information needed for your PropertyBookPage.
See PluginContext for details as to the objects you can access.
There are several static classes that may be of help to you. See the
eMFrameUtils and DirUtils classes for more information. Some of the DirUtils
methods require an instantiated DirUtils object. You can obtain an instantiated DirUtils object from the
PluginContext passed into many methods using context.getDirUtils().
Debug logging is available through static methods on the D class. Debug output always shows up on STDERR,
but can be configured to go to the STDOUT and to a file with various debugging levels.
Order of methods called on your PropertyBookPage:
shouldRun(javax.servlet.http.HttpServletRequest, java.lang.String) - Before your class is instantiated, this method is called to see if iManager should
instantiate your PropertyBookPage and display it for selection by the user. If you have special considerations to
check before your PropertyBookPage is shown (such as your PropertyBookPage will only work on a particular operating
system, if you require schema extentions to be performed, etc...), overwrite the shouldRun call and do any checking.
Make sure to call the parent shouldRun method as well.init(com.novell.emframe.dev.PluginContext, org.jdom.Document) - When your class is instantiated, this method is called to perform any initialization. Your
PropertyBookPage will be instantiated when the PropertyBook containing your PropertyBookPage is instantiated.RuntimePlugin.shouldShow - If you have extended the RuntimePlugin interface, this method is called when
your PropertyBookPage should be shown but allows you to check the selected object for information before showing
your PropertyBookPage.show(com.novell.emframe.dev.PropertyPageContext) - This method is called when your PropertyBookPage is first selected.cache(com.novell.emframe.dev.PropertyPageContext) - This method is called when another PropertyBookPage is selected and you should cache any data.canCommit(com.novell.emframe.dev.TaskContext, java.util.Properties) - This method is called when the user presses OK or Apply. Your PropertyBookPage is given
the chance to look at the data and veto the save.commit(com.novell.emframe.dev.PropertyPageContext) - This method is called when your PropertyBookPage should save any changes made.release() - This method is called when your PropertyBookPage's lifecycle is complete. Overwrite
this method if you need to perform any cleanup before your PropertyBookPage is released.Objects based on classes derived from DirPropertyBookPage can either be added to a PropertyBook
object or run independently. If run independently, eMFrame will create a PropertyBook object
displaying only the DirPropertyBookPage object.
| Field Summary | |
protected Chapter |
m_chapter
Chapter that contains this page. |
protected java.lang.String |
m_displayName
Localized display name of the page. |
protected java.lang.String[] |
m_handledAttributeNames
Attributes this page handles. |
protected java.lang.String |
m_helpfile
Helpfile of the page. |
protected java.lang.String |
m_id
Unique ID of the page. |
boolean |
m_IsDirty
Has information changed on this page (dirty). |
boolean |
m_isXML
Is this page XML. |
protected java.util.Properties |
m_JSPDataObject
Deprecated. Use request.setAttribute(String, Object) instead |
protected org.jdom.Document |
m_pageDoc
XML Document describing the page. |
protected java.util.Properties |
m_parameters
Properties of this page. |
PropertyBook |
m_propertyBook
PropertyBook that contains this page. |
protected java.lang.String |
m_template
Template of the page. |
| Constructor Summary | |
PropertyBookPage()
|
|
| Method Summary | |
void |
apply(TaskContext context,
java.util.Properties resultStrings)
Deprecated. Use commit(PropertyPageContext context) instead |
void |
cache(PropertyPageContext context)
The cache method is called when another PropertyBookPage has been chosen. |
void |
canCommit(PropertyPageContext context)
This method is called when the user clicks the "OK" or "Apply" buttons. |
void |
canCommit(TaskContext context,
java.util.Properties resultStrings)
Deprecated. Use canCommit(PropertyPageContext context) instead |
void |
commit(PropertyPageContext context)
This method is to COMMIT the changes to the data source. |
Chapter |
getChapter()
Gets the chapter (tab). |
java.lang.String[] |
getHandledAttributeNames()
Returns a String[] of all attributes that this page is going to take care of. |
java.lang.String |
getHelpFilename()
Should return the filename as a string in the form moduleName.fileName (ex base.userHelpFile). |
java.lang.String |
getId()
Get the unique ID of this page. |
java.lang.String |
getName(TaskContext context)
Gets the page's localized display name. |
java.lang.String |
getTemplate()
Gets the merge template (.jsp). |
void |
init(PluginContext context,
org.jdom.Document doc)
Initializes the member variables with data from an XML configuration document. |
void |
release()
Called by iManager when the PropertyBookPage has been released and should be collected in the future. |
void |
save(TaskContext context,
java.util.Properties resultStrings)
Deprecated. Use cache(PropertyPageContext context) instead |
void |
setChapter(Chapter chapter)
The chapter is the tab which the page shows up on. |
static void |
shouldRun(javax.servlet.http.HttpServletRequest req,
java.lang.String sServiceName)
Returns whether this PropertyBookPage should be able to run. |
void |
show(PropertyPageContext context)
The show method is called when a PropertyBookPage is first selected. |
void |
show(TaskContext context,
java.util.Properties resultStrings)
Deprecated. Use show(PropertyPageContext context) instead |
| Methods inherited from class com.novell.emframe.dev.Plugin |
isPluginAvailable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Chapter m_chapter
protected java.lang.String m_displayName
protected java.lang.String[] m_handledAttributeNames
protected java.lang.String m_helpfile
protected java.lang.String m_id
public boolean m_IsDirty
public boolean m_isXML
protected java.util.Properties m_JSPDataObject
protected org.jdom.Document m_pageDoc
protected java.util.Properties m_parameters
public PropertyBook m_propertyBook
protected java.lang.String m_template
| Constructor Detail |
public PropertyBookPage()
| Method Detail |
public void apply(TaskContext context,
java.util.Properties resultStrings)
throws PageException
context - TaskContext of the plug-inresultStrings - Properties object to be added to the request
PageExceptioncommit(com.novell.emframe.dev.PropertyPageContext)public void cache(PropertyPageContext context)
throws PageException
The primary goal of this method should be to cache the data posted from the client in some in-memory object. For those writing to eDirectory this should most often be by saving the data to an NSObject. You can get a reference to the NSObject by calling getDirPropertyBook().getNSObject(). You should never call nsobj.update(). This will be called by the framework when the "OK" of "Apply" button is pressed.
context - PropertyPageContext based upon the TaskContext and the PropertyBookPage
PageExceptionpublic void canCommit(PropertyPageContext context)
throws PageException
context - PropertyPageContext based upon the TaskContext and the PropertyBookPage
PageExceptionpublic void canCommit(TaskContext context,
java.util.Properties resultStrings)
throws PageException
context - TaskContext of the plug-inresultStrings - Properties object to be added to the request
PageExceptioncanCommit(com.novell.emframe.dev.TaskContext, java.util.Properties)public void commit(PropertyPageContext context)
throws PageException
context - PropertyPageContext based upon the TaskContext and the PropertyBookPage
PageExceptionpublic Chapter getChapter()
setChapter(com.novell.emframe.dev.Chapter)public java.lang.String[] getHandledAttributeNames()
public java.lang.String getHelpFilename()
public java.lang.String getId()
public java.lang.String getName(TaskContext context)
context - TaskContext of the plug-in
public java.lang.String getTemplate()
public void init(PluginContext context,
org.jdom.Document doc)
init in class Plugincontext - PluginContext of the plug-indoc - XML Document registering this pagepublic void release()
public void save(TaskContext context,
java.util.Properties resultStrings)
throws PageException
context - TaskContext of the plug-inresultStrings - Properties object to be added to the request
PageExceptioncache(com.novell.emframe.dev.PropertyPageContext)public void setChapter(Chapter chapter)
chapter - Chapter object to contain this pagegetChapter()public static void shouldRun(javax.servlet.http.HttpServletRequest req,
java.lang.String sServiceName)
throws java.lang.Exception
req - HttpServletRequestsServiceName - String containing the id of this PropertyBookPage
java.lang.Exception - if this PropertyBookPage cannot runpublic void show(PropertyPageContext context)
throws PageException
context - PropertyPageContext based upon the TaskContext and the PropertyBookPage
PageExceptionpublic void show(TaskContext context,
java.util.Properties resultStrings)
throws PageException
context - TaskContext of the plug-inresultStrings - Properties object to be added to the request
PageExceptionshow(com.novell.emframe.dev.PropertyPageContext)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||