|
[
Permlink
| « Hide
]
Ludovic Dubost added a comment - 22/Dec/06 14:37
Moving to unassigned according to new policy
Usually, the solutions for versioning and trash can be implemented in these ways.
The main target of all solutions is the data integrity and efficiency. Main idea is storing all documents in database and add some flags to documents. Flags, for ex., can be "is_current_version", "is_deleted". Deletion of document in this case is very simple and fast operation - change the flag in database to 'Y'. So, the solution can looks as in below. 2. Actual document can be found with this query 3. All referenced objects like attachments should have two foreign keys - first using GUID, second using ID. If attachments does not have versioning, second foreign key can be omitted. Actual attachment also should have flag "is_current_version". Will attachments duplicate when parent document was changed ? No. Never. But actual attachment will continue refer to previous version of document. 4. Actual attachments can be found with this: 5. How to find attachments for previous version of document ? 7. Maintenance procedure can purge old documents from database and mark expired docs as deleted. 8. Productivity. Indexes are very important. Mikhail:
If we store deleted documents in same table as life documents, then we will have problems with searching. XWiki uses many hql queries on documents and it need be rewrited with additional where. It is bad. I think Sergiu's solution (store trash as xml in separate table) is better. Can admin permanently delete life document without recycle bin?
Can admin permanently delete document from recycle bin at any state? I think yes. Implementation notes:
Artem, I think the default behavior should be to always move to recycle bin.
On another problem, that of deleting a document more than once, the RecycleBin table should also have a "number" property, identifying the instance of the document in the recycle. Deleting a document when there's already one or more instances in the RecycleBin should create a new instance with a different number.
Ok. agreed.
Another note: recycle bin table will have primary key = doc.fullName+":"+doc.language, because we can't know doc.id when there is no doc's row in xwikidoc table. code is done in r4417
ui will be in reopened.
I need move out undelete action from DeleteAction.java because it should use "undelete" right, not "delete" if /delete/ is used UndeleteAction created in r4426.
There are problems in "delete" right for now.
delete right is only = (user==doc.owner || admin) if you use /delete/ uri. (see XWikiRightServiceImpl#checkAccess) This is blocks for using delete right for delete from recyclebin. Indeed, there is no real 'delete' right, it is mostly the admin right. To keep things simple, you could check for the admin right when deciding if the user can undelete.
fixed in r4441.
switch from .hasAccessLevel to more proper .checkAccess (as in /delete/ action). so:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||