Author: ozeigermann
Date: Sat Apr 21 15:56:37 2007
New Revision: 531124
URL: http://svn.apache.org/viewvc?view=rev&rev=531124
Log:
Owner, creation user, and modification user now can be
set to a default.
Modified:
jakarta/slide/trunk/wck/src/org/apache/slide/simple/store/WebdavStoreAdapter.java
Modified:
jakarta/slide/trunk/wck/src/org/apache/slide/simple/store/WebdavStoreAdapter.java
URL:
http://svn.apache.org/viewvc/jakarta/slide/trunk/wck/src/org/apache/slide/simple/store/WebdavStoreAdapter.java?view=diff&rev=531124&r1=531123&r2=531124
==============================================================================
---
jakarta/slide/trunk/wck/src/org/apache/slide/simple/store/WebdavStoreAdapter.java
(original)
+++
jakarta/slide/trunk/wck/src/org/apache/slide/simple/store/WebdavStoreAdapter.java
Sat Apr 21 15:56:37 2007
@@ -118,6 +118,7 @@
protected static final String CALLBACK_PARAMETER = "callback-store";
protected static final String CALLBACK_FACTORY_PARAMETER =
"callback-factory";
+ protected static final String DEFAULT_USER_PARAMETER = "default-user";
protected static final String PROPERTIES_PARAMETER = "store-properties";
@@ -144,7 +145,7 @@
protected BasicWebdavStoreFactory storeFactory;
protected boolean isCopySupported, isMoveSupported, isDeleteSupported;
-
+
// ==== Service Methods ================================
public void setParameters(Hashtable parameters) throws
ServiceParameterErrorException,
@@ -540,6 +541,8 @@
protected Object connection;
protected boolean authenticated = false;
+
+ protected String defaultUser = null;
TransactionId(Xid xid, Service service, Principal principal,
BasicWebdavStoreFactory storeFactory, Hashtable parameters)
throws ServiceAccessException {
@@ -566,6 +569,8 @@
throw new ServiceAccessException(service, e);
}
+ defaultUser = (String) parameters.get(DEFAULT_USER_PARAMETER);
+
openConnection();
toBeCreated = new HashSet();
@@ -840,6 +845,18 @@
if (!descriptor.exists(NodeRevisionDescriptor.NAME)) {
descriptor.setName(fileName);
+ }
+
+ if (defaultUser != null) {
+ if
(!descriptor.exists(NodeRevisionDescriptor.CREATION_USER)) {
+ descriptor.setCreationUser(defaultUser);
+ }
+ if
(!descriptor.exists(NodeRevisionDescriptor.OWNER)) {
+ descriptor.setOwner(defaultUser);
+ }
+ if
(!descriptor.exists(NodeRevisionDescriptor.MODIFICATION_USER)) {
+ descriptor.setModificationUser(defaultUser);
+ }
}
Date creationDate =
store.getCreationDate(uri.toString());
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]