We have an existing internal utility that automatically creates links to additional information about all of our servers, of the form http://confluence.domain.edu:8090/display/SYS/sboxpup.domain.edu . If this page pre-exists, everything is fine. If this page does not exist, we are given a default 'Page not found' page, and not given an option to create it. We would like to be able to add content to this URLs on-demand. Is this possible?
Hi Jeff:
Was an interesting problem.
You can alter the 404.vm velocity file that controls the 404 page in confluence. You can create a page on confluence by simply hitting http://yourinstance/pages/createpage.action?spaceKey=SOMEKEY&title=SOMETITLE
As such, I was thinking of just adding a link to 404.vm which gets shown on a page not found that reads the missing title and constructs a url as mentioned above.
Easy enough right? Well, this is where I ran into a wall. One of the features of Confluence is that we will search for analogues of your page title before returning 404, so that if you wanted a page like 'hoem' it might find the 'home' page in your space. You can usually figure out what page you're on or what url got you to a particular location using some of the objects in https://developer.atlassian.com/display/CONFDEV/Confluence%20Objects%20Accessible%20From%20Velocity. Hoewver, because we direct you first to the PageNotFoundAction then to the FourOhFourAction upon failure to find mispellings, we lose the original title/request url.
Lame. You could hard code the right space.... but then you'd still have to type in a title (if you omit the &title part of the url, it'll just be "new page")
Of course, you could muck with PageNotFoundAction.java, and change the behavior of the whole thing... but thats a rather large change.
Meh... not a great answer for it, but this is where I drew the line and gave up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.