jakarta-slide-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jakarta-slide-...@apache.org
Subject [Jakarta-Slide Wiki] Updated: WebDavConstructionKit
Date Wed, 16 Feb 2005 01:29:39 GMT
   Date: 2005-02-15T17:29:39
   Editor: BrianLee
   Wiki: Jakarta-Slide Wiki
   Page: WebDavConstructionKit
   URL: http://wiki.apache.org/jakarta-slide/WebDavConstructionKit

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -10,6 +10,8 @@
 
 [http://jakarta.apache.org/slide/wck/javadoc/index.html API]
 
+''Feel free to make additions or corrections''
+
 WckQuickStart
 
 ==== Notes ====
@@ -22,9 +24,11 @@
 
 ===== Servlet Container and App Server Setup =====
 
-WckTomcat - This has detailed information on setting up Tomcat 5 with WCK.
+Depending on your familiarity with the application server, this section can either be easy
or very difficult. Hopefully, this information will ease some of the pain.
+
+WckTomcat - This has information on setting up Tomcat 5 with WCK.
 
-WckJetty - This has detailed information on setting up Jetty with WCK.
+WckJetty - This has information on setting up Jetty 5 with WCK.
 
 ''If you have successfully used Slide with JBoss, any other servlet container, or application
server, please post some information it does not have to be formal and neat - anything is
better than nothing''.
 
@@ -73,15 +77,43 @@
 You need to implement the following functions.
 
  '''1.getAuthenticationSession (2x one with user/password one with user only):''' asks if
a certain user exists and authenticated itself correctly and if so an object that allows access
to your system, i.e. a session or connection or anything similiar, is passed back; in case
the user has already authenticated correctly before only the user with no password is passed
+
+Here is an example:
+{{{
+    public Object getAuthenticationSession(String loginId, String password)
+    {
+        String cansasSession = null;
+        fakeMap.put(loginId, cansasSession);
+
+        /*
+         * make calls to your user database with your custom Data Access Object class and
return the userid
+         */
+        UserDAO userDAO = new UserDAO();
+        UserBean userBean = userDAO.getUser(loginId);
+
+        /* ensures that the given password matches what is stored in the database */
+        if (userBean == null || !StringUtil.isEqual(password, userBean.getPassword()))
+        {
+            /*failed authentication*/
+            return null;
+        }
+        else
+        {
+            /*ex brian:123456*/
+            cansasSession = userBean.getUserId() + StringUtil.COLON + userBean.getPassword();
+        }
+
+        return cansasSession;
+    }
+}}}
  
  '''2.closeAuthenticationSession:''' closes the session / terminates the connection to your
system
 
 ===== Interface Related to Connection Pool Management =====
 
-[http://jakarta.apache.org/slide/wck/javadoc/org/apache/slide/simple/authentication/AbstractPoolingConnectionManager.html
org.apache.slide.simple.authentication.AbstractPoolingConnectionManager] is a connection pool
framework.
+[http://jakarta.apache.org/slide/wck/javadoc/org/apache/slide/simple/authentication/AbstractPoolingConnectionManager.html
org.apache.slide.simple.authentication.AbstractPoolingConnectionManager] is a connection pool
framework. You do not need to create an implementation of this class. You can easily use your
app server's connection pool features and simply put the calls in other classes called by
your custom store class.
 
-
-You need to implement the following functions.
+However, if you do decide to implement a connection manager based on Slide code, you need
to implement the following functions.
 
  '''1.closePhysicalConnection:''' Closes a physical connection
 
@@ -114,13 +146,13 @@
 <nodestore classname="org.apache.slide.store.simple.WebdavStoreAdapter">
 }}}
 
-First the nodestore class reference must be changed to the above WebdavStoreAdapter
+First the nodestore class reference must be changed to the above WebdavStoreAdapter class.
This class will deal with most of Slide's extra calls that deal with locking, and so on.
 
 {{{
 <parameter name="callback-store">org.apache.slide.store.simple.WebdavFileStore</parameter>
 }}}
 
-The "callback-store" parameter value must point to your WebdavFileStore implementation (remember
your class must implement the BasicWebdavStore interface - as shown above). Here it points
to the given WebdavFileStore example.
+The "callback-store" parameter value must point to your WebdavFileStore implementation (remember
your class must implement the BasicWebdavStore interface - as shown above). Here the given
WebdavFileStore reference store implementation. It is recommended that you analyze it.
 
 ==== Overring the slide.properties file ====
 
@@ -130,20 +162,4 @@
 
 ''Posted by Alessandro Apostoli to the Slide user list''
 
-I have a static Map to hold the lockids to be returned
-by getLockInfo(). Every call to lockObject() generates
-an exclusive lock on my proprietary system and stores
-the pair (uri,lockId) in the map for later retrieval, this for
-webdav locks only.
-Each call to getLockInfo() first checks if there is a lock
-in the proprietary system and if not it returns a SimpleLock[0]
-If  the resource is locked it has to determine if it was locked
-via webdav or via proprietary interface so it checks if there's an
-entry in the map for that lock. If so it returns it, if there's no entry
-in the map and the resource is locked it has to generate a valid
-lockId, store it in the map for subsequent calls to getLockInfo()
-and return it. My system supports only one lock per resource so
-the key in my map is the uri, I also used the uri to generate the
-lockId string with a call to DigestUtils.md5Hex(uri).
-As one might  expect a call to unlockObject() removes the entry
-from the map and unlocks the resource.
+I have a static Map to hold the lockids to be returned by getLockInfo(). Every call to lockObject()
generates an exclusive lock on my proprietary system and stores the pair (uri,lockId) in the
map for later retrieval, this for webdav locks only. Each call to getLockInfo() first checks
if there is a lock in the proprietary system and if not it returns a SimpleLock[0] If  the
resource is locked it has to determine if it was locked via webdav or via proprietary interface
so it checks if there's an entry in the map for that lock. If so it returns it, if there's
no entry in the map and the resource is locked it has to generate a valid lockId, store it
in the map for subsequent calls to getLockInfo() and return it. My system supports only one
lock per resource so the key in my map is the uri, I also used the uri to generate the lockId
string with a call to DigestUtils.md5Hex(uri). As one might  expect a call to unlockObject()
removes the entry from the map and unlocks the resource.

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Mime
View raw message