Hi,
I have followed the three blueprint tutorials (simple, intermidiate, and advanced) and everything works fine. The one thing I have not been able to figure out is how to add a page title to the blueprint. I would like the page title to be a mixture of text provider by the user in the create page dialog wizard and my own text.
Example: user enters a product name in one of the input fields in the blueprint create dialog wizard and I add "Release notes 2014" so the page title would be "Product Release Notes 2014".
So essentially i want to be able to grab a value from one of the inputs, concat some text to it and make it the page title of the page created.
Thanks
Community moderators have prevented the ability to post new answers.
I think you should extend com.atlassian.confluence.plugins.createcontent.api.contextproviders.AbstractBlueprintContextProvider.
There you override updateBlueprintContext(...).
Some pseudo code:
@Override protected BlueprintContext updateBlueprintContext( final BlueprintContext blueprintContext) { final String someValue = blueprintContext.get("someKey") final String title = "xxx" + someValue; blueprintContext.setTitle(title); blueprintContext.put("somethingElse", "...."); ... }
Add the context provider to your template in the atlassian-plugin.xml
<content-template key="..." ...> .... <context-provider class="com.example.MyProvider" /> </content-template>
Hope this helps.
Yep that worked. I am able to get the values from the form and populate the title based on them. Thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the benefit of those of us who are learning, could we see an example of actual code? Let's say we want the blueprint page name to say "Business Notes" rather than "Meeting Notes." For simplicity, we won't need to add dates or other unique identifiers - just change the page name.
May we see an example? Thanks in advance - all help is appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.