com.sas.swing.models.remotefileselector2.informationservices
Class BaseInformationServicesModel

com.sas.swing.models.remotefileselector2.informationservices.BaseInformationServicesModel
All Implemented Interfaces:
com.sas.swing.models.remotefileselector2.informationservices.IncludeSystemFoldersInterface, com.sas.swing.models.remotefileselector2.LocaleDataInterface, com.sas.swing.models.remotefileselector2.MutableFileFilterInterface, com.sas.swing.models.remotefileselector2.RemoteFileModelDirectoriesOnlyInterface, java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
InformationServicesNavigationModel, InformationServicesSearchModel

public abstract class BaseInformationServicesModel
implements com.sas.swing.models.remotefileselector2.informationservices.IncludeSystemFoldersInterface, com.sas.swing.models.remotefileselector2.LocaleDataInterface

BaseInformationServicesModel provides common methods that talk to the Information Services structure.

Since:
9.1.4
See Also:
Serialized Form

Field Summary
protected  boolean allowNewFoldersInRootFolder
           
protected static java.lang.String CHOOSE_REPORT_METADATA_TEMPLATE
           
protected static java.lang.String FOLDER_TYPE
           
protected static java.lang.String FOLDER_TYPE_AND_SLASH
           
protected  java.lang.String folderLocalizedType
           
static java.lang.String FOLDERTYPE_FOLDER
           
static java.lang.String FOLDERTYPE_MYFOLDER
           
static java.lang.String FOLDERTYPE_ROOTFOLDER
           
static java.lang.String FOLDERTYPE_WEBDAVFOLDER
           
protected  boolean includeSystemFolders
           
protected  boolean isPathUrl
           
protected static java.lang.String LOAD_ROOT_FOLDER_TEMPLATE
           
protected  java.util.List locations
           
protected  int locationsCurrentPathIndex
           
protected  com.sas.util.log.CommonLoggerInterface log
           
static java.lang.String MY_FOLDER
           
protected  java.lang.Object myFolderLocationUrl
           
protected  java.lang.String myFolderName
           
protected  com.sas.swing.models.remotefileselector2.LocationNode myFolderNode
           
protected  com.sas.services.information.RepositoryInterface navigatingRepository
           
static java.lang.String PACKAGE
           
static java.lang.String RB_KEY
          the resource key string
protected  com.sas.services.information.RepositoryInterface repository
           
protected  com.sas.services.information.RepositoryInterface repositoryForFilteringRootFolders
           
protected  java.util.List reposList
           
protected  com.sas.services.information.metadata.FolderInterface rootFolder
           
protected  java.lang.String[][] rootFolderInfo
           
protected  java.lang.String rootFolderLocation
           
protected  java.lang.String rootFolderName
           
protected  java.util.List rootLocations
           
protected static java.lang.String SBIP
           
protected  com.sas.services.information.ServerInterface server
           
protected static java.lang.String SLASH
           
static java.lang.String SYSTEM_FOLDER_TYPE
          Defines the metadata value for the folder type of a "system" folder
protected  com.sas.services.information.publicobject.TypeDescriptorInterface typeDescriptor
           
protected  com.sas.services.information.metadata.FolderInterface userHomeFolder
           
protected  java.lang.String[][] userHomeFolderInfo
           
protected  java.lang.String userHomeFolderName
           
protected  java.util.List webDavReposList
           
protected  java.util.List webDavReposNames
           
 
Fields inherited from class com.sas.swing.models.remotefileselector2.BaseRemoteFileServerModel
currentPath, directoriesOnly, filterValues, infoList, modelNeedsRefresh, readingFromCache, rootLocation, showDirectoriesOnly, spcs, tableEditable
 
Constructor Summary
BaseInformationServicesModel(com.sas.services.information.RepositoryInterface repository)
          Deprecated. use constructor for the ServerInterface
BaseInformationServicesModel(com.sas.services.user.UserContextInterface user)
          Deprecated. use constructor for the ServerInterface
 
Method Summary
 java.lang.String combinePathAndFileName(java.lang.String path, java.lang.String name)
          Concatenates a path and a folder name.
protected  java.util.List createMetadataItems(java.util.List itemList)
          Creates metadata items that are used to store the various pieces of data retrieved from the Information Service.
protected  java.util.List createMetadataPackageItems(com.sas.services.publish.EntryInterface[] packageItemList)
           
protected  java.util.List createRepositoryNodeMetadataItems(java.util.List listOfRepositories)
          Creates metadata items that are used to store the various pieces of data retrieved from the Information Service.
protected  boolean filterData(com.sas.services.information.browse.BrowseMetadataInterface item)
          The method that does the actual filtering of metadata items.
protected  boolean filterPackageData(com.sas.services.publish.EntryInterface element)
           
 int getColumnCount()
          Returns the number of columns available.
 int getColumnIndex(java.lang.String column)
          A utility method that returns a column index as defined by the column name constants defined in this interface.
protected  com.sas.services.information.metadata.FolderInterface getCurrentFolder(java.lang.String path)
          Returns a folder item for the specified path/
 com.sas.services.information.RepositoryInterface getCurrentRepository(com.sas.services.information.metadata.PathUrl pathUrl)
          Returns the repository associated with the PathUrl passed into the method.
 java.lang.String getDirectoryPath(java.lang.String path)
          Returns the directory path from the Path Url
 java.util.Locale getLocale()
          Returns the locale setting of the model.
 com.sas.services.information.RepositoryInterface getRepository()
          Deprecated. use getUserContext
 java.util.List getRepositoryList()
          Returns the list of repositories that have been set.
 java.lang.String getRepositoryRootLocation()
           
 java.lang.String getServerName()
          Returns a name used to identify the top level in the view.
 com.sas.services.user.UserContextInterface getUserContext()
          Returns the currently set UserContextInterface.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Given a row and column index, this method returns the item from the data.
protected  void initialize()
           
 boolean isUpwardPathRestricted()
          Returns true if the model's current path is at the topmost path of the current server, false otherwise.
protected  boolean isValidURL(java.lang.String SBIPUrl)
           
 java.lang.String[][] parseIntoFoldersAndLocations(java.lang.String path)
          A utility method that returns an array containing the the directory path, representing the element's location, and the individual folder elements.
 void setLocale(java.util.Locale loc)
          Set the Locale for the model.
 void setRepository(com.sas.services.information.RepositoryInterface repository)
          Deprecated. use setUserContext
 void setUserContext(com.sas.services.user.UserContextInterface user)
          Allows the setting of a new UserContextInterface by the user.
 java.lang.String[] splitPathAndFileName(java.lang.String path)
          Parses a given path into the parent folder and the file name.
protected  java.util.List updateLocations(java.lang.String path)
          Method returns a list of Location objects.
 
Methods inherited from class com.sas.swing.models.remotefileselector2.BaseRemoteFileServerModel
addToPasteBuffer, cancelLoadFileInfo, clearPasteBuffer, getBasePath, getFileInfo, getLocation, getNodeAt, getPasteBuffer, getPasteBufferCommandType, getRowCount, isRefreshNeeded, isTableEditable, setPasteBufferCommandType, setRefreshNeeded, setTableEditable
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
the resource key string

See Also:
Constant Field Values

FOLDERTYPE_MYFOLDER

public static final java.lang.String FOLDERTYPE_MYFOLDER
See Also:
Constant Field Values

FOLDERTYPE_FOLDER

public static final java.lang.String FOLDERTYPE_FOLDER
See Also:
Constant Field Values

FOLDERTYPE_ROOTFOLDER

public static final java.lang.String FOLDERTYPE_ROOTFOLDER
See Also:
Constant Field Values

FOLDERTYPE_WEBDAVFOLDER

public static final java.lang.String FOLDERTYPE_WEBDAVFOLDER
See Also:
Constant Field Values

PACKAGE

public static final java.lang.String PACKAGE
See Also:
Constant Field Values

SYSTEM_FOLDER_TYPE

public static final java.lang.String SYSTEM_FOLDER_TYPE
Defines the metadata value for the folder type of a "system" folder

See Also:
Constant Field Values

CHOOSE_REPORT_METADATA_TEMPLATE

protected static final java.lang.String CHOOSE_REPORT_METADATA_TEMPLATE
See Also:
Constant Field Values

LOAD_ROOT_FOLDER_TEMPLATE

protected static final java.lang.String LOAD_ROOT_FOLDER_TEMPLATE
See Also:
Constant Field Values

repository

protected com.sas.services.information.RepositoryInterface repository

navigatingRepository

protected com.sas.services.information.RepositoryInterface navigatingRepository

