implemented renaming of wiki page

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-09-12 08:49:43 +02:00
parent ceebcaff4d
commit 7ddd32bb72
3 changed files with 21 additions and 10 deletions

View File

@@ -306,7 +306,8 @@ public class SqliteDb extends BaseDb implements WikiDb {
@Override
public WikiPage save(WikiPage page) {
try {
if (page.isDirty(CONTENT) || page.isDirty(ID)) insertInto(TABLE_PAGES,ID,VERSION,CONTENT).values(page.title(),page.version(),page.content()).execute(db).close();
if (page.isDirty(CONTENT) || page.isDirty(ID) || page.isDirty(TITLE)) insertInto(TABLE_PAGES,ID,VERSION,TITLE,CONTENT)
.values(page.id(),page.version(),page.title(),page.content()).execute(db).close();
if (page.isDirty(MEMBERS)){
Query.delete().from(TABLE_PAGES_USERS).where(PAGE_ID,Condition.equal(page.title())).where(USER_ID,Condition.notIn(page.members().keySet().toArray())).execute(db);
var query = replaceInto(TABLE_PAGES_USERS,PAGE_ID,USER_ID,PERMISSIONS);