On Jan 17, 2009, at 7:37 AM, sdumitriu (SVN) wrote:
Author: sdumitriu
Date: 2009-01-17 07:37:24 +0100 (Sat, 17 Jan 2009)
New Revision: 15492
Modified:
platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/
packaging/Package.java
platform/core/trunk/xwiki-core/src/main/resources/
JcrQueries.properties
platform/core/trunk/xwiki-core/src/main/resources/queries.hbm.xml
Log:
XWIKI-3123: Exports don't include hidden documents
Fixed.
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
plugin/packaging/Package.java
===================================================================
--- platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
plugin/packaging/Package.java 2009-01-17 06:15:49 UTC (rev 15491)
+++ platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
plugin/packaging/Package.java 2009-01-17 06:37:24 UTC (rev 15492)
@@ -45,6 +45,7 @@
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
+import org.xwiki.query.QueryException;
import com.xpn.xwiki.XWiki;
import com.xpn.xwiki.XWikiContext;
@@ -990,12 +991,14 @@
public void addAllWikiDocuments(XWikiContext context) throws
XWikiException
{
XWiki wiki = context.getWiki();
- List<String> spaces = wiki.getSpaces(context);
- for (int i = 0; i < spaces.size(); i++) {
- List<String> docNameList =
wiki.getSpaceDocsName(spaces.get(i), context);
- for (String docName : docNameList) {
- add(spaces.get(i) + "." + docName,
DocumentInfo.ACTION_OVERWRITE, context);
+ try {
+ List<String> documentNames =
wiki
.getStore
().getQueryManager().getNamedQuery("getAllDocuments").execute();
+ for (String docName : documentNames) {
+ add(docName, DocumentInfo.ACTION_OVERWRITE, context);
}
+ } catch (QueryException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
This looks bad. Why don't you throw an XWikiException instead?
[snip]
Thanks
-Vincent
http://xwiki.com
http://xwiki.org
http://massol.net