reposList

protected java.util.List reposList

isPathUrl

protected boolean isPathUrl

server

protected com.sas.services.information.ServerInterface server

SBIP

protected static final java.lang.String SBIP
See Also:
Constant Field Values

FOLDER_TYPE

protected static final java.lang.String FOLDER_TYPE
See Also:
Constant Field Values

FOLDER_TYPE_AND_SLASH

protected static final java.lang.String FOLDER_TYPE_AND_SLASH
See Also:
Constant Field Values

MY_FOLDER

public static final java.lang.String MY_FOLDER
See Also:
Constant Field Values

SLASH

protected static final java.lang.String SLASH
See Also:
Constant Field Values

webDavReposList

protected java.util.List webDavReposList

webDavReposNames

protected java.util.List webDavReposNames

rootLocations

protected java.util.List rootLocations

locations

protected java.util.List locations

userHomeFolder

protected com.sas.services.information.metadata.FolderInterface userHomeFolder

userHomeFolderName

protected java.lang.String userHomeFolderName

userHomeFolderInfo

protected java.lang.String[][] userHomeFolderInfo

rootFolder

protected com.sas.services.information.metadata.FolderInterface rootFolder

rootFolderName

protected java.lang.String rootFolderName

rootFolderLocation

protected java.lang.String rootFolderLocation

rootFolderInfo

protected java.lang.String[][] rootFolderInfo

locationsCurrentPathIndex

protected int locationsCurrentPathIndex

typeDescriptor

protected com.sas.services.information.publicobject.TypeDescriptorInterface typeDescriptor

log

protected com.sas.util.log.CommonLoggerInterface log

allowNewFoldersInRootFolder

protected boolean allowNewFoldersInRootFolder

myFolderNode

protected com.sas.swing.models.remotefileselector2.LocationNode myFolderNode

myFolderName

protected java.lang.String myFolderName

myFolderLocationUrl

protected java.lang.Object myFolderLocationUrl

includeSystemFolders

protected boolean includeSystemFolders

repositoryForFilteringRootFolders

protected com.sas.services.information.RepositoryInterface repositoryForFilteringRootFolders

folderLocalizedType

protected java.lang.String folderLocalizedType
Constructor Detail

BaseInformationServicesModel

public BaseInformationServicesModel(com.sas.services.information.RepositoryInterface repository)
Deprecated. use constructor for the ServerInterface

Constructor used when a repository is being used to provide the connection to the data.

Parameters:
repository - the repository

BaseInformationServicesModel

public BaseInformationServicesModel(com.sas.services.user.UserContextInterface user)
Deprecated. use constructor for the ServerInterface

Allows specification of a UserContext to communicate with the file system. The UserContext is used to obtain the ServerInterface.

Parameters:
user - the UserContext class
Method Detail

initialize

protected void initialize()

getColumnIndex

public int getColumnIndex(java.lang.String column)
A utility method that returns a column index as defined by the column name constants defined in this interface.

Parameters:
column - the column name constant
Returns:
the column index associated with the specified constant

getColumnCount

public int getColumnCount()
Returns the number of columns available.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
the numder of columns

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Given a row and column index, this method returns the item from the data.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
the - row index
the - column index
Returns:
the object indexed by the specified row and column

createMetadataItems

protected java.util.List createMetadataItems(java.util.List itemList)
Creates metadata items that are used to store the various pieces of data retrieved from the Information Service.

Parameters:
itemList - a list of BrowseMetadataInterface instances
Returns:
a list of InformationServicesFileMetadata objects that contain Information Services data for the node or item

createMetadataPackageItems

protected java.util.List createMetadataPackageItems(com.sas.services.publish.EntryInterface[] packageItemList)

filterPackageData

protected boolean filterPackageData(com.sas.services.publish.EntryInterface element)

createRepositoryNodeMetadataItems

protected java.util.List createRepositoryNodeMetadataItems(java.util.List listOfRepositories)
Creates metadata items that are used to store the various pieces of data retrieved from the Information Service.

Parameters:
listOfRepositories - a list of RepositoryInterface objects
Returns:
a list of InformationServicesFileMetadata objects that contain Information Services data for the node or item

updateLocations

protected java.util.List updateLocations(java.lang.String path)
Method returns a list of Location objects. The Location objects contain a list of LocationNode objects. The LocationNode objects represent a directory or folder part of the path. Therefore, for each directory represented in a path there is a LocationNode. The nodes are part of a list where the first item in the list is the root directory and the last item in the list is the current directory.

