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: r193068 - in /lenya/trunk/src/java/org/apache/lenya: cms/reposi: msg#00238

cms.lenya.cvs

Subject: svn commit: r193068 - in /lenya/trunk/src/java/org/apache/lenya: cms/repository/SourceNode.java cms/usecase/AbstractUsecase.java transaction/Versionable.java

Author: chestnut
Date: Wed Jun 22 21:01:58 2005
New Revision: 193068

URL: http://svn.apache.org/viewcvs?rev=193068&view=rev
Log:
Allows a user to checkout an object, execute multiple usecases on the object,
and checkin the object

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

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=193068&r1=193067&r2=193068&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 Wed
Jun 22 21:01:58 2005
@@ -117,19 +117,17 @@
/**
* @see org.apache.lenya.transaction.Transactionable#canCheckOut()
*/
- public boolean canCheckOut() throws TransactionException {
+ public boolean isCheckedOutByUser() throws TransactionException {
try {
- RCMLEntry entry =
getRevisionController().getRCML(getRCPath()).getLatestEntry();
- if(!isCheckedOut())
- return true;
- else if(entry.getIdentity().equals(getUserId()))
+ RCMLEntry entry =
getRevisionController().getRCML(getRCPath()).getLatestEntry();
+ if(entry.getIdentity().equals(getUserId()))
return true;
- else
- return false;
+ else
+ return false;
} catch (TransactionException e) {
- throw e;
+ throw e;
} catch (Exception e) {
- throw new TransactionException(e);
+ throw new TransactionException(e);
}
}

@@ -306,7 +304,7 @@
* @see org.apache.lenya.transaction.Transactionable#lock()
*/
public void lock() throws TransactionException {
- if (!canCheckOut()) {
+ if (isCheckedOut() && !isCheckedOutByUser()) {
throw new TransactionException("Cannot lock [" + this + "]: node is
checked out.");
}
if (getLogger().isDebugEnabled()) {

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=193068&r1=193067&r2=193068&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 Wed
Jun 22 21:01:58 2005
@@ -642,8 +642,8 @@
boolean canExecute = true;

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

objects[i].lock();
- if (!isOptimistic()) {
+ if (!isOptimistic() && !objects[i].isCheckedOutByUser()) {
objects[i].checkout();
}
}

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=193068&r1=193067&r2=193068&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/transaction/Versionable.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/transaction/Versionable.java Wed Jun
22 21:01:58 2005
@@ -42,10 +42,10 @@
boolean isCheckedOut() throws TransactionException;

/**
- * @return if the object can be checked out
+ * @return if the object is checked out by the current user.
* @throws TransactionException if an error occurs.
*/
- boolean canCheckOut() throws TransactionException;
+ boolean isCheckedOutByUser() throws TransactionException;

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


<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