Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

svn commit: r191734 - in /lenya/trunk/src: java/org/apache/lenya/cms/reposi: msg#00237

cms.lenya.cvs

Subject: svn commit: r191734 - in /lenya/trunk/src: java/org/apache/lenya/cms/repository/ java/org/apache/lenya/cms/usecase/ java/org/apache/lenya/transaction/ webapp/lenya/pubs/default/lenya/usecases/webdav/

Author: chestnut
Date: Tue Jun 21 15:03:52 2005
New Revision: 191734

URL: http://svn.apache.org/viewcvs?rev=191734&view=rev
Log:
fixed problem of not allowing owner of lock on objects to lock again

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java
lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java
lenya/trunk/src/java/org/apache/lenya/transaction/Versionable.java
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap

Modified: lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java?rev=191734&r1=191733&r2=191734&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java Tue
Jun 21 15:03:52 2005
@@ -40,6 +40,7 @@
import org.apache.lenya.transaction.IdentityMap;
import org.apache.lenya.transaction.Lock;
import org.apache.lenya.transaction.TransactionException;
+import org.apache.lenya.cms.rc.RCMLEntry;

/**
* A repository node.
@@ -114,6 +115,25 @@
}

/**
+ * @see org.apache.lenya.transaction.Transactionable#canCheckOut()
+ */
+ public boolean canCheckOut() throws TransactionException {
+ try {
+ RCMLEntry entry =
getRevisionController().getRCML(getRCPath()).getLatestEntry();
+ if(!isCheckedOut())
+ return true;
+ else if(entry.getIdentity().equals(getUserId()))
+ return true;
+ else
+ return false;
+ } catch (TransactionException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new TransactionException(e);
+ }
+ }
+
+ /**
* @see org.apache.lenya.transaction.Transactionable#checkout()
*/
public void checkout() throws TransactionException {
@@ -286,8 +306,8 @@
* @see org.apache.lenya.transaction.Transactionable#lock()
*/
public void lock() throws TransactionException {
- if (isCheckedOut()) {
- throw new TransactionException("Cannot lock [" + this + "]: node
is checked out.");
+ if (!canCheckOut()) {
+ throw new TransactionException("Cannot lock [" + this + "]: node is
checked out.");
}
if (getLogger().isDebugEnabled()) {
getLogger().debug("Locking [" + this + "]");

Modified: lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java?rev=191734&r1=191733&r2=191734&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/usecase/AbstractUsecase.java Tue
Jun 21 15:03:52 2005
@@ -642,8 +642,8 @@
boolean canExecute = true;

for (int i = 0; i < objects.length; i++) {
- if (objects[i].isCheckedOut()) {
- if (getLogger().isDebugEnabled())
+ if(!objects[i].canCheckOut()) {
+ if (getLogger().isDebugEnabled())
getLogger()
.debug("AbstractUsecase::lockInvolvedObjects()
can not execute, object ["
+ objects[i] + "] is already checked
out");

Modified: lenya/trunk/src/java/org/apache/lenya/transaction/Versionable.java
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/transaction/Versionable.java?rev=191734&r1=191733&r2=191734&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/transaction/Versionable.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/transaction/Versionable.java Tue Jun
21 15:03:52 2005
@@ -19,7 +19,7 @@
/**
* A versionable object.
*
- * @version $Id:$
+ * @version $Id$
*/
public interface Versionable extends Lockable {

@@ -40,6 +40,12 @@
* @throws TransactionException if an error occurs.
*/
boolean isCheckedOut() throws TransactionException;
+
+ /**
+ * @return if the object can be checked out
+ * @throws TransactionException if an error occurs.
+ */
+ boolean canCheckOut() throws TransactionException;

/**
* Checks if the object has been changed since it has been locked.

Modified:
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap?rev=191734&r1=191733&r2=191734&view=diff
==============================================================================
---
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap
(original)
+++
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap
Tue Jun 21 15:03:52 2005
@@ -222,10 +222,6 @@
</map:match>

<map:match pattern="PUT/**_*.html">
- <!--fixme: Have to checkin or we get "can not lock error" trying to
put when file is already checked out-->
- <map:act type="reserved-checkin">
- <map:call function="put" />
- </map:act>
<map:call function="put" />
</map:match>


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
solaris.opensol...    editors.vim/200...    web.turbogears....    jakarta.ant.dev...    mathematics.max...    text.unicode.ge...    lang.ruby.core/...    xfce.announce/2...    network.centeri...    php.cvs.pear/20...    user-groups.lin...    kde.devel.quant...    file-systems.ar...    redhat.fedora.t...    apple.fink.auto...    gnome.orbit.gen...    qplus.devel/200...    culture.transpo...    video.dri.user/...    operators.nanog...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation