|
|
Choosing A Webhost: |
svn commit: r209824 - /lenya/branches/BRANCH_1_2_X/src/java/org/apache/leny: msg#00032cms.lenya.cvs
Author: andreas Date: Fri Jul 8 08:53:31 2005 New Revision: 209824 URL: http://svn.apache.org/viewcvs?rev=209824&view=rev Log: Applying patch for Bug #35660: UniqueDocumentId should not try to increase a dash-separated character value (foo-a), only number values (foo-1), credits to Simon Litwan Modified: lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/UniqueDocumentId.java Modified: lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/UniqueDocumentId.java URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/UniqueDocumentId.java?rev=209824&r1=209823&r2=209824&view=diff ============================================================================== --- lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/UniqueDocumentId.java (original) +++ lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/publication/UniqueDocumentId.java Fri Jul 8 08:53:31 2005 @@ -45,29 +45,28 @@ String idwithoutsuffix = null; if (node != null) { - int n = documentid.lastIndexOf("/"); + int n = documentid.lastIndexOf("/"); String lastToken = ""; String substring = documentid; - if ((n < documentid.length()) && (n > 0)) { - lastToken = documentid.substring(n); - substring = documentid.substring(0, n); - } + lastToken = documentid.substring(n); + substring = documentid.substring(0, n); int l = lastToken.length(); int index = lastToken.lastIndexOf("-"); - if (0 < index && index < l) { + if (0 < index && index < l && lastToken.substring(index + 1).matches("[\\d]*")) { suffix = lastToken.substring(index + 1); idwithoutsuffix = substring + lastToken.substring(0, index); - version = Integer.parseInt(suffix); + version = Integer.parseInt(suffix); } else { idwithoutsuffix = substring + lastToken; } + while (node != null) { version = version + 1; suffix = (new Integer(version)).toString(); documentid = idwithoutsuffix + "-" + suffix; - node = tree.getNode(documentid); + node = tree.getNode(documentid); } } } catch (SiteTreeException e) {
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r209710 - /lenya/trunk/src/java/org/apache/lenya/cms/editors/forms/OneFormEditor.java, chestnut |
|---|---|
| Next by Date: | svn commit: r209928 - in /lenya/branches/BRANCH_1_2_X/src/cocoon: local.blocks.properties local.build.properties, antonio |
| Previous by Thread: | svn commit: r209710 - /lenya/trunk/src/java/org/apache/lenya/cms/editors/forms/OneFormEditor.java, chestnut |
| Next by Thread: | svn commit: r209928 - in /lenya/branches/BRANCH_1_2_X/src/cocoon: local.blocks.properties local.build.properties, antonio |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive 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 |