|
|
Choosing A Webhost: |
svn commit: r225773 - in /lenya/trunk/src: java/org/apache/lenya/cms/site/u: msg#00109cms.lenya.cvs
Author: andreas Date: Thu Jul 28 06:57:37 2005 New Revision: 225773 URL: http://svn.apache.org/viewcvs?rev=225773&view=rev Log: ChangeNodeID usecase: fixed NPE for top-level nodes, don't call super.getObjectsToLock() to avoid stack overflow. Patch by Josias Thoeny. This resolves bug #35873. Modified: lenya/trunk/src/java/org/apache/lenya/cms/site/usecases/ChangeNodeID.java lenya/trunk/src/webapp/lenya/usecases/site/changeNodeID.jx Modified: lenya/trunk/src/java/org/apache/lenya/cms/site/usecases/ChangeNodeID.java URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/site/usecases/ChangeNodeID.java?rev=225773&r1=225772&r2=225773&view=diff ============================================================================== --- lenya/trunk/src/java/org/apache/lenya/cms/site/usecases/ChangeNodeID.java (original) +++ lenya/trunk/src/java/org/apache/lenya/cms/site/usecases/ChangeNodeID.java Thu Jul 28 06:57:37 2005 @@ -60,7 +60,6 @@ * @see org.apache.lenya.cms.usecase.AbstractUsecase#getObjectsToLock() */ protected Transactionable[] getObjectsToLock() throws UsecaseException { - super.lockInvolvedObjects(); SiteManager siteManager = null; ServiceSelector selector = null; @@ -134,10 +133,13 @@ addErrorMessage("The document ID is not valid."); } else { Document parent = identityMap.getParent(getSourceDocument()); + String parentId = ""; + // if the document is at the top level, the parent is null + if (parent != null) parentId = parent.getId(); Publication publication = getSourceDocument().getPublication(); Document document = identityMap.get(publication, getSourceDocument().getArea(), - parent.getId() + "/" + nodeId, + parentId + "/" + nodeId, getSourceDocument().getLanguage()); if (document.exists()) { addErrorMessage("The document does already exist."); Modified: lenya/trunk/src/webapp/lenya/usecases/site/changeNodeID.jx URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecases/site/changeNodeID.jx?rev=225773&r1=225772&r2=225773&view=diff ============================================================================== --- lenya/trunk/src/webapp/lenya/usecases/site/changeNodeID.jx (original) +++ lenya/trunk/src/webapp/lenya/usecases/site/changeNodeID.jx Thu Jul 28 06:57:37 2005 @@ -1,68 +1,68 @@ -<?xml version="1.0"?> -<!-- - Copyright 1999-2004 The Apache Software Foundation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<!-- $Id: renameLabel.jx 123364 2004-12-26 16:11:27Z gregor $ --> -<page:page xmlns:c="http://apache.org/cocoon/templates/jx/1.0" - xmlns="http://www.w3.org/1999/xhtml" - xmlns:i18n="http://apache.org/cocoon/i18n/2.1" - xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" - xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" - > - - <page:title> - <i18n:text>Change Document ID</i18n:text> - </page:title> - <page:body> - <div class="lenya-box"> - <div class="lenya-box-title"> - <i18n:translate> - <i18n:text key="rename-label-doc"/> - <i18n:param> - <q> - <jx:out value="${usecase.getParameter('documentId')}"/> - </q> - </i18n:param> - </i18n:translate> - </div> - <div class="lenya-box-body"> - <form method="get" action=""> - <input type="hidden" name="lenya.continuation" value="${continuation.id}"/> - <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/> - <table class="lenya-table-noborder"> - <tr> - <td colspan="2"> - <jx:import uri="templates/messages.jx"/> - </td> - </tr> - <tr> - <td class="lenya-entry-caption"><label for="nodeId"><i18n:text>New Document ID</i18n:text>:</label></td> - <td><input type="text" class="lenya-form-element" name="nodeId" value="${usecase.getParameter('nodeId')}"/></td> - </tr> - <tr> - <td/> - <td> - <br/> - <input i18n:attr="value" type="submit" name="submit" value="Save"/> -   - <input i18n:attr="value" type="submit" name="cancel" value="Cancel"/> - </td> - </tr> - </table> - </form> - </div> - </div> - </page:body> +<?xml version="1.0"?> +<!-- + Copyright 1999-2004 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id: renameLabel.jx 123364 2004-12-26 16:11:27Z gregor $ --> +<page:page xmlns:c="http://apache.org/cocoon/templates/jx/1.0" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:i18n="http://apache.org/cocoon/i18n/2.1" + xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" + xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" + > + + <page:title> + <i18n:text>Change Document ID</i18n:text> + </page:title> + <page:body> + <div class="lenya-box"> + <div class="lenya-box-title"> + <i18n:translate> + <i18n:text key="rename-label-doc"/> + <i18n:param> + <q> + <jx:out value="${usecase.getParameter('document').getId()}"/> + </q> + </i18n:param> + </i18n:translate> + </div> + <div class="lenya-box-body"> + <form method="get" action=""> + <input type="hidden" name="lenya.continuation" value="${continuation.id}"/> + <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/> + <table class="lenya-table-noborder"> + <tr> + <td colspan="2"> + <jx:import uri="templates/messages.jx"/> + </td> + </tr> + <tr> + <td class="lenya-entry-caption"><label for="nodeId"><i18n:text>New Document ID</i18n:text>:</label></td> + <td><input type="text" class="lenya-form-element" name="nodeId" value="${usecase.getParameter('nodeId')}"/></td> + </tr> + <tr> + <td/> + <td> + <br/> + <input i18n:attr="value" type="submit" name="submit" value="Save"/> +   + <input i18n:attr="value" type="submit" name="cancel" value="Cancel"/> + </td> + </tr> + </table> + </form> + </div> + </div> + </page:body> </page:page>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r225772 - /lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java, andreas |
|---|---|
| Next by Date: | svn commit: r225873 - /lenya/branches/BRANCH_1_2_X/src/webapp/lenya/info.xmap, antonio |
| Previous by Thread: | svn commit: r225772 - /lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java, andreas |
| Next by Thread: | svn commit: r225873 - /lenya/branches/BRANCH_1_2_X/src/webapp/lenya/info.xmap, 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 |