Each Location object represents a root path that can be navigated by the selector.

This method is specifically used when a ServerInterface instance is specified.

Parameters:
path -
Returns:
List of Location objects

isValidURL

protected boolean isValidURL(java.lang.String SBIPUrl)

parseIntoFoldersAndLocations

public java.lang.String[][] parseIntoFoldersAndLocations(java.lang.String path)
A utility method that returns an array containing the the directory path, representing the element's location, and the individual folder elements. The folder item [0] contains the remaining path. The item[1] has the last folder.

Parameters:
path - the path to be parsed
Returns:
a two dimensional array containing the directory location and the individual element

splitPathAndFileName

public java.lang.String[] splitPathAndFileName(java.lang.String path)
Parses a given path into the parent folder and the file name.

Parameters:
path - the path to be parsed
Returns:
the file and parent folder

combinePathAndFileName

public java.lang.String combinePathAndFileName(java.lang.String path,
                                               java.lang.String name)
Concatenates a path and a folder name.

Parameters:
path - the parent path
name - the folder name to be appended
Returns:
the concatenated path

getRepositoryRootLocation

public java.lang.String getRepositoryRootLocation()

getCurrentRepository

public com.sas.services.information.RepositoryInterface getCurrentRepository(com.sas.services.information.metadata.PathUrl pathUrl)
Returns the repository associated with the PathUrl passed into the method.

Parameters:
pathUrl - path of current node
Returns:
RepositoryInterface instance representing the repository where the metadataitems exists that will be displayed

isUpwardPathRestricted

public boolean isUpwardPathRestricted()
Returns true if the model's current path is at the topmost path of the current server, false otherwise. Those consuming this model should call this method before moving upwards in the file system.

Returns:
returns true if the current path is the topmost path of the current server

getServerName

public java.lang.String getServerName()
Returns a name used to identify the top level in the view.

Returns:
the display name of the top level

getDirectoryPath

public java.lang.String getDirectoryPath(java.lang.String path)
Returns the directory path from the Path Url

Parameters:
the - Path Url
Returns:

getCurrentFolder

protected com.sas.services.information.metadata.FolderInterface getCurrentFolder(java.lang.String path)
Returns a folder item for the specified path/

Parameters:
path - a path in the SBIP URL form
Returns:
the folder corresponding to the path

filterData

protected boolean filterData(com.sas.services.information.browse.BrowseMetadataInterface item)
The method that does the actual filtering of metadata items. By default this method filters on Transformations and Trees. Filtering on other metadata types may require an override of this method.

Parameters:
item - the metadata item to be filtered
Returns:
returns true if the item meets the filtering criteria

setRepository

public void setRepository(com.sas.services.information.RepositoryInterface repository)
Deprecated. use setUserContext

Allows the setting of a new repository by the user. The modelNeedsRefresh flag is set to true.

Parameters:
repository - the new repository

getRepository

public com.sas.services.information.RepositoryInterface getRepository()
Deprecated. use getUserContext

Returns the currently set repository.

Returns:
the currently set repository

getRepositoryList

public java.util.List getRepositoryList()
Returns the list of repositories that have been set.

Returns:
a list of RepositoryInterface objects

setUserContext

public void setUserContext(com.sas.services.user.UserContextInterface user)
Allows the setting of a new UserContextInterface by the user. The modelNeedsRefresh flag is set to true.

Parameters:
user - the new UserContextInterface

getUserContext

public com.sas.services.user.UserContextInterface getUserContext()
Returns the currently set UserContextInterface. This value could be null if one has not been set by the user.

Returns:

setLocale

public void setLocale(java.util.Locale loc)
Set the Locale for the model. When the root value of Information Services is displayed then a locale is necessary.

By default the Locale will be set on the model using the value set on the viewer. If the Locale is updated on the viewer then the Locale is updated on the model.

Specified by:
setLocale in interface com.sas.swing.models.remotefileselector2.LocaleDataInterface
Parameters:
loc - Locale

getLocale

public java.util.Locale getLocale()
Returns the locale setting of the model. If a locale has not been set on the model then null is returned for the value.

Returns:
Locale



Copyright © 2009 SAS Institute Inc. All Rights Reserved.