Re: [xwiki-devs] [xwiki-notifications] r10384 - xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/store
Hi Artem, It seems like you're transforming current storage code into components. I'm not sure what important advantages this brings. What I'd like to see is to have new code and new apis use components but I'm not sure about old code. Maybe you could explain what's your plan? Do you plan to create clean interfaces for storage? If so this really needs to be discussed and proposed on the devs list with a design page on xwiki.org. However this probably requires a prerequisite of having the new model in place before it can be started? wdyt? Thanks -Vincent On Jun 17, 2008, at 11:59 PM, amelentev (SVN) wrote:
Author: amelentev Date: 2008-06-17 23:59:26 +0200 (Tue, 17 Jun 2008) New Revision: 10384
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/AttachmentRecycleBinStore.java xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/AttachmentVersioningStore.java xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiAttachmentStoreInterface.java xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiRecycleBinStoreInterface.java xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiStoreInterface.java xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiVersioningStoreInterface.java Log: XWIKI-2443: Componentize Store Interfaces
add ROLEs to stores
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/ xwiki/store/AttachmentRecycleBinStore.java =================================================================== --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/AttachmentRecycleBinStore.java 2008-06-17 21:43:03 UTC (rev 10383) +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/AttachmentRecycleBinStore.java 2008-06-17 21:59:26 UTC (rev 10384) @@ -42,6 +42,11 @@ public interface AttachmentRecycleBinStore { /** + * This component's role, used when code needs to look it up. + */ + String ROLE = AttachmentRecycleBinStore.class.getName(); + + /** * Save attachment to recycle bin, with full history. * * @param attachment The attachment to save.
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/ xwiki/store/AttachmentVersioningStore.java =================================================================== --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/AttachmentVersioningStore.java 2008-06-17 21:43:03 UTC (rev 10383) +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/AttachmentVersioningStore.java 2008-06-17 21:59:26 UTC (rev 10384) @@ -33,6 +33,11 @@ public interface AttachmentVersioningStore { /** + * This component's role, used when code needs to look it up. + */ + String ROLE = AttachmentVersioningStore.class.getName(); + + /** * Load attachment archive from store. * @return attachment archive. not null. return empty archive if it is not exist in store. * @param attachment The attachment of archive.
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/ xwiki/store/XWikiAttachmentStoreInterface.java =================================================================== --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiAttachmentStoreInterface.java 2008-06-17 21:43:03 UTC (rev 10383) +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiAttachmentStoreInterface.java 2008-06-17 21:59:26 UTC (rev 10384) @@ -32,6 +32,11 @@ * @version $Id$ */ public interface XWikiAttachmentStoreInterface { + /** + * This component's role, used when code needs to look it up. + */ + String ROLE = XWikiAttachmentStoreInterface.class.getName(); + void saveAttachmentContent(XWikiAttachment attachment, XWikiContext context, boolean bTransaction) throws XWikiException; void saveAttachmentContent(XWikiAttachment attachment, boolean bParentUpdate, XWikiContext context, boolean bTransaction) throws XWikiException; void saveAttachmentsContent(List<XWikiAttachment> attachments, XWikiDocument doc, boolean bParentUpdate, XWikiContext context, boolean bTransaction) throws XWikiException;
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/ xwiki/store/XWikiRecycleBinStoreInterface.java =================================================================== --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiRecycleBinStoreInterface.java 2008-06-17 21:43:03 UTC (rev 10383) +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiRecycleBinStoreInterface.java 2008-06-17 21:59:26 UTC (rev 10384) @@ -33,6 +33,11 @@ public interface XWikiRecycleBinStoreInterface { /** + * This component's role, used when code needs to look it up. + */ + String ROLE = XWikiRecycleBinStoreInterface.class.getName(); + + /** * Save document to recycle bin. * @param doc - document to save * @param deleter - the user which delete document
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/ xwiki/store/XWikiStoreInterface.java =================================================================== --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiStoreInterface.java 2008-06-17 21:43:03 UTC (rev 10383) +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiStoreInterface.java 2008-06-17 21:59:26 UTC (rev 10384) @@ -31,6 +31,11 @@
public interface XWikiStoreInterface { + /** + * This component's role, used when code needs to look it up. + */ + String ROLE = XWikiStoreInterface.class.getName(); + public void saveXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException;
public void saveXWikiDoc(XWikiDocument doc, XWikiContext context, boolean bTransaction)
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/ xwiki/store/XWikiVersioningStoreInterface.java =================================================================== --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiVersioningStoreInterface.java 2008-06-17 21:43:03 UTC (rev 10383) +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/ store/XWikiVersioningStoreInterface.java 2008-06-17 21:59:26 UTC (rev 10384) @@ -15,6 +15,11 @@ * @version $Id$ */ public interface XWikiVersioningStoreInterface { + /** + * This component's role, used when code needs to look it up. + */ + String ROLE = XWikiVersioningStoreInterface.class.getName(); + public void loadXWikiDocArchive(XWikiDocumentArchive archivedoc, boolean bTransaction, XWikiContext context) throws XWikiException; public void saveXWikiDocArchive(XWikiDocumentArchive archivedoc, boolean bTransaction, XWikiContext context) throws XWikiException; public void updateXWikiDocArchive(XWikiDocument doc, boolean bTransaction, XWikiContext context) throws XWikiException;
_______________________________________________ notifications mailing list notifications@xwiki.org http://lists.xwiki.org/mailman/listinfo/notifications
Hi, Vincent. Sorry for late reply. Vincent Massol wrote:
It seems like you're transforming current storage code into components. I'm not sure what important advantages this brings. What I'd like to see is to have new code and new apis use components but I'm not sure about old code. Maybe you could explain what's your plan?
The plan is in proposal "Componentize XWiki Stores" http://xwiki.markmail.org/message/vs7wbfjv7ipyz2t3 and XWIKI-2443 I don't see anything wrong in components in old code.
Do you plan to create clean interfaces for storage?
not yet. I just want to refactor old storage system for easy support of many storage implementation. Current store system contains too many code duplication (business code, manipulate with model) for different storage implementations. And I want to separate simple DAO components (which can be used as prototype for new storage components) from old stores to resolve it.
If so this really needs to be discussed and proposed on the devs list with a design page on xwiki.org.
However this probably requires a prerequisite of having the new model in place before it can be started? wdyt?
Yes for new storage component. So the question I have is: should I completely rewrite storage system (+ new model) from scratch just for add a good jcr storage :) or can I just refactor old one? New storage is better of course. But it requires so much work, especially on new model. When new data model is planed? -- Artem Melentyev
On Jun 25, 2008, at 1:00 AM, Artem Melentyev wrote:
Hi, Vincent. Sorry for late reply.
Vincent Massol wrote:
It seems like you're transforming current storage code into components. I'm not sure what important advantages this brings. What I'd like to see is to have new code and new apis use components but I'm not sure about old code. Maybe you could explain what's your plan?
The plan is in proposal "Componentize XWiki Stores" http://xwiki.markmail.org/message/vs7wbfjv7ipyz2t3 and XWIKI-2443 I don't see anything wrong in components in old code.
No you're right there's nothing wrong with that. I initially thought it was just an effort that wouldn't be worth it since it would need to be done again when we move to the new interfaces. However I see you're using that to solve an issue with sharing some Hibernate factories so that's fine to me.
Do you plan to create clean interfaces for storage?
not yet. I just want to refactor old storage system for easy support of many storage implementation. Current store system contains too many code duplication (business code, manipulate with model) for different storage implementations. And I want to separate simple DAO components (which can be used as prototype for new storage components) from old stores to resolve it.
ok so this is an intermediary step between what we have and the "clean" components I guess.
If so this really needs to be discussed and proposed on the devs list with a design page on xwiki.org.
However this probably requires a prerequisite of having the new model in place before it can be started? wdyt?
Yes for new storage component.
So the question I have is: should I completely rewrite storage system (+ new model) from scratch just for add a good jcr storage :) or can I just refactor old one?
This is a good and valid question. I think you're doing right and since this JCR implementation is needed sooner rather than later and since we're missing the prerequisites (new model) I think it's best to overhaul the current JCR implementation using the old API but providing an easy migration path for later on (which is what you're doing I think).
New storage is better of course. But it requires so much work, especially on new model. When new data model is planed?
I think we should restart the discussion this summer so that we all agree on the model. Then the implementation shouldn't be too hard since I think we can have the 2 models cohabit. I need to finish the new rendering foundations (then I'll need other committers help to rewrite the macros - I wish we could find a macro framework in Java with lots of existing macros but I doubt it). Thanks Artem -Vincent
participants (2)
-
Artem Melentyev -
Vincent Massol