From 8d2dd3fea73f3f67f6eba267fe10142385c59a3f Mon Sep 17 00:00:00 2001 From: Brett Ryan Date: Mon, 16 Jul 2012 10:24:46 +1000 Subject: [PATCH] Releasing version 0.9-preview for testing. --- pom.xml | 25 +++++++++++++++++-- .../attachments/PurgeAttachmentsJob.java | 17 +++++++++++-- src/main/resources/atlassian-plugin.xml | 8 +++--- src/main/resources/i18n.properties | 16 +++++++++--- .../configure-purge-attachments-common.vm | 6 +++++ 5 files changed, 61 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 1e7d527..333df60 100644 --- a/pom.xml +++ b/pom.xml @@ -11,14 +11,15 @@ com.drunkendev.confluence.plugins attachment-tools-plugin Attachment Tools Plugin - 1.0-SNAPSHOT + 0.9-PREVIEW - 4.3-beta1 + 4.2.4 4.2.4 3.11 UTF-8 dd + ${project.groupId}.${project.artifactId} @@ -62,6 +63,26 @@ + + + + src/main/resources + false + + **/*.properties + **/*.xml + + + + src/main/resources + true + + **/*.properties + **/*.xml + + + + com.atlassian.maven.plugins diff --git a/src/main/java/com/drunkendev/confluence/plugins/attachments/PurgeAttachmentsJob.java b/src/main/java/com/drunkendev/confluence/plugins/attachments/PurgeAttachmentsJob.java index b15c718..bacdf61 100644 --- a/src/main/java/com/drunkendev/confluence/plugins/attachments/PurgeAttachmentsJob.java +++ b/src/main/java/com/drunkendev/confluence/plugins/attachments/PurgeAttachmentsJob.java @@ -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; @@ -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. @@ -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; @@ -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); @@ -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) { @@ -303,6 +309,7 @@ private void mailResultsHtml(Map> 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 }"); @@ -313,6 +320,12 @@ private void mailResultsHtml(Map> mailEntries1) throw sb.append(""); + sb.append("
"); + sb.append("NOTE: 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("
"); + sb.append("

"); sb.append("This message is to inform you that the following prior"); sb.append(" attachment versions have been removed from confluence"); diff --git a/src/main/resources/atlassian-plugin.xml b/src/main/resources/atlassian-plugin.xml index 8e96a35..e236f86 100644 --- a/src/main/resources/atlassian-plugin.xml +++ b/src/main/resources/atlassian-plugin.xml @@ -1,6 +1,6 @@ - @@ -12,16 +12,16 @@ /admin/plugins/attachment-tools/configure.action - - - diff --git a/src/main/resources/i18n.properties b/src/main/resources/i18n.properties index f852c52..9b109e0 100644 --- a/src/main/resources/i18n.properties +++ b/src/main/resources/i18n.properties @@ -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 diff --git a/src/main/resources/templates/purge-attachments/config/configure-purge-attachments-common.vm b/src/main/resources/templates/purge-attachments/config/configure-purge-attachments-common.vm index 90a2320..63a3ca2 100644 --- a/src/main/resources/templates/purge-attachments/config/configure-purge-attachments-common.vm +++ b/src/main/resources/templates/purge-attachments/config/configure-purge-attachments-common.vm @@ -1,6 +1,12 @@

Processing Rules

+
+ NOTE: Attachment purging is currently disabled for this + version of the plugin. This will be enabled once confluence 4.3 becomes + available. +
+
Maximum days old