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: r534361 - in /lenya/trunk/src/modules-core/workflow: java/src/o: msg#00007

cms.lenya.cvs

Subject: svn commit: r534361 - in /lenya/trunk/src/modules-core/workflow: java/src/org/apache/lenya/cms/workflow/usecases/Publish.java resources/i18n/cmsui.xml resources/i18n/cmsui_de.xml

Author: andreas
Date: Wed May 2 02:06:06 2007
New Revision: 534361

URL: http://svn.apache.org/viewvc?view=rev&rev=534361
Log:
Publish usecase: add info message for broken links. This fixes bug 42303.

Modified:

lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java
lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui.xml
lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui_de.xml

Modified:
lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java?view=diff&rev=534361&r1=534360&r2=534361
==============================================================================
---
lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java
(original)
+++
lenya/trunk/src/modules-core/workflow/java/src/org/apache/lenya/cms/workflow/usecases/Publish.java
Wed May 2 02:06:06 2007
@@ -96,6 +96,33 @@
setParameter(SEND_NOTIFICATION, Boolean.TRUE);

setParameter(UNPUBLISHED_LINKS, new LinkList(this.manager,
getSourceDocument()));
+
+ }
+
+ protected boolean hasBrokenLinks() {
+ LinkManager linkMgr = null;
+ LinkResolver resolver = null;
+ try {
+ linkMgr = (LinkManager) this.manager.lookup(LinkManager.ROLE);
+ resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
+ org.apache.lenya.cms.linking.Link[] links =
linkMgr.getLinksFrom(getSourceDocument());
+ for (int i = 0; i < links.length; i++) {
+ LinkTarget target = resolver.resolve(getSourceDocument(),
links[i].getUri());
+ if (!target.exists()) {
+ return true;
+ }
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ } finally {
+ if (linkMgr != null) {
+ this.manager.release(linkMgr);
+ }
+ if (resolver != null) {
+ this.manager.release(resolver);
+ }
+ }
+ return false;
}

/**
@@ -188,6 +215,10 @@
DublinCoreHelper.getTitle(doc) };
addErrorMessage("missing-document", params);
}
+ }
+
+ if (hasBrokenLinks()) {
+ addInfoMessage("publish-broken-links");
}
}
}

Modified: lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui.xml
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui.xml?view=diff&rev=534361&r1=534360&r2=534361
==============================================================================
--- lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui.xml (original)
+++ lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui.xml Wed May 2
02:06:06 2007
@@ -42,6 +42,7 @@

<message key="unpublished-links">Links to unpublished documents:</message>
<message key="links-to-document">Links from other documents:</message>
+ <message key="publish-broken-links">The document contains broken
links.</message>

<message key="notify-reviewers">Notify reviewers</message>


Modified: lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui_de.xml
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui_de.xml?view=diff&rev=534361&r1=534360&r2=534361
==============================================================================
--- lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui_de.xml (original)
+++ lenya/trunk/src/modules-core/workflow/resources/i18n/cmsui_de.xml Wed May
2 02:06:06 2007
@@ -42,6 +42,7 @@

<message key="unpublished-links">Links zu nicht publizierten
Dokumenten:</message>
<message key="links-to-document">Links von anderen Dokumenten:</message>
+ <message key="publish-broken-links">Das Dokument enthält Links zu nicht
existierenden Dokumenten.</message>

<message key="notify-reviewers">Prüfer benachrichtigen</message>


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

Recently Viewed:
ide.eclipse.wtp...    bug-tracking.ro...    xfree86.cvs/200...    lisp.wxcl.devel...    file-systems.ar...    kde.devel.kwrit...    jakarta.jetspee...    qnx.openqnx.dev...    drivers.openib/...    ports.xbox.deve...    gis.gdal.devel/...    netbsd.ports.ma...    ubuntu.marketin...    systemtap/2005-...    web.omniweb/200...    mail.qmail.ldap...    hardware.soekri...    os.netbsd.devel...    audio.madman.ge...    tv.freeguide-tv...    cluster.openmos...    education.ezpro...   
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