Re: [xwiki-users] rename page during it's object's inline edit save?
----- "Scott Serr" <[email protected]> wrote:
I have a page that is creating sub-pages with a button called "Create History Log." I create the sub-page name like HistoryLog-2011-09-27 from the current date programatically. These sub-pages have a HistoryLogClass object on them which I begin editing in the inline editor. During the save operation on this object, I'd like to rename the page if the user has changed a date property on the object. Is there a way to do this? I'd like it to work when creating a new page or editing and existing page with the inline editor.
Reasoning: The user is creating a HistoryLog page (with object) a few days after the fact, so they need to manage the date manually sometimes. I like having the date in the page name, to make a unique and sortable page list. The user would like to not go through the extra step of renaming the page manually.
Sort of like this for page creation: $doc.name = "HistoryLog-" + $obj.getProperty("date").getValue()
Would I need to run $doc.rename() code when editing?
Is there a clever solution?
My fall back solution is just create a sequence for the page name. HistoryLog-00001 HistoryLog-00002 And then just spin through the objects for meaningful date data. I could do away with the page per object requirement, if there was such thing as an inline object editor a bit more configurable than the object editor. I guess you'd need a way to render it to, so the only way that would work is to have a sort of virtual page for object editing and rendering. I might just need pointed in the right direction. Thanks, Scott
participants (1)
-
Scott Serr