This server will be upgraded to the latest 2.9 milestone around 6am Sydney time Monday the 28th of July and will experience downtime.
Added by Jonathan Nolen, last edited by Jonathan Nolen on Feb 19, 2008  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Use your own package name

Don't just use com.atlassian.confluence.plugins.* for your code. That ends up being confusing to people who try to use the plugin. Use a real package name that corresponds to your developing entity. So: org.mycompany.confluence.plugins.* or similar.

Namespace your CSS and Javascript

We can't promise that our products CSS and Javascript isn't going to change from version to version. For that reason, you are generally best off writing CSS and Javascript that does not depend on the products' at all. One of the best ways to do this is namespace your CSS and Javascript.

In the CSS realm, there is an official namespace proposal, but that's not what I'm talking about as the current browser crop doesn't support these enhancements yet. ALl I'm really talking about is intelligently naming your selectors so that you don't bleed styles between your plugin and the product itself. For example, rather than having an element like:

<table class="table">...</table>

you might try

<table class="MyPluginName_table">...</table>

That will ensure that your CSS rules don't get applied to anyone else's plugins, and you don't inadvertently pick up a style from Confluence's table class that may change in the future.

On the Javascript side, you run an even greater risk of conflicting with the product or with another plugin. For that reason, you should namespace your javascript as outlined in this tutorial.. Our products don't actually follow this rule yet, so it's doubly important for plugins to do so.

Application-Specific Best Practices

Confluence:

JIRA: