Skip to content

Commit

Permalink
Releasing version 0.9-preview for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
brettryan committed Jul 16, 2012
1 parent fb4077d commit 8d2dd3f
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 11 deletions.
25 changes: 23 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
<groupId>com.drunkendev.confluence.plugins</groupId>
<artifactId>attachment-tools-plugin</artifactId>
<name>Attachment Tools Plugin</name>
<version>1.0-SNAPSHOT</version>
<version>0.9-PREVIEW</version>

<properties>
<confluence.version>4.3-beta1</confluence.version>
<confluence.version>4.2.4</confluence.version>
<confluence.data.version>4.2.4</confluence.data.version>
<amps.version>3.11</amps.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netbeans.hint.license>dd</netbeans.hint.license>
<key>${project.groupId}.${project.artifactId}</key>
</properties>

<dependencies>
Expand Down Expand Up @@ -62,6 +63,26 @@
</dependencies>

<build>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/*.properties</exclude>
<exclude>**/*.xml</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.drunkendev.confluence.plugins.attachments;

import com.atlassian.confluence.core.ConfluenceActionSupport;
import com.atlassian.confluence.mail.template.ConfluenceMailQueueItem;
import com.atlassian.confluence.pages.Attachment;
import com.atlassian.confluence.pages.AttachmentManager;
Expand Down Expand Up @@ -45,6 +46,7 @@ public class PurgeAttachmentsJob extends AbstractJob {
private PurgeAttachmentsSettingsService settingSvc;
private MultiQueueTaskManager mailQueueTaskManager;
private SettingsManager settingsManager;
private ConfluenceActionSupport confluenceActionSupport;

/**
* Creates a new {@code PurgeAttachmentsJob} instance.
Expand Down Expand Up @@ -73,6 +75,10 @@ public void setSettingsManager(SettingsManager settingsManager) {
this.settingsManager = settingsManager;
}

public void setConfluenceActionSupport(ConfluenceActionSupport confluenceActionSupport) {
this.confluenceActionSupport = confluenceActionSupport;
}

private PurgeAttachmentSettings getSettings(Space space, PurgeAttachmentSettings dflt) {
if (space == null) {
return null;
Expand Down Expand Up @@ -140,7 +146,7 @@ public void doExecute(JobExecutionContext jec) throws JobExecutionException {
for (Attachment p : toDelete) {
if (st.isReportOnly() || systemSettings.isReportOnly()) {
} else {
attachmentManager.removeAttachmentVersionFromServer(p);
//attachmentManager.removeAttachmentVersionFromServer(p);
}
}
MailLogEntry mle = new MailLogEntry(a, deletedVersions, st.isReportOnly() || systemSettings.isReportOnly(), st == systemSettings);
Expand Down Expand Up @@ -185,7 +191,7 @@ public int compare(Attachment t, Attachment t1) {
});

int to = -1;
int n = 0;
int n;
if (stng.isRevisionCountRuleEnabled()) {
n = filterRevisionCount(prior, stng.getMaxRevisions());
if (n > to) {
Expand Down Expand Up @@ -303,6 +309,7 @@ private void mailResultsHtml(Map<String, List<MailLogEntry>> mailEntries1) throw
sb.append("a { color: #326ca6; text-decoration: none; }");
sb.append("a:hover { color: #336ca6; text-decoration: underline; }");
sb.append("a:active { color: #326ca6; }");
sb.append("div.note { border: solid 1px #F0C000; padding: 5px; background-color: #FFFFCE; }");
sb.append("table { border-collapse: collapse; padding: 0; border: 0 none; }");
sb.append("th, td { padding: 5px 7px; border: solid 1px #ddd; text-align: left; vertical-align: top; color: #333; margin: 0; }");
sb.append("th { background-color: #f0f0f0 }");
Expand All @@ -313,6 +320,12 @@ private void mailResultsHtml(Map<String, List<MailLogEntry>> mailEntries1) throw

sb.append("<body>");

sb.append("<div class=\"note\">");
sb.append("<strong>NOTE</strong>: Attachment purging is currently disabled ")
.append("for this version of the plugin. This will be enabled ")
.append("once confluence 4.3 becomes available.");
sb.append("</div>");

sb.append("<p>");
sb.append("This message is to inform you that the following prior");
sb.append(" attachment versions have been removed from confluence");
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/atlassian-plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${project.groupId}.${project.artifactId}"
<atlassian-plugin key="${key}"
name="${project.name}"
plugins-version="2">

Expand All @@ -12,16 +12,16 @@
<param name="configure.url">/admin/plugins/attachment-tools/configure.action</param>
</plugin-info>

<component key="${project.groupId}.${project.artifactId}.purge-att-setting-svc"
<component key="${key}.purge-attachment-service"
name="Purge Attachment Settings Service"
alias="purgeAttSettingService"
class="com.drunkendev.confluence.plugins.attachments.PurgeAttachmentsSettingsService"/>

<web-item key="configure-purge-attachments-space"
<web-item key="configure-purge-attachments-space-item"
name="Configure Purge Attachments (Space)"
section="system.space.admin/spaceops"
weight="40">
<label key="Attachment Purging" />
<label key="${key}.config.purge"/>
<link>/spaces/configure-purge-attachments-space.action?key=$helper.space.key</link>
<condition class="com.drunkendev.confluence.plugins.attachments.ConfigurePurgeAttachmentsSpaceCondition"/>
</web-item>
Expand Down
16 changes: 13 additions & 3 deletions src/main/resources/i18n.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# Copyright 2010 John Sands (Australia) Ltd. All rights reserved.
# Use is subject to license terms. This is an unpublished work.
#
# i18n.properties
#
# Copyright 2012 Drunken Dev. All rights reserved.
# Use is subject to license terms.
#
# Author: Brett Ryan

# Attachment Purging - Job name.
scheduledjob.desc.purge-old-attachments-job=Purge Old Attachment Revisions

com.drunkendev.confluence.plugins.attachment-tools.config.title=Configure Attachment Purging
# Attachment Purging - Space menu-item config text.
com.drunkendev.confluence.plugins.attachment-tools-plugin.config.purge=Attachment Purging
# Attachment Purging - Space config path.
com.drunkendev.confluence.plugins.attachments.ConfigurePurgeAttachmentsAction.action.name=Configure Attachment Purging
# Attachment Purging - Config title (space and global).
com.drunkendev.confluence.plugins.attachment-tools.config.title=Configure Attachment Purging
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

<h2>Processing Rules</h2>

<div class="noteMacro">
<strong>NOTE</strong>: Attachment purging is currently disabled for this
version of the plugin. This will be enabled once confluence 4.3 becomes
available.
</div>

<fieldset class="group">
<div class="checkbox">
<legend><span>Maximum days old</span></legend>
Expand Down

0 comments on commit 8d2dd3f

Please sign in to comment.