On Dec 13, 2009, at 9:11 AM, vmassol (SVN) wrote:
Author: vmassol
Date: 2009-12-13 09:11:05 +0100 (Sun, 13 Dec 2009)
New Revision: 25770
Modified:
contrib/sandbox/xwiki-model/src/main/java/org/xwiki/model/
Document.java
contrib/sandbox/xwiki-model/src/main/java/org/xwiki/model/Space.java
Log:
Made the model more scaleable (ability to have lots of spaces, lots
of objects, lots of object definitions)
Modified: contrib/sandbox/xwiki-model/src/main/java/org/xwiki/model/
Document.java
===================================================================
--- contrib/sandbox/xwiki-model/src/main/java/org/xwiki/model/
Document.java 2009-12-12 15:37:00 UTC (rev 25769)
+++ contrib/sandbox/xwiki-model/src/main/java/org/xwiki/model/
Document.java 2009-12-13 08:11:05 UTC (rev 25770)
@@ -11,10 +11,14 @@
/**
* @return the list of object definitions defined inside this
document
*/
- List<ObjectDefinition> getObjectDefinitions();
+ List<String> getObjectDefinitionNames();
- List<Object> getObjects();
+ ObjectDefinition getObjectDefinition(String
objectDefinitionName);
+ List<String> getObjectNames();
+
+ Object getObject(String objectName);
+
Another solution would be to use iterators with this API:
Iterator<Object> getObjects();
instead of
List<String> getObjectNames();
Object getObject(String objectName);
I think it could allow more fine-tuning on the requests we send to the
DB (ie we can fetch elements N elements by N elements instead of 1 by
1).
Thanks
-Vincent
List<Attachment> getAttachments();
void setParent(Document document);
Modified: contrib/sandbox/xwiki-model/src/main/java/org/xwiki/model/
Space.java
===================================================================
--- contrib/sandbox/xwiki-model/src/main/java/org/xwiki/model/
Space.java 2009-12-12 15:37:00 UTC (rev 25769)
+++ contrib/sandbox/xwiki-model/src/main/java/org/xwiki/model/
Space.java 2009-12-13 08:11:05 UTC (rev 25770)
@@ -11,9 +11,9 @@
String getDescription();
/**
- * @return the full list of all nested spaces
+ * @return the names of all nested spaces
*/
- List<Space> getSpaces();
+ List<String> getSpaceNames();
/**
* @param spaceName the name of the nested space to look for
@@ -36,7 +36,7 @@
*/
void removeSpace(String spaceName);
- List<Document> getDocuments();
+ List<String> getDocumentNames();
boolean hasSpace(String spaceName);