|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.tbeans.remotefileselector2.html.RemoteFileSelector
public class RemoteFileSelector
The RemoteFileSelector is a TransformationBean that generates the appropriate HTML 4.0 and JavaScript to
represent a file selector.
The RemoteFileSelector
transformation bean
allows the navigation and selection of directories and entries on a server.
This class is primarily responsible for rendering the
RemoteFileSelector
component.
There are three major parts to the RemoteFileSelector
.
There is a file view area, a
tool bar area and a search facility.
This component also requires a model. If a
model is not specified
then a nullPointerException
will occur
when the component is rendered.
The file view area displays folders and files in a
TableView
with the specific key of
RFS_FILE_DETAILVIEW
.
OPEN_FOLDER
and SELECT_FILE
are the two valid actions in the RFS_FILE_DETAILVIEW
.
When a folder is selected the OPEN_FOLDER
command is executed and the selector displays
the files and folders contained in the selected folder.
There is not a default command for the SELECT_FILE
action. Therefore, it
is defined as an external action. This is the action that should be used
if there is a specific action desired when a file is selected.
A fullyQualifiedLocation
is provided on the request object in the case
of a SELECT_FILE
action or when a file is selected.
These actions are only valid for the first column in the TableModel.
By default Name
is the first column in the
TableModel.
The results from a search are also displayed in the file view area
in a TableView. One additional column is added to the TableView
to indicate the Path
of the file found when the search
results are returned.
The tool bar area provides additional ways to navigate in the selector.
The OPEN_FOLDER
action and the UP_ONE_LEVEL
action are available from the toolbar area.
When selecting a folder from the location ChoiceBox
component drop-down
the OPEN_FOLDER
command is executed.
The contents of the selected folder are displayed.
When selecting the folder in the toolbar area the OpenFolderCommand
is executed.
When an UP_ONE_LEVEL
action occurs the selector
displays the folders parent directory using the OpenFolderCommand.
A CheckBox
component to use for toggling an items description can be set for use on the
RemoteFileToolBar
component. When the
CheckBox
is selected all of the available descriptions
are displayed in a row below the file or folder. Otherwise, the descriptions are hidden.
The Show Description CheckBox
is not available by default.
The search facility is not turned on by default. A search facility
can be set by creating an instance of the RemoteFileSearch
class and setting it as the RFS_SEARCH component
.
When the Search Button
is selected the StartSearchCommand
is executed. All files in a tree matching the search criteria are
displayed in the file view area inside a TableView or inside the
searchResultsComponent
.
There is a specific implementation of the RemoteFileSelector for accessing
repository data through Information Services. See the InformationServicesSelector
class. The InformationServicesSelector allows navigation of an omr and
a dav repository. Once the repository instance is provided this class will
instatiate and initialize a default
com.sas.swing.models.remotefileselector2.informationservices.InformationServicesNavigationModel
.
Using the RemoteFileSelector class to display an InformationServicesSelector
requires the following steps:
InformationServicesSelector
.
Multiple trees can be viewed from the root level of the selector.
If a base level is
defined then the base level path specified is treated as the root
level of the selector. Therefore, the selector does not
allow navigation above the base path. A base path can be specified
by overriding the getBasePath()
method on the
BaseRemoteFileServerModel.
To control the display of the columns manipulate the column
model associated with the DetailsComponent or the SearchResultsComponent.
This is the safest and best way to control what columns are
displayed.
By default all file types are displayed in
the RemoteFileSelector
.
These file types
can be filtered to only display reports,
stored processes or information maps. See the
setFilterValues
method
for more details on filtering the file types.
The RemoteFileSelector is an HTML Table containing HTML tables, Transformation Beans
,
and Actions
.
See BaseTransformation
to understand
more about Transformation Beans
. Below the table shows the major
elements of the RemoteFileSelector component. To see any sub-components of these
key components select the link to view the class information for the specified
Transformation Bean
.
RemoteFileSelector Elements | ||
---|---|---|
Transformation Beans | Actions | |
RemoteFileToolBar | UP_ONE_LEVEL_ACTION | |
OPEN_FOLDER_ACTION | ||
TableView | SELECT_FILE_ACTION | |
OPEN_FOLDER_ACTION | ||
SORT_COLUMN_ASCENDING_ACTION | ||
SORT_COLUMN_DESCENDING_ACTION | ||
RemoteFileSearch | START_SEARCH_ACTION |
OPEN_FOLDER_ACTION
action, for searching and for the
display of the description rows of the RemoteFileSelector component.
Therefore, the sas_RemoteFileSelector.js
entry is
necessary for the search and the display of the description rows and when
the toolbar is visible.
The RemoteFileSelector is one of several TransformationBeans that rely on a set of style classes that are used by default when generating the resulting markup language. For more information on style sheets and the default style classes that apply to this TransformationBean, refer to the AppDev Studio Developer Site. You'll find a useful reference document entitled Cascading Style Sheets, Images, and TransformationBeans as well as the TransformationBeans Style Sheet Reference.
The RemoteFileSelector is one of several TransformationBeans that rely on JavaScript to provide some of its functionality. These JavaScript files are including automatically by the tbean. See JavaScriptIncludeHandler for more information about how these files are included and how to customize this behavior. The RemoteFileSelector uses the following JavaScript files:
Note that the toString() method on this class calls the write
method, which may have undesirable side effects. See BaseTransformation.toString() for more information. Debuggers often use toString() to show the value of a variable, and this may cause unexpected behavior while debugging
For More Information:
Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.
Examples for this class may be found on the Examples Site.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_TEMPLATE_FILE_NAME
The name of the file which will be used by default to read in the template used by this RemoteFileSelector component
composite. |
static java.lang.String |
RB_KEY
RB key for internationalization. |
static java.lang.String |
SEARCH_FIELDS_TEMPLATE_FILE_NAME
The name of the file which will be used by default to read in the template used by the RemoteFileSearch component composite
if one is set on the RemoteFileSelector component. |
static java.lang.String |
SEARCH_RESULTS
"Search Results..." model node value. |
Fields inherited from class com.sas.servlet.tbeans.BaseActionCompositeTransformation |
---|
viewerSupport |
Fields inherited from interface com.sas.servlet.tbeans.remotefileselector2.RemoteFileSelectorInterface |
---|
REGULAR_MODE, SEARCH_MODE |
Constructor Summary | |
---|---|
RemoteFileSelector()
Constructs a new RemoteFileSelector transformation bean. |
|
RemoteFileSelector(RemoteFileNavigationModelInterface model)
Constructs a new RemoteFileSelector with the specified model. |
|
RemoteFileSelector(RemoteFileNavigationModelInterface model,
java.util.Locale locale)
Constructs a new RemoteFileSelector using the specified model and Locale. |
Method Summary | |
---|---|
protected BaseTableView |
createDefaultFileDetailView()
Creates and returns the default file detailView component. |
protected BaseRemoteFileToolBar |
createDefaultToolBar()
Deprecated. use #createDefaultToolBar(Locale) |
protected BaseRemoteFileToolBar |
createDefaultToolBar(java.util.Locale locale)
Returns the default instance for the ToolBar component. |
void |
postConstructionSetup()
This method is executed only one time. |
protected void |
prepareToWriteDetailView()
Prepares the detail view or the search view for rendering in the file view area of the component. |
protected void |
prepareToWriteSearch()
Prepares the RFS_SEARCH component
for rendering. |
protected void |
prepareToWriteToolBar()
Prepares the Toolbar for rendering. |
TransformationInterface |
removeComponent(java.lang.String componentKey)
Removes a component from the CompositeComponentManager. |
TransformationInterface |
setComponent(java.lang.String componentKey,
TransformationInterface tbean)
Adds or sets a component to the list of components contained in the composite component. |
protected void |
setLocaleDependentProperties(java.util.Locale locale)
Sets the locale dependent properties. |
protected void |
setupDetailView()
Binds the sort model to the navigation model and the sort model to the search model and to the corresponding TableView components. |
void |
setupShowDescription(BaseCheckBox showDescComponent,
BaseFieldRenderer descColumnCellRenderer)
This method sets up the ShowDescription component so that the correct JavaScript method, sas_RemoteFileSelector_updateDescriptionDisplayStatus , is
executed when the CheckBox component is selected. |
protected void |
setupView(BaseTableView table,
BaseRemoteFileModelInterface model)
Bind the viewer and the model. |
void |
sort(BaseTableView table,
BaseRemoteFileModelInterface model,
java.lang.String sortColumnName,
int sortOrder)
The folders are sorted on top in ASCENDING order by default if a isFolder column exists. |
protected void |
writeContent(java.io.PrintWriter out)
Writes the transformation's main content which is everything except for the following: Opening container html element. |
Methods inherited from class com.sas.servlet.tbeans.remotefileselector2.BaseRemoteFileSelector |
---|
contentsChanged, getMode, getModel, isDetailViewVisibilityControlOn, setActionProvider, setDetailViewVisibilityControlOn, setMode, setModel |
Methods inherited from class com.sas.servlet.tbeans.BaseActionCompositeTransformation |
---|
applyTemplate, applyTemplate, dispose, getActionFilter, getActionSupportType, getComponentAction, getComponentActionType, getUniqueId, getViewerSupport, isActionVisible, listActionTypes, listAreaTypes, moveActionAttributesToComponent, setActionSupportType, setActionVisible, setComponent, setComponentActionType, setUniqueId, writeTemplate |
Methods inherited from class com.sas.servlet.tbeans.BaseCompositeTransformation |
---|
getActionProvider, getComponent, getComponents, getDefaultTemplate, getStyleInfo, getStyleMap, getTemplate, getTemplateDictionary, getTemplateFileName, getTemplateLocation, getVisibleComponents, isFlushEnabled, propertyChange, setCleanUpResourcesOn, setFlushEnabled, setId, setLocale, setRequest, setResponse, setStyleInfo, setTemplate, setTemplate, setTemplateDictionary, setTemplateFileName, setTemplateLocation |
Methods inherited from interface com.sas.servlet.tbeans.remotefileselector2.RemoteFileSelectorInterface |
---|
getMode, getModel |
Methods inherited from interface com.sas.servlet.tbeans.TransformationInterface |
---|
getCustomAttributes, getDescription, getId, getLocale, getName, getRequest, getResponse, getTagEpilog, getTagProlog, isVisible, setCustomAttributes, setDescription, setId, setLocale, setName, setRequest, setResponse, setTagEpilog, setTagProlog, setVisible, write, write, write |
Methods inherited from interface com.sas.actionprovider.HttpActionProviderViewInterface |
---|
getRequest, setRequest |
Methods inherited from interface com.sas.actionprovider.HttpActionProviderInterface |
---|
getActionProvider |
Field Detail |
---|
public static final java.lang.String RB_KEY
public static final java.lang.String SEARCH_RESULTS
public static final java.lang.String DEFAULT_TEMPLATE_FILE_NAME
RemoteFileSelector
component
composite.
BaseCompositeTransformation.setTemplateFileName(String)
,
BaseCompositeTransformation.getDefaultTemplate()
,
Constant Field Valuespublic static final java.lang.String SEARCH_FIELDS_TEMPLATE_FILE_NAME
RemoteFileSearch
component composite
if one is set on the RemoteFileSelector
component.
BaseCompositeTransformation.setTemplateFileName(String)
,
BaseCompositeTransformation.getDefaultTemplate()
,
Constant Field ValuesConstructor Detail |
---|
public RemoteFileSelector()
public RemoteFileSelector(RemoteFileNavigationModelInterface model)
There are five keys for components that are initialized for this component. The keys are as follows:
RFS_SEARCH
for the RemoteFileSearch component.RFS_TOOLBAR
for the RemoteFileToolBar component.RFS_SEARCH_DETAILVIEW
for the TableView component
containing the file data search results. This
key should not be set by the user of this
component. When an RFS_SEARCH component is
set then the DetailView associated with that
search facility is placed in this key. Therefor, a
custom search detail view should be set
on the RFS_SEARCH
component.RFS_FILE_DETAILVIEW
for the TableView component
containing the file data for the current directory
or path. This key is initially set to a
default TableView component. This key can
be set to a custom TableView.RFS_DETAILVIEW
for the TableView component
that contains the file data for the current
directory or the file data from a search.
This key is initially set to null. This
key changes depending on the
mode of the component. This key
should not be set by a user of this
component.
By default the template name is
RemoteFileSelector.html
.
This template file determines the
layout of the component
based on the placement of the
keys within some html.
The model must be assigned a value before the component can be successfully rendered. A null model value is allowed during initialization.
A default style map containing the following keys is set for the component during initialization:
model
- RemoteFileNavigationModelIntefaceRemoteFileSearch
public RemoteFileSelector(RemoteFileNavigationModelInterface model, java.util.Locale locale)
model
- RemoteFileNavigationModelInterface
instancelocale
- application localeRemoteFileSelector(RemoteFileNavigationModelInterface)
Method Detail |
---|
public TransformationInterface setComponent(java.lang.String componentKey, TransformationInterface tbean)
In addition this set component also performs initialization when certain keys are set. The RemoteFileSelectorInterface model is set on the RFS_TOOLBAR component when it is set. The SEARCH_FIELDS_TEMPLATE_FILE_NAME is set and the RFS_SEARCH_DETAILVIEW is set when a RFS_SEARCH component is set.
setComponent
in interface CompositeComponentInterface
setComponent
in class BaseCompositeTransformation
componentKey
- unique component keys.tbean
- Transformation Bean.
public TransformationInterface removeComponent(java.lang.String componentKey)
When the RFS_SEARCH
component is removed
then the RFS_SEARCH_DETAILVIEW
component is also removed.
There is no longer a need for this TableView
.
removeComponent
in interface CompositeComponentInterface
removeComponent
in class BaseCompositeTransformation
TransformationInerface
- object
protected void prepareToWriteToolBar()
protected void prepareToWriteSearch()
RFS_SEARCH
component
for rendering. By default a Search component
is not set.
BaseActionCompositeTransformation2.write(java.io.PrintWriter)
protected void prepareToWriteDetailView()
BaseRemoteFileSelector.setDetailViewVisibilityControlOn(boolean)
method.
BaseRemoteFileSelector.setDetailViewVisibilityControlOn(boolean)
public void postConstructionSetup()
setupDetailView()
method is called to bind the
SortableTableModelAdapter
to the model of the
RemoteFileSelector
component
and to the detail view.
protected void setupDetailView()
setupView
method in order to do the
necessary binding.
A search component does
not have to exists but
the detail view for the
navigation model must
exists for the
RemoteFileSelector to
render as expected.
out
- The output streamsetupView(com.sas.servlet.tbeans.tableview.BaseTableView, com.sas.swing.models.remotefileselector2.BaseRemoteFileModelInterface)
protected void setupView(BaseTableView table, BaseRemoteFileModelInterface model)
RFSSortableTableModelAdapter
.
This method is executed only one time for each viewer. Therefore this is a good method to override to add tasks that need to be performed one time once the viewer and the models are bound together.
table
- detailViewComponent
or
searchResultsViewComponent
that will
make use of the RemoteFileServerModelInterface
instancemodel
- model instance that will be attached to the
detailViewComponent
or
searchResultsViewComponent
setupDetailView()
public void setupShowDescription(BaseCheckBox showDescComponent, BaseFieldRenderer descColumnCellRenderer)
sas_RemoteFileSelector_updateDescriptionDisplayStatus
, is
executed when the CheckBox
component is selected. The
onClick
event is setup for the component.
The display status for the description column is updated based on whether the
CheckBox
component is selected or not. If the CheckBox
is selected then the
display status of the description column is set to block
otherwise it is
set to none
.
showDescComponent
- BaseCheckBox component that requires the onClick action setupdescColumnCellRenderer
- BaseFieldRenderer used to write out the descriptionpublic void sort(BaseTableView table, BaseRemoteFileModelInterface model, java.lang.String sortColumnName, int sortOrder)
isFolder
column exists. If a NAME
column exists then it is used as a third sort column.
Therefore each column is sorted by the sort column,
the isFolder column and by the Name column.
if the isFolder
column does not
exists then an alphabetical sort
is performed on the items.
table
- viewer with a
SortableTableModelAdapter bound to itmodel
- model containing data for sortingsortColumnName
- Column for primary sortprotected BaseRemoteFileToolBar createDefaultToolBar()
protected BaseRemoteFileToolBar createDefaultToolBar(java.util.Locale locale)
protected BaseTableView createDefaultFileDetailView()
protected void setLocaleDependentProperties(java.util.Locale locale)
BaseTransformation
setLocaleDependentProperties
in class BaseTransformation
protected void writeContent(java.io.PrintWriter out) throws java.io.IOException
BaseActionCompositeTransformation2
writeContent
in class com.sas.servlet.tbeans.BaseActionCompositeTransformation2
java.io.IOException
BaseActionCompositeTransformation2.write(PrintWriter)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |