atlassian-scala-example-plugin / src / main / resources / atlassian-plugin.xml

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
    <plugin-info>
        <description>${project.description}</description>
        <version>${project.version}</version>
        <vendor name="${project.organization.name}" url="${project.organization.url}"/>
    </plugin-info>

    <resource type="i18n" name="i18n" location="com.atlassian.plugins.polyglot.strings"/>

    <resource name="img/" type="download" location="/img"/>

    <web-resource name="Web Resources" key="default-resources">
        <resource type="download" name="hipchat.js" location="/js/hipchat.js"/>
        <dependency>com.atlassian.auiplugin:ajs</dependency>
        <dependency>com.atlassian.soy.soy-template-plugin:soy-deps</dependency>
        <dependency>${project.groupId}.${project.artifactId}:soy-resources</dependency>
    </web-resource>

    <web-resource name="Web Resources" key="macro-resources">
        <resource type="download" name="hipchat-macro.js" location="/js/hipchat-macro.js"/>
        <dependency>com.atlassian.auiplugin:ajs</dependency>
        <dependency>com.atlassian.soy.soy-template-plugin:soy-deps</dependency>
        <dependency>${project.groupId}.${project.artifactId}:soy-resources</dependency>
    </web-resource>

    <web-resource key="soy-resources" name="Soy Resources">
        <transformation extension="soy">
            <transformer key="soyTransformer"/>
        </transformation>
        <resource type="download" name="room-list.js" location="/soy/room.soy"/>
    </web-resource>

    <xhtml-macro name="hipchat-room"
                 class="com.atlassian.plugins.polyglot.scalaexample.macro.HipChatMacro"
                 key="hipchat-macro"
                 icon="/download/resources/${project.groupId}.${project.artifactId}/img/hipchat-macrobrowser-icon.png">
        <category name="communication"/>
        <parameters>
            <parameter name="roomId" type="string" required="true">
                <alias name="room-id"/>
            </parameter>
        </parameters>
    </xhtml-macro>

    <!-- $CONTEXT_PATH/rest/hipchat/1.0/ -->
    <rest key="hipchat-rest-resources" path="/hipchat" version="1.0">
        <description>Provides the REST resource for this plugin.</description>
    </rest>

    <!-- $CONTEXT_PATH/plugins/servlet/hipchat -->
    <servlet name="HipChat View Servlet" key="view-servlet"
             class="com.atlassian.plugins.polyglot.scalaexample.servlet.HipChatViewServlet">
        <description>HipChat View Servlet</description>
        <url-pattern>/hipchat</url-pattern>
    </servlet>

    <servlet-filter name="Auth Filter" key="auth-filter"
                    class="com.atlassian.plugins.polyglot.scalaexample.servlet.AuthServletFilter"
                    location="before-decoration" weight="200">
        <description>Ensures that only authenticated users access the HipChat servlet</description>
        <url-pattern>/plugins/servlet/hipchat*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </servlet-filter>

    <component-import name="Request Factory" key="request-factory"
                      interface="com.atlassian.sal.api.net.RequestFactory"/>

    <component-import key="velocity-renderer" interface="com.atlassian.templaterenderer.TemplateRenderer"/>

    <component-import key="pluginSettingsFactory"
                      interface="com.atlassian.sal.api.pluginsettings.PluginSettingsFactory"/>

    <component name="Hip Chat Remote Service" key="hipchat-service"
               class="com.atlassian.plugins.polyglot.scalaexample.hipchat.RemoteRoomService"/>

    <component name="Custom Plugin Settings" key="custom-plugin-settings"
               class="com.atlassian.plugins.polyglot.scalaexample.DefaultPluginSettings"/>


    <xwork name="configurationAction" key="configurationAction">
        <package name="configure" extends="default" namespace="/admin">
            <default-interceptor-ref name="defaultStack"/>
            <action name="hipchat"
                    class="com.atlassian.plugins.polyglot.scalaexample.action.ViewApiKeyConfigurationAction">
                <result name="success" type="velocity">/templates/action/configuration.vm</result>
            </action>
            <action name="doconfigure-hipchat"
                    class="com.atlassian.plugins.polyglot.scalaexample.action.SaveApiKeyConfigurationAction">
                <interceptor-ref name="validatingStack"/>
                <param name="RequireSecurityToken">true</param>
                <result name="input" type="velocity">/templates/action/configuration.vm</result>
                <result name="error" type="velocity">/templates/action/configuration.vm</result>
                <result name="success" type="redirect">/admin/hipchat.action?result=success</result>
            </action>
        </package>
    </xwork>

    <web-item key="hipchat-configuration" name="HipChat Configuration" section="system.admin/configuration"
              weight="1000">
        <description key="hipchat-configuration.name">HipChat Configuration</description>
        <label key="hipchat-configuration.name"/>
        <link linkId="hipchat-configuration">/admin/hipchat.action</link>
        <condition class="com.atlassian.confluence.plugin.descriptor.web.conditions.ConfluenceAdministratorCondition"/>
    </web-item>

    <web-item key="confluence-example-servlet-link" name="HipChat Rooms"
              section="system.browse"
              weight="1000">
        <description key="links.global.linkto.example.servlet.desc">Simple example servlet</description>
        <label key="links.global.linkto.example.servlet.label"/>
        <link linkId="hipchatStart">/plugins/servlet/hipchat</link>
    </web-item>



</atlassian-plugin>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.