-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from baloise/master
7.0.2
- Loading branch information
Showing
36 changed files
with
1,352 additions
and
1,226 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
/src/test/resources/signature-test.ser | ||
|
||
/.settings | ||
/.classpath | ||
/.project | ||
/target | ||
|
||
.idea | ||
*.iml | ||
*.iml |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
- check fixed issues are assigned to milestone : https://github.com/baloise/digital-signature/milestones | ||
- check fixed issues are assigned to milestone: https://github.com/baloise/digital-signature/milestones | ||
- increase version in POM | ||
- mvn clean package | ||
- `mvn clean package` | ||
- merge onto release branch | ||
- set tag | ||
- push and wait for https://travis-ci.org/baloise/digital-signature/branches to succeed | ||
- create a version in marketplace https://marketplace.atlassian.com/manage/plugins/com.baloise.confluence.digital-signature/versions and upload obr ( from https://github.com/baloise/digital-signature/tree/gh-pages/release ) | ||
- create a version in marketplace https://marketplace.atlassian.com/manage/plugins/com.baloise.confluence.digital-signature/versions and upload obr (from https://github.com/baloise/digital-signature/tree/gh-pages/release) |
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 |
---|---|---|
@@ -1,32 +1,42 @@ | ||
Install | ||
# Install | ||
https://www.atlassian.com/software/confluence/download-archives | ||
|
||
Apache Commons FileUpload Bundle | ||
- Apache Commons FileUpload Bundle | ||
http://central.maven.org/maven2/commons-fileupload/commons-fileupload/1.3/commons-fileupload-1.3.jar | ||
Atlassian PDK Install Plugin | ||
- Atlassian PDK Install Plugin | ||
http://maven-us.nuxeo.org/nexus/content/repositories/public/com/atlassian/pdkinstall/pdkinstall-plugin/0.6/pdkinstall-plugin-0.6.jar | ||
|
||
License | ||
## License | ||
https://my.atlassian.com/products/index | ||
|
||
Run | ||
# Run | ||
```shell script | ||
set CATALINA_HOME=C:\Users\Public\dev\atlas\Confluence | ||
set JPDA_ADDRESS=4444 | ||
set JPDA_TRANSPORT=dt_socket | ||
%CATALINA_HOME%\bin\catalina.bat jpda start | ||
``` | ||
|
||
http://127.0.0.1:8090/ | ||
```shell script | ||
atlas-install-plugin -p 8090 --context-path / --plugin-key com.baloise.confluence.digital-signature | ||
``` | ||
|
||
or uncomment the atlassian-pdk configuration in pom.xml and use | ||
mvn package confluence:install | ||
|
||
------------------- | ||
|
||
Pure Maven setup ( not for the faint of heart, starup is slow on my box) | ||
Pure Maven setup (not for the faint of heart, startup is slow on my box) | ||
you will be able to remote debug on port 5005 | ||
|
||
```shell script | ||
mvn confluence:debug -Dproduct.version=7.4.0 | ||
``` | ||
|
||
To redeploy use | ||
```shell script | ||
mvn package confluence:install -Dproduct.version=7.4.0 | ||
``` | ||
|
||
As smtp server use | ||
https://mailtrap.io/ | ||
As smtp server use `https://mailtrap.io/` |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
We do not transfer or store any data outside your Atlassian product. | ||
|
||
We have no access to any data your stored within your Atlassian product. | ||
|
||
You data is yours - no strings attached. | ||
- We do not transfer or store any data outside your Atlassian product. | ||
- We have no access to any data you stored within your Atlassian product. | ||
- Your data is yours - no strings attached. |
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 |
---|---|---|
@@ -1 +1 @@ | ||
Icon made by http://www.flaticon.com/authors/freepik | ||
Icon made by http://www.flaticon.com/authors/freepik |
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
129 changes: 61 additions & 68 deletions
129
src/main/java/com/baloise/confluence/digitalsignature/ContextHelper.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 |
---|---|---|
@@ -1,76 +1,69 @@ | ||
package com.baloise.confluence.digitalsignature; | ||
|
||
import static java.lang.String.format; | ||
|
||
import java.util.Comparator; | ||
import java.util.Date; | ||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
import java.util.Set; | ||
import java.util.SortedSet; | ||
import java.util.TreeSet; | ||
|
||
import com.atlassian.sal.api.user.UserManager; | ||
import com.atlassian.sal.api.user.UserProfile; | ||
import com.baloise.confluence.digitalsignature.sal.DummyProfile; | ||
|
||
import java.util.*; | ||
import java.util.Map.Entry; | ||
import java.util.function.Function; | ||
|
||
import static java.lang.String.format; | ||
|
||
public class ContextHelper { | ||
public Object getOrderedSignatures(Signature signature) { | ||
Comparator<Entry<String, Date>> comparator = new Comparator<Entry<String, Date>>() { | ||
@Override | ||
public int compare(Entry<String, Date> s1, Entry<String, Date> s2) { | ||
int ret = s1.getValue().compareTo(s2.getValue()); | ||
return ret == 0 ? s1.getKey().compareTo(s2.getKey()) : ret; | ||
} | ||
}; | ||
SortedSet<Entry<String, Date>> ret = new TreeSet<Map.Entry<String,Date>>(comparator); | ||
ret.addAll(signature.getSignatures().entrySet()); | ||
return ret; | ||
} | ||
public <K,V> Map<K,V> union(Map<K,V> ...maps) { | ||
Map<K,V> union = new HashMap<K,V>(); | ||
for (Map<K, V> map : maps) { | ||
union.putAll(map); | ||
} | ||
return union; | ||
} | ||
|
||
public <K> Set<K> union(Set<K> ...sets) { | ||
Set<K> union = new HashSet<K>(); | ||
for (Set<K> set : sets) { | ||
union.addAll(set); | ||
} | ||
return union; | ||
} | ||
|
||
public Map<String, UserProfile> getProfiles(UserManager userManager, Set<String> userNames) { | ||
Map<String, UserProfile> ret = new HashMap<String, UserProfile>(); | ||
if(Signature.isPetitionMode(userNames)) return ret; | ||
for (String userName : userNames) { | ||
ret.put(userName, getProfileNotNull(userManager, userName)); | ||
} | ||
return ret; | ||
} | ||
public UserProfile getProfileNotNull(UserManager userManager, String userName) { | ||
UserProfile profile = userManager.getUserProfile(userName); | ||
return profile == null ? new DummyProfile(userName) : profile; | ||
} | ||
|
||
public SortedSet<UserProfile> getOrderedProfiles(UserManager userManager, Set<String> userNames) { | ||
SortedSet<UserProfile> ret = new TreeSet<UserProfile>(new UserProfileByName()); | ||
if(Signature.isPetitionMode(userNames)) return ret; | ||
for (String userName : userNames) { | ||
ret.add(getProfileNotNull(userManager, userName)); | ||
} | ||
return ret; | ||
} | ||
public String mailTo(UserProfile profile) { | ||
return format("%s<%s>", profile.getFullName().trim(), profile.getEmail().trim()); | ||
} | ||
public boolean hasEmail(UserProfile profile) { | ||
return profile != null && profile.getEmail() != null && !profile.getEmail().trim().isEmpty(); | ||
} | ||
|
||
public Object getOrderedSignatures(Signature signature) { | ||
SortedSet<Entry<String, Date>> ret = new TreeSet<>(Comparator.comparing((Function<Entry<String, Date>, Date>) Entry::getValue) | ||
.thenComparing(Entry::getKey)); | ||
ret.addAll(signature.getSignatures().entrySet()); | ||
return ret; | ||
} | ||
|
||
@SafeVarargs | ||
public final <K, V> Map<K, V> union(Map<K, V>... maps) { | ||
Map<K, V> union = new HashMap<>(); | ||
for (Map<K, V> map : maps) { | ||
union.putAll(map); | ||
} | ||
return union; | ||
} | ||
|
||
@SafeVarargs | ||
public final <K> Set<K> union(Set<K>... sets) { | ||
Set<K> union = new HashSet<>(); | ||
for (Set<K> set : sets) { | ||
union.addAll(set); | ||
} | ||
return union; | ||
} | ||
|
||
public Map<String, UserProfile> getProfiles(UserManager userManager, Set<String> userNames) { | ||
Map<String, UserProfile> ret = new HashMap<>(); | ||
if (Signature.isPetitionMode(userNames)) return ret; | ||
for (String userName : userNames) { | ||
ret.put(userName, getProfileNotNull(userManager, userName)); | ||
} | ||
return ret; | ||
} | ||
|
||
public UserProfile getProfileNotNull(UserManager userManager, String userName) { | ||
UserProfile profile = userManager.getUserProfile(userName); | ||
return profile == null ? new DummyProfile(userName) : profile; | ||
} | ||
|
||
public SortedSet<UserProfile> getOrderedProfiles(UserManager userManager, Set<String> userNames) { | ||
SortedSet<UserProfile> ret = new TreeSet<>(new UserProfileByName()); | ||
if (Signature.isPetitionMode(userNames)) return ret; | ||
for (String userName : userNames) { | ||
ret.add(getProfileNotNull(userManager, userName)); | ||
} | ||
return ret; | ||
} | ||
|
||
public String mailTo(UserProfile profile) { | ||
return format("%s<%s>", profile.getFullName().trim(), profile.getEmail().trim()); | ||
} | ||
|
||
public boolean hasEmail(UserProfile profile) { | ||
return profile != null && profile.getEmail() != null && !profile.getEmail().trim().isEmpty(); | ||
} | ||
} |
Oops, something went wrong.