com.sas.services.information.DAVRepository
The DAV Repository is a single persistent store for information used by
client applications. It interfaces to a webDAV server to add, retrieve and
update data. Repositories are defined in the Information Service configuration metadata (see
example at the end).
To use a DAV repository, the Information Service must be able to connect to the repository. This can be done in a number of different ways.
<ReposDef name="Test" protocol="DAV" host="host" port="8100" base="davdir" domain="dept3" auto="true"/> |
autoconnect
for this repository<ReposDef name="Test" protocol="DAV" host="host" port="8100" base="davdir" domain="dept3" auto="false"/> |
autoconnect=Test
connectByName(UserContext, String)
method is used to explicitly connect to the repository.RepositoryInterface r = is.connectByName(userContext, "Test"); |
connect(UserContext, RepositoryDef)
methodRepositoryDef rdef = new ReposistoryDef("host", "8100", "dept3", "davdir", "DAV"); |
proxy
attribute for a proxy server
<ReposDef name="Test" protocol="DAV" host="host" port="8100" base="davdir" domain="dept3" auto="false" proxy="http://proxyHost:proxyPort"/> |
setProxy
method on the RepositoryDef object
RepositoryDef rdef = new ReposistoryDef("host", "8100", "dept3", "davdir", "DAV"); |
issecure
property
<ReposDef name="Test" protocol="DAV" host="host" port="8100" base="davdir" domain="dept3" auto="false" issecure="true"/> |
setIsSecure
method on the RepositoryDef object
RepositoryDef rdef = new ReposistoryDef("host", "8100", "dept3", "davdir", "DAV"); |
base
parameter.Example 1.
Let http://www.foo.com
be
an Apache2 web server, in which we have defined "Dav On" for the /davdir path. So, the url http://www.foo.com/davdir/ is the base
DAV enabled URL. This information would break down as follows:
host | www.foo.com |
port | 80 |
base | davdir |
Example 2.
Let http://www.foo.com:8080
is the URL for Slide server. The location for content storage in Slide would then be
http://www.foo.com/slide/files
and this would break down as follows:
host www.foo.com port 8080 base slide/files
DAVRepository is not a primary authentication repository and so the credential information must be located in the SAS Metadata Server
or an LDAP repository. For the SAS Metadata Server, make sure that you have a login defined for the domain in which the repository is
defined. For LDAP define a saslogin entry using the correct values for sasallowedclientdn, sasdomainname, sasloginname and sasuserpassword.
dn: saslogincn=DAVLogin,cn=saslogins,sasComponent=sasServer,cn=SAS,o=SAS Institute,c=US
sasloginname: joe
sasallowedclientdn: cn=Joe Smith,ou=People,o=SAS Institute,c=US
sasuserpassword: smith
sasreferencedn: cn=Joe Smith,ou=People,o=SAS Institute,c=US
sasminavail: 1
sasminsize: 1
objectclass: saslogin
sasdomainname: dept3
saslogincn: DAVLogin
saslogicalname: DAVLogical
description: Login to DAV server
{http://www.sas.com/rnd/itech/WebDAV}type=report
. The factory will automatically creates instances of DAVReport
for items with this type in the repository. (If the type had been "textreport" we would have had a DAVTextreport class).
Subclass DAVItem and change the object type to "report". This is all that is required for the factory to manufacture DAVReport items. Now new methods can be added to this class or to the smart object that will be based on this class.
Define additional properties to be stored with a report. All these properties should be associated with
a namespace. Define a new namespace if one is required.
public static final String NS_WEBDAV_REPORT_URI = "http://example.org/xml/namespace/webdav.report-1.1";
|
Now, one can go ahead and define a smart (metadata) object for reports. In order for the smart object to be returned from the repository, its type must be defined in the Information Service configuration metadata. Add the Type element for Report to the Factory element.
|
Now implement the functionality of the Report class. As this class represents content, we have subclassed the Content class. Functionality added to the class will delegate to the repository entity for repository specific operations.
|
In some circumstances, it is necessary to have an administrator or super user to create user collections and
assign the correct access control lists to these collections. The admin user and password can be set through
the use of system properties. sysadmin.reposName
and sysadminpw.reposName
are the
properties from which the administrator's userid and password will be obtained for the repository with name
reposName
. If these properties do not exist, sysadmin.dav
and sysadminpw.dav
will be used. If none of these properties are set, then the user collection creation and ACL settings are
attempted with the principal making the request.
Here is an example of how a resource in the DAV store is brought into the Information Service.
The "type" property (actually this a SAS defined property in the "http://www.sas.com/rnd/itech/WebDAV" namespace) is used to determine the type or class of the entry in the store. If there isn't a type property or a corresponding class for this type cannot be found, then a default entity type will be used - DAVFolder for collections and DAVItem for non-collection resources.
The next stage uses the configuration metadata provided for the Information Service. This can be used to determine which class is instantiated to represent the smart object for the item in the store. Again, if there is no mapping (or a false mapping), then defaults are used - Folder for collections and Content for non-collection resources.
It makes sense that classes mapped for collections are subclasses of Folder, and classes mapped for non-collection resources are subclasses of Content. They can be direct or indirect subclasses.
Classes mentioned above are shortcuts for the following fully qualified class names: