User macro to copy scaffold page

  • 2
  • Question
  • Updated 2 years ago
Dear

I'd like to create a user macro to copy an existing Scaffold page based upon an CQL.
Any best practice or experience on how-to move forward fast?

Kind regards
Koen Gillard
Photo of Koen Gillard

Koen Gillard

  • 4 Posts
  • 0 Reply Likes

Posted 2 years ago

  • 2
Photo of Suresh Mathusuthanan

Suresh Mathusuthanan, Alum

  • 117 Posts
  • 9 Reply Likes
Hi Koen,

If my understanding is correct, in regards your inquiry, you would like to know how to copy a page with Scaffolding data ?

If that's the case, using Scaffolding 5.4.0 onward, users are able copy a page with Scaffolding metadata included. 

  • To access this feature, go to Top right of the page > Tools > Copy with Scaffolding XML
Thanks.

Regards,
Suresh
Photo of Koen Gillard

Koen Gillard

  • 4 Posts
  • 0 Reply Likes
Hi Suresh

I know this functionality very well and this works as expected.
I would like to add this functionality on a different page than the page containing the scaffold form, for example from the parent page.

I've tried to copy the url (<confluence_url>/pages/copyscaffoldfromajax.action?pageId=<pageId>) from the feature you mention, but it seems this functionality expects to be called at the page containing the menu.
I receive this error: 
Error occurred during template rendering: Invocation of method 'getDisplayableItems' in class com.atlassian.confluence.plugin.descriptor.web.ConfluenceWebInterfaceManager threw exception java.lang.NullPointerException at template/includes/menu-macros.vm[line 40, column 45]. Contact your administrator for assistance.

Kind regards
Koen Gillard
(Edited)
Photo of Suresh Mathusuthanan

Suresh Mathusuthanan, Alum

  • 117 Posts
  • 9 Reply Likes
Hi Koen,

Writing a User Macros is not within our scope.

However, you can refer to this guide to understand how to create and manage user macros. 

I would suggest you to create a function to trigger the button instead of using the url directly.

Thanks.

Regards,
Suresh
(Edited)
Photo of Koen Gillard

Koen Gillard

  • 4 Posts
  • 0 Reply Likes
Hi Suresh

I know how to create a user macro, but I don't know how to copy a scaffold page from another page.
Do you have any suggestion/examples of a function to trigger?

Koen
(Edited)
Photo of Suresh Mathusuthanan

Suresh Mathusuthanan, Alum

  • 117 Posts
  • 9 Reply Likes
Hi Koen,

I would suggest you to try using j query or using java-script. 

You can refer to this guide on j query trigger. 

Thanks.

Regards,
Suresh
Photo of Koen Gillard

Koen Gillard

  • 4 Posts
  • 0 Reply Likes
Hi Suresh

So I understand you cannot provide any help on this topic.

Kind regards
Koen Gillard