Author: rschellhorn
Date: 2009-05-22 10:18:47 +0200 (Fri, 22 May 2009)
New Revision: 35359
Added:
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/fix-creationrel.jsp
CMSContainer/trunk/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/fix-creationrel.jsp
Modified:
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
CMSContainer/trunk/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
Log:
?\239?\187?\191CMSC-1406 Added a maintenance script that adds missing
creationrels.
Modified:
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
===================================================================
---
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -13,6 +13,7 @@
maintenance.icaches.zerosize=ICaches with zero sizes
maintenance.icaches.emptyicachesfound=Number of empty ICaches found:
maintenance.icaches.duplicates=Duplicates icaches
+maintenance.creationrels.create=Create missing creationrels
threads.title=Thread dump
threads.active=Active
Modified:
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
===================================================================
---
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -13,6 +13,7 @@
maintenance.icaches.zerosize=ICaches met zonder grootte
maintenance.icaches.emptyicachesfound=Aantal lege ICaches gevonden:
maintenance.icaches.duplicates=Duplicaten van icaches
+maintenance.creationrels.create=Maak ontbrekende creatie relaties aan
threads.title=Thread dump
threads.active=Actief
Modified:
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
===================================================================
---
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -13,6 +13,7 @@
maintenance.icaches.zerosize=ICaches with zero sizes
maintenance.icaches.emptyicachesfound=Number of empty ICaches found:
maintenance.icaches.duplicates=Duplicates icaches
+maintenance.creationrels.create=Create missing creationrels
threads.title=Thread dump
threads.active=档案
Modified:
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
===================================================================
---
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/branches/b1_5/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
2009-05-22 08:18:47 UTC (rev 35359)
@@ -37,6 +37,10 @@
<c:url var="cleanICaches"
value="/editors/maintenance/clean-duplicate-icaches.jsp"/>
<a href="${cleanICaches}" target="rightpane"><fmt:message
key="maintenance.icaches.cleanduplicates"/></a>
</li>
+ <li class="advancedpublish">
+ <c:url var="fixCreationrels"
value="/editors/maintenance/fix-creationrel.jsp"/>
+ <a href="${fixCreationrels}" target="rightpane"><fmt:message
key="maintenance.creationrels.create"/></a>
+ </li>
<mm:haspage page="/editors/publish-remote">
<li class="advancedpublish">
Modified:
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
===================================================================
---
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -13,6 +13,7 @@
maintenance.icaches.zerosize=ICaches with zero sizes
maintenance.icaches.emptyicachesfound=Number of empty ICaches found:
maintenance.icaches.duplicates=Duplicates icaches
+maintenance.creationrels.create=Create missing creationrels
threads.title=Thread dump
threads.active=Active
Modified:
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
===================================================================
---
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -13,6 +13,7 @@
maintenance.icaches.zerosize=ICaches met zonder grootte
maintenance.icaches.emptyicachesfound=Aantal lege ICaches gevonden:
maintenance.icaches.duplicates=Duplicaten van icaches
+maintenance.creationrels.create=Maak ontbrekende creatie relaties aan
threads.title=Thread dump
threads.active=Actief
Modified:
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
===================================================================
---
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -20,7 +20,8 @@
maintenance.icaches.cleanduplicates=Clean up the icaches
maintenance.icaches.zerosize=ICaches with zero sizes
maintenance.icaches.emptyicachesfound=Number of empty ICaches found:
-maintenance.icaches.duplicates=Duplicates icaches
+maintenance.icaches.duplicates=Duplicates icaches
+maintenance.creationrels.create=Create missing creationrels
threads.title=Thread dump
threads.active=档案
Added:
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/fix-creationrel.jsp
===================================================================
---
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/fix-creationrel.jsp
(rev 0)
+++
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/fix-creationrel.jsp
2009-05-22 08:18:47 UTC (rev 35359)
@@ -0,0 +1,125 @@
+<%...@page language="java" contentType="text/html;charset=utf-8"%>
+<%...@include file="../globals.jsp" %>
+<fmt:setBundle basename="cmsc-utils" scope="request" />
+<mm:content type="text/html" encoding="UTF-8" expires="0">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html:html xhtml="true">
+<%--
+::: Find and fix contentelements that lack creationrel and/or contentrel :::
+For all contentelements without a deletionrel this script fix elements that
lack cretionrel and/or contentrel.
+
+* Items without both creationrel and contentrel will be put in a special
LostAndFound channel.
+ - This channel will be made (under the repo.) automatically if needed.
+* Items without creationrel will have its cretionrel set to the first listed
contentrel.
+* Items without a contentrel will have its contentrel set to the creationrel.
+--%>
+ <head>
+ <title>Fix contentelements without creationrel and/or
contentrel</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="icon" href="<cmsc:staticurl page='/favicon.ico' />"
type="image/x-icon" />
+ <link rel="shortcut icon" href="<cmsc:staticurl page='/favicon.ico' />"
type="image/x-icon" />
+ <link href="<cmsc:staticurl page='/editors/css/main.css'/>"
type="text/css" rel="stylesheet" />
+ </head>
+ <body>
+ <c:choose>
+ <c:when test="${not empty param.run}">
+ <mm:cloud jspvar="cloud" rank="basic user" method="http">
+ <mm:node number="repository.root">
+ <c:set var="rootNumber"><mm:field name="number"/></c:set>
+ </mm:node>
+ <mm:node number="repository.trash">
+ <c:set var="trashNumber"><mm:field name="number"/></c:set>
+ </mm:node>
+ <mm:node number="repository.lostAndFound" notfound="skip"
id="lostAndFoundNode">
+ Found: lost and found channel<br/>
+ <c:set var="lostAndFoundNumber"><mm:field name="number"/></c:set>
+ </mm:node>
+
+
+ <mm:listnodes type="contentelement">
+ <c:set var="number"><mm:field name="number"/></c:set>
+ <c:set var="nodeTitle"><mm:field name="title"/></c:set>
+
+ <c:set var="hasCreationrel" value="${false}"/>
+ <c:set var="hasContentrel" value="${false}"/>
+ <c:set var="hasDeletionrel" value="${false}"/>
+
+ <mm:relatednodes role="deletionrel" type="contentchannel"
searchdir="destination" max="1">
+ <c:set var="hasDeletionrel" value="${true}"/>
+ <c:set var="DeletionRelNumber"><mm:field name="number"/></c:set>
+ </mm:relatednodes>
+
+ <mm:relatednodes role="creationrel" type="contentchannel"
searchdir="destination" max="1">
+ <c:set var="hasCreationrel" value="${true}"/>
+ <c:set var="creationRelNumber"><mm:field name="number"/></c:set>
+ </mm:relatednodes>
+
+ <mm:relatednodes role="contentrel" type="contentchannel"
searchdir="source" max="1">
+ <c:set var="hasContentrel" value="${true}"/>
+ <c:set var="contentRelNumber"><mm:field name="number"/></c:set>
+ </mm:relatednodes>
+
+ <mm:node number="${number}" id="currentNode"/>
+ <%-- Not intersted in deleted contentelement --%>
+ <c:if test="${!hasDeletionrel}">
+
+ <%-- checks for missing creationrel and missing contentrel, then we
but them in LostAndFound --%>
+ <c:if test="${!hasCreationrel && !hasContentrel}">
+ <%-- Checks if we have a lostandfoundchannel, if not then we make
it --%>
+ <c:if test="${empty lostAndFoundNumber}">
+ No lost and found channel, creating<br/>
+ <mm:createnode id="lostAndFoundNode" type="contentchannel">
+ <mm:setfield name="name">Lost & found</mm:setfield>
+ </mm:createnode>
+ <mm:node number="${rootNumber}" id="rootNode"/>
+ <mm:createrelation role="childrel" source="rootNode"
destination="lostAndFoundNode" />
+ <mm:node referid="lostAndFoundNode">
+ <mm:createalias>repository.lostAndFound</mm:createalias>
+ <c:set var="lostAndFoundNumber"><mm:field
name="number"/></c:set>
+ </mm:node>
+ </c:if>
+
+ Item with title: ${nodeTitle} - Did not have a creationrel, nor a
contentrel and is moved to LostAndFound<br >
+ <mm:createrelation role="creationrel" source="lostAndFoundNode"
destination="currentNode" />
+ <mm:createrelation role="contentrel" source="lostAndFoundNode"
destination="currentNode" />
+ <br/>
+ </c:if>
+
+ <%-- checks for missing creationrel but found a contentrel --%>
+ <c:if test="${!hasCreationrel && hasContentrel}">
+ Item with title: ${nodeTitle} - Did not have a creationrel.
Creationrel is now set to its contentrel<br >
+ <mm:node number="${contentRelNumber}" id="contentrelNode"/>
+ <mm:createrelation role="creationrel" source="contentrelNode"
destination="currentNode" />
+ </c:if>
+
+ <%-- checks for missing creationrel but found a contentrel --%>
+ <c:if test="${hasCreationrel && !hasContentrel}">
+ Item with title: ${nodeTitle} - Did not have a contentrel.
Contentrel is now set to its creationrel<br >
+ <mm:node number="${creationRelNumber}" id="creationrelNode"/>
+ <mm:createrelation role="contentrel" source="creationrelNode"
destination="currentNode" />
+ </c:if>
+
+ <%-- end if !hasDeletionrel --%>
+ </c:if>
+
+ </mm:listnodes>
+
+</mm:cloud>
+Done<br>
+ </c:when>
+ <c:otherwise>
+ <h1>Find and fix contentelements that lack creationrel and/or
contentrel</h1>
+ <p>For all contentelements without a deletionrel this script fix
elements that lack cretionrel and/or contentrel.</p>
+
+ <ol>
+ <li>Items without both creationrel and contentrel will be put in a
special LostAndFound channel.<br/>
+ - This channel will be made (under the repo.) automatically if
needed.</li>
+ <li>Items without creationrel will have its cretionrel set to the
first listed contentrel.</li>
+ <li>Items without a contentrel will have its contentrel set to the
creationrel.</li>
+ </ol>
+ <a href="?run=true">start</a>
+ </c:otherwise>
+ </c:choose>
+ </body>
+</html:html>
+</mm:content>
\ No newline at end of file
Modified:
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
===================================================================
---
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/branches/b1_6/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
2009-05-22 08:18:47 UTC (rev 35359)
@@ -37,6 +37,10 @@
<c:url var="cleanICaches"
value="/editors/maintenance/clean-duplicate-icaches.jsp"/>
<a href="${cleanICaches}" target="rightpane"><fmt:message
key="maintenance.icaches.cleanduplicates"/></a>
</li>
+ <li class="advancedpublish">
+ <c:url var="fixCreationrels"
value="/editors/maintenance/fix-creationrel.jsp"/>
+ <a href="${fixCreationrels}" target="rightpane"><fmt:message
key="maintenance.creationrels.create"/></a>
+ </li>
<mm:haspage page="/editors/publish-remote">
<li class="advancedpublish">
Modified:
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
===================================================================
---
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -13,6 +13,7 @@
maintenance.icaches.zerosize=ICaches with zero sizes
maintenance.icaches.emptyicachesfound=Number of empty ICaches found:
maintenance.icaches.duplicates=Duplicates icaches
+maintenance.creationrels.create=Create missing creationrels
threads.title=Thread dump
threads.active=Active
Modified:
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
===================================================================
---
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_nl.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -13,6 +13,7 @@
maintenance.icaches.zerosize=ICaches met zonder grootte
maintenance.icaches.emptyicachesfound=Aantal lege ICaches gevonden:
maintenance.icaches.duplicates=Duplicaten van icaches
+maintenance.creationrels.create=Maak ontbrekende creatie relaties aan
threads.title=Thread dump
threads.active=Actief
Modified:
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
===================================================================
---
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/trunk/CMSContainer/cmsc/maintenance/resources/cmsc-maintenance_zh.properties
2009-05-22 08:18:47 UTC (rev 35359)
@@ -21,6 +21,7 @@
maintenance.icaches.zerosize=0大小的指令缓存
maintenance.icaches.emptyicachesfound=找到的空指令缓存的数目为:
maintenance.icaches.duplicates=复制指令缓存
+maintenance.creationrels.create=Create missing creationrels
threads.title=Thread dump
threads.active=档案
Added:
CMSContainer/trunk/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/fix-creationrel.jsp
===================================================================
---
CMSContainer/trunk/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/fix-creationrel.jsp
(rev 0)
+++
CMSContainer/trunk/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/fix-creationrel.jsp
2009-05-22 08:18:47 UTC (rev 35359)
@@ -0,0 +1,125 @@
+<%...@page language="java" contentType="text/html;charset=utf-8"%>
+<%...@include file="../globals.jsp" %>
+<fmt:setBundle basename="cmsc-utils" scope="request" />
+<mm:content type="text/html" encoding="UTF-8" expires="0">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html:html xhtml="true">
+<%--
+::: Find and fix contentelements that lack creationrel and/or contentrel :::
+For all contentelements without a deletionrel this script fix elements that
lack cretionrel and/or contentrel.
+
+* Items without both creationrel and contentrel will be put in a special
LostAndFound channel.
+ - This channel will be made (under the repo.) automatically if needed.
+* Items without creationrel will have its cretionrel set to the first listed
contentrel.
+* Items without a contentrel will have its contentrel set to the creationrel.
+--%>
+ <head>
+ <title>Fix contentelements without creationrel and/or
contentrel</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="icon" href="<cmsc:staticurl page='/favicon.ico' />"
type="image/x-icon" />
+ <link rel="shortcut icon" href="<cmsc:staticurl page='/favicon.ico' />"
type="image/x-icon" />
+ <link href="<cmsc:staticurl page='/editors/css/main.css'/>"
type="text/css" rel="stylesheet" />
+ </head>
+ <body>
+ <c:choose>
+ <c:when test="${not empty param.run}">
+ <mm:cloud jspvar="cloud" rank="basic user" method="http">
+ <mm:node number="repository.root">
+ <c:set var="rootNumber"><mm:field name="number"/></c:set>
+ </mm:node>
+ <mm:node number="repository.trash">
+ <c:set var="trashNumber"><mm:field name="number"/></c:set>
+ </mm:node>
+ <mm:node number="repository.lostAndFound" notfound="skip"
id="lostAndFoundNode">
+ Found: lost and found channel<br/>
+ <c:set var="lostAndFoundNumber"><mm:field name="number"/></c:set>
+ </mm:node>
+
+
+ <mm:listnodes type="contentelement">
+ <c:set var="number"><mm:field name="number"/></c:set>
+ <c:set var="nodeTitle"><mm:field name="title"/></c:set>
+
+ <c:set var="hasCreationrel" value="${false}"/>
+ <c:set var="hasContentrel" value="${false}"/>
+ <c:set var="hasDeletionrel" value="${false}"/>
+
+ <mm:relatednodes role="deletionrel" type="contentchannel"
searchdir="destination" max="1">
+ <c:set var="hasDeletionrel" value="${true}"/>
+ <c:set var="DeletionRelNumber"><mm:field name="number"/></c:set>
+ </mm:relatednodes>
+
+ <mm:relatednodes role="creationrel" type="contentchannel"
searchdir="destination" max="1">
+ <c:set var="hasCreationrel" value="${true}"/>
+ <c:set var="creationRelNumber"><mm:field name="number"/></c:set>
+ </mm:relatednodes>
+
+ <mm:relatednodes role="contentrel" type="contentchannel"
searchdir="source" max="1">
+ <c:set var="hasContentrel" value="${true}"/>
+ <c:set var="contentRelNumber"><mm:field name="number"/></c:set>
+ </mm:relatednodes>
+
+ <mm:node number="${number}" id="currentNode"/>
+ <%-- Not intersted in deleted contentelement --%>
+ <c:if test="${!hasDeletionrel}">
+
+ <%-- checks for missing creationrel and missing contentrel, then we
but them in LostAndFound --%>
+ <c:if test="${!hasCreationrel && !hasContentrel}">
+ <%-- Checks if we have a lostandfoundchannel, if not then we make
it --%>
+ <c:if test="${empty lostAndFoundNumber}">
+ No lost and found channel, creating<br/>
+ <mm:createnode id="lostAndFoundNode" type="contentchannel">
+ <mm:setfield name="name">Lost & found</mm:setfield>
+ </mm:createnode>
+ <mm:node number="${rootNumber}" id="rootNode"/>
+ <mm:createrelation role="childrel" source="rootNode"
destination="lostAndFoundNode" />
+ <mm:node referid="lostAndFoundNode">
+ <mm:createalias>repository.lostAndFound</mm:createalias>
+ <c:set var="lostAndFoundNumber"><mm:field
name="number"/></c:set>
+ </mm:node>
+ </c:if>
+
+ Item with title: ${nodeTitle} - Did not have a creationrel, nor a
contentrel and is moved to LostAndFound<br >
+ <mm:createrelation role="creationrel" source="lostAndFoundNode"
destination="currentNode" />
+ <mm:createrelation role="contentrel" source="lostAndFoundNode"
destination="currentNode" />
+ <br/>
+ </c:if>
+
+ <%-- checks for missing creationrel but found a contentrel --%>
+ <c:if test="${!hasCreationrel && hasContentrel}">
+ Item with title: ${nodeTitle} - Did not have a creationrel.
Creationrel is now set to its contentrel<br >
+ <mm:node number="${contentRelNumber}" id="contentrelNode"/>
+ <mm:createrelation role="creationrel" source="contentrelNode"
destination="currentNode" />
+ </c:if>
+
+ <%-- checks for missing creationrel but found a contentrel --%>
+ <c:if test="${hasCreationrel && !hasContentrel}">
+ Item with title: ${nodeTitle} - Did not have a contentrel.
Contentrel is now set to its creationrel<br >
+ <mm:node number="${creationRelNumber}" id="creationrelNode"/>
+ <mm:createrelation role="contentrel" source="creationrelNode"
destination="currentNode" />
+ </c:if>
+
+ <%-- end if !hasDeletionrel --%>
+ </c:if>
+
+ </mm:listnodes>
+
+</mm:cloud>
+Done<br>
+ </c:when>
+ <c:otherwise>
+ <h1>Find and fix contentelements that lack creationrel and/or
contentrel</h1>
+ <p>For all contentelements without a deletionrel this script fix
elements that lack cretionrel and/or contentrel.</p>
+
+ <ol>
+ <li>Items without both creationrel and contentrel will be put in a
special LostAndFound channel.<br/>
+ - This channel will be made (under the repo.) automatically if
needed.</li>
+ <li>Items without creationrel will have its cretionrel set to the
first listed contentrel.</li>
+ <li>Items without a contentrel will have its contentrel set to the
creationrel.</li>
+ </ol>
+ <a href="?run=true">start</a>
+ </c:otherwise>
+ </c:choose>
+ </body>
+</html:html>
+</mm:content>
\ No newline at end of file
Modified:
CMSContainer/trunk/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
===================================================================
---
CMSContainer/trunk/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
2009-05-22 03:00:49 UTC (rev 35358)
+++
CMSContainer/trunk/CMSContainer/cmsc/maintenance/src/webapp/editors/maintenance/menu.jsp
2009-05-22 08:18:47 UTC (rev 35359)
@@ -37,6 +37,10 @@
<c:url var="cleanICaches"
value="/editors/maintenance/clean-duplicate-icaches.jsp"/>
<a href="${cleanICaches}" target="rightpane"><fmt:message
key="maintenance.icaches.cleanduplicates"/></a>
</li>
+ <li class="advancedpublish">
+ <c:url var="fixCreationrels"
value="/editors/maintenance/fix-creationrel.jsp"/>
+ <a href="${fixCreationrels}" target="rightpane"><fmt:message
key="maintenance.creationrels.create"/></a>
+ </li>
<mm:haspage page="/editors/publish-remote">
<li class="advancedpublish">
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs