-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Not sure why the space admin doesn't display inside the space admin section. I have opened this question: https://answers.atlassian.com/questions/67965/how-do-i-render-an-xwork-action-inside-a-space-admin-page
- Loading branch information
Showing
4 changed files
with
150 additions
and
2 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...a/com/drunkendev/confluence/plugins/attachments/ConfigurePurgeAttachmentsSpaceAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* ConfigurePurgeAttachmentsSpaceAction.java Jul 10 2012, 02:49 | ||
* | ||
* Copyright 2012 Drunken Dev. All rights reserved. | ||
* Use is subject to license terms. | ||
*/ | ||
|
||
package com.drunkendev.confluence.plugins.attachments; | ||
|
||
import com.atlassian.confluence.security.Permission; | ||
import com.atlassian.confluence.spaces.actions.AbstractSpaceAction; | ||
import com.atlassian.confluence.spaces.actions.SpaceAware; | ||
|
||
|
||
/** | ||
* Action to configure space attachment purging. | ||
* | ||
* @author Brett Ryan | ||
*/ | ||
public class ConfigurePurgeAttachmentsSpaceAction | ||
extends AbstractSpaceAction implements SpaceAware { | ||
|
||
/** | ||
* Creates a new {@code ConfigurePurgeAttachmentsSpaceAction} instance. | ||
*/ | ||
public ConfigurePurgeAttachmentsSpaceAction() { | ||
} | ||
|
||
@Override | ||
public boolean isSpaceRequired() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isViewPermissionRequired() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isPermitted() { | ||
return getRemoteUser() != null | ||
&& getSpace() != null | ||
&& permissionManager.hasPermission(getRemoteUser(), | ||
Permission.ADMINISTER, | ||
getSpace()); | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
...om/drunkendev/confluence/plugins/attachments/ConfigurePurgeAttachmentsSpaceCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* ConfigurePurgeAttachmentsSpaceCondition.java Jul 10 2012, 02:27 | ||
* | ||
* Copyright 2012 Drunken Dev. All rights reserved. | ||
* Use is subject to license terms. | ||
*/ | ||
|
||
package com.drunkendev.confluence.plugins.attachments; | ||
|
||
import com.atlassian.confluence.plugin.descriptor.web.WebInterfaceContext; | ||
import com.atlassian.confluence.plugin.descriptor.web.conditions.BaseConfluenceCondition; | ||
import com.atlassian.confluence.security.Permission; | ||
import com.atlassian.confluence.security.PermissionManager; | ||
|
||
|
||
/** | ||
* Condition to show the purging options against a space. | ||
* | ||
* @author Brett Ryan | ||
*/ | ||
public class ConfigurePurgeAttachmentsSpaceCondition extends BaseConfluenceCondition { | ||
|
||
private PermissionManager permissionManager; | ||
|
||
/** | ||
* Creates a new {@code ConfigurePurgeAttachmentsSpaceCondition} instance. | ||
*/ | ||
public ConfigurePurgeAttachmentsSpaceCondition() { | ||
} | ||
|
||
public void setPermissionManager(PermissionManager permissionManager) { | ||
this.permissionManager = permissionManager; | ||
} | ||
|
||
@Override | ||
protected boolean shouldDisplay(WebInterfaceContext wic) { | ||
return wic.getUser() != null | ||
&& wic.getSpace() != null | ||
&& permissionManager.hasPermission(wic.getUser(), | ||
Permission.ADMINISTER, | ||
wic.getSpace()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/resources/templates/purge-attachments/config/configure-purge-attachments-space.vm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<html> | ||
<head> | ||
<title>$action.getText("com.drunkendev.confluence.plugins.attachment-tools.config.title")</title> | ||
</head> | ||
<body> | ||
<p> | ||
<strong>TODO</strong>: Implement configuration for handling space | ||
settings. Settigns may include but are not limited to: | ||
</p> | ||
<ul> | ||
<li> | ||
<strong>Process by age</strong>: Prior attachment versions may only be | ||
kept if the attachment's modified date is within a given period. | ||
</li> | ||
<li> | ||
<strong>Process by limits</strong>: Allows specifying a maximum count | ||
of prior versions for each attachment. | ||
</li> | ||
<li> | ||
<strong>Process by total size limit</strong>: Allow all versions of an | ||
attachment to not exceede a given size limit. If the size limit is | ||
imposed then prior versions are deleted until the limit is satisfied. | ||
</li> | ||
<li> | ||
<strong>Report only</strong>: Do not perform any action, just use the | ||
email alerting function which must be present. | ||
</li> | ||
<li> | ||
<strong>Email alerting</strong>: Email results to a given email address | ||
or user. | ||
</li> | ||
</ul> | ||
</body> | ||
</html> |