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: r534331 - /lenya/trunk/src/impl/java/org/apache/lenya/cms/publi: msg#00002

cms.lenya.cvs

Subject: svn commit: r534331 - /lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java

Author: andreas
Date: Tue May 1 23:33:41 2007
New Revision: 534331

URL: http://svn.apache.org/viewvc?view=rev&rev=534331
Log:
Throw exception when trying to delete referenced document, don't use source URL
to access a node (fixes bug 42300).

Modified:
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java

Modified:
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java?view=diff&rev=534331&r1=534330&r2=534331
==============================================================================
---
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java
(original)
+++
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java
Tue May 1 23:33:41 2007
@@ -233,11 +233,10 @@
if (sourceExtension.equals("xml") || sourceExtension.equals("")) {
getLogger().info("Default extension will be used: " +
defaultExtension);
return defaultExtension;
- }
- else {
+ } else {
return sourceExtension;
}
-
+
}
return this.extension;
}
@@ -396,6 +395,10 @@
* @see org.apache.lenya.cms.publication.Document#delete()
*/
public void delete() throws DocumentException {
+ if (hasLink()) {
+ throw new DocumentException("Can't delete document [" + this
+ + "], it's still referenced in the site structure.");
+ }
try {
getRepositoryNode().delete();
} catch (Exception e) {
@@ -494,12 +497,7 @@
}

public boolean existsTranslation(String language) {
- String sourceUri = getSourceURI(getPublication(), getArea(),
getUUID(), language);
- try {
- return SourceUtil.exists(sourceUri, this.manager);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
+ return area().contains(getUUID(), language);
}

public Document getAreaVersion(String area) throws DocumentException {
@@ -519,7 +517,7 @@
}

private Node repositoryNode;
-
+
/**
* @see org.apache.lenya.cms.publication.Document#getRepositoryNode()
*/


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

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
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