Revision 28b3f4aa
Added by Andreas Kohlbecker over 11 years ago
.gitattributes | ||
---|---|---|
1231 | 1231 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureSelectionDialog.java -text |
1232 | 1232 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureTreeSelectionDialog.java -text |
1233 | 1233 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FieldObservationSelectionDialog.java -text |
1234 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GrantedAuthoritySelectionDialog.java -text |
|
1234 | 1235 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GroupSelectionDialog.java -text |
1235 | 1236 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/InstitutionSelectionDialog.java -text |
1236 | 1237 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java -text |
eu.etaxonomy.taxeditor.cdmlib/.classpath | ||
---|---|---|
122 | 122 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.13-SNAPSHOT-sources.jar"/> |
123 | 123 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.13-SNAPSHOT.jar"/> |
124 | 124 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.13-SNAPSHOT-sources.jar"/> |
125 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.13-SNAPSHOT.jar"/> |
|
125 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.13-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.0.13-SNAPSHOT-sources.jar"/>
|
|
126 | 126 |
<classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/> |
127 | 127 |
<classpathentry kind="output" path="bin"/> |
128 | 128 |
</classpath> |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java | ||
---|---|---|
249 | 249 |
} |
250 | 250 |
|
251 | 251 |
/** |
252 |
* Generic method that will return an implementation of the given service |
|
253 |
* interface or <code>null</code> if the |
|
252 |
* Generic method that will scan the getters of {@link ICdmApplicationConfiguration} for the given service |
|
253 |
* interface. If a matching getter is found the according service implementation is returned by |
|
254 |
* invoking the getter otherwise the method returns <code>null</code>. |
|
254 | 255 |
* |
255 | 256 |
* @param <T> |
256 | 257 |
* @param serviceClass |
257 |
* @return |
|
258 |
* @return the configured implementation of <code>serviceClass</code> or <code>null</code>
|
|
258 | 259 |
*/ |
259 | 260 |
public static <T extends IService> T getService(Class<T> serviceClass) { |
260 | 261 |
ICdmApplicationConfiguration configuration = getCurrentApplicationConfiguration(); |
261 | 262 |
|
262 |
Method[] methods = ICdmApplicationConfiguration.class |
|
263 |
.getDeclaredMethods(); |
|
263 |
Method[] methods = ICdmApplicationConfiguration.class.getDeclaredMethods(); |
|
264 | 264 |
|
265 | 265 |
T service = null; |
266 | 266 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java | ||
---|---|---|
493 | 493 |
public void update(CdmDataChangeMap changeEvents) {} |
494 | 494 |
|
495 | 495 |
/** |
496 |
* Don't want to add a taxon or synonym to itself so filter the list to remove the taxon in question |
|
497 |
* so it is not available to add as a concept relation |
|
496 |
* Don't want to add for example a taxon or synonym to itself |
|
497 |
* so filter the list to remove the taxon in question |
|
498 |
* (<code>cdmBaseToBeFiltered</code>) |
|
499 |
* so it is not available in the filtered list. |
|
498 | 500 |
*/ |
499 | 501 |
private void filterExcludedObjects() { |
500 | 502 |
if (model != null && cdmBaseToBeFiltered != null) { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GrantedAuthoritySelectionDialog.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.ui.dialog.selection; |
|
12 |
|
|
13 |
import java.util.ArrayList; |
|
14 |
import java.util.List; |
|
15 |
import java.util.UUID; |
|
16 |
|
|
17 |
import org.eclipse.swt.widgets.Shell; |
|
18 |
import org.springframework.security.core.GrantedAuthority; |
|
19 |
|
|
20 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
21 |
import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService; |
|
22 |
import eu.etaxonomy.cdm.api.service.IGroupService; |
|
23 |
import eu.etaxonomy.cdm.api.service.IUserService; |
|
24 |
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl; |
|
25 |
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache; |
|
26 |
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard; |
|
27 |
import eu.etaxonomy.taxeditor.newWizard.NewGroupWizard; |
|
28 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
29 |
|
|
30 |
/** |
|
31 |
* @author a.kohlbecker |
|
32 |
* @created Sept 12, 2011 |
|
33 |
* @version 1.0 |
|
34 |
*/ |
|
35 |
public class GrantedAuthoritySelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<GrantedAuthorityImpl> { |
|
36 |
|
|
37 |
public static GrantedAuthority select(Shell shell, ConversationHolder conversation, GrantedAuthorityImpl authority){ |
|
38 |
|
|
39 |
GrantedAuthoritySelectionDialog dialog = new GrantedAuthoritySelectionDialog(shell, conversation, |
|
40 |
"Choose Granted Authority", false, GrantedAuthoritySelectionDialog.class.getCanonicalName(), authority); |
|
41 |
|
|
42 |
return getSelectionFromDialog(dialog); |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* @param shell |
|
47 |
* @param conversation |
|
48 |
* @param title |
|
49 |
* @param multi |
|
50 |
* @param settings |
|
51 |
* @param cdmObject |
|
52 |
*/ |
|
53 |
protected GrantedAuthoritySelectionDialog(Shell shell, |
|
54 |
ConversationHolder conversation, String title, boolean multi, |
|
55 |
String settings, GrantedAuthorityImpl cdmObject) { |
|
56 |
super(shell, conversation, title, multi, settings, cdmObject); |
|
57 |
} |
|
58 |
|
|
59 |
/* (non-Javadoc) |
|
60 |
* @see eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#initModel() |
|
61 |
*/ |
|
62 |
@Override |
|
63 |
protected void initModel() { |
|
64 |
List<GrantedAuthorityImpl> authorities = CdmStore.getService(IGrantedAuthorityService.class).list(GrantedAuthorityImpl.class, null, null, null, null); |
|
65 |
|
|
66 |
model = new ArrayList<UuidAndTitleCache<GrantedAuthorityImpl>>(); |
|
67 |
|
|
68 |
for(GrantedAuthorityImpl authority : authorities){ |
|
69 |
model.add(new UuidAndTitleCache<GrantedAuthorityImpl>(GrantedAuthorityImpl.class, authority.getUuid(),String.format("%s", authority.getAuthority()))); |
|
70 |
} |
|
71 |
} |
|
72 |
|
|
73 |
/* (non-Javadoc) |
|
74 |
* @see eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText() |
|
75 |
*/ |
|
76 |
@Override |
|
77 |
protected String getNewWizardLinkText() { |
|
78 |
return "Create a new <A>GrantedAuthority</A>."; |
|
79 |
} |
|
80 |
|
|
81 |
/* (non-Javadoc) |
|
82 |
* @see eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard(java.lang.String) |
|
83 |
*/ |
|
84 |
@Override |
|
85 |
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) { |
|
86 |
return new NewGroupWizard(); |
|
87 |
} |
|
88 |
|
|
89 |
/* (non-Javadoc) |
|
90 |
* @see eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID) |
|
91 |
*/ |
|
92 |
@Override |
|
93 |
protected GrantedAuthorityImpl getPersistentObject(UUID uuid) { |
|
94 |
return CdmStore.getService(IGrantedAuthorityService.class).load(uuid); |
|
95 |
} |
|
96 |
|
|
97 |
@Override |
|
98 |
protected String getTitle(GrantedAuthorityImpl authority) { |
|
99 |
return authority != null ? authority.getAuthority() : ""; |
|
100 |
} |
|
101 |
|
|
102 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GrantedAuthorityDetailSection.java | ||
---|---|---|
17 | 17 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
18 | 18 |
import eu.etaxonomy.cdm.model.common.Group; |
19 | 19 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
20 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.GrantedAuthoritySelectionDialog; |
|
20 | 21 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
21 | 22 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
22 | 23 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection; |
... | ... | |
62 | 63 |
*/ |
63 | 64 |
@Override |
64 | 65 |
public GrantedAuthority createNewElement() { |
65 |
StoreUtil |
|
66 |
.warningDialog("Not implemented yet", getClass(), |
|
67 |
"This functionality needs to be implemented in CDM Library first."); |
|
68 |
// TODO GrantedAuthoritySelectionDialog.select(...); |
|
69 |
GrantedAuthority selection = null;
|
|
66 |
// StoreUtil
|
|
67 |
// .warningDialog("Not implemented yet", getClass(),
|
|
68 |
// "This functionality needs to be implemented in CDM Library first.");
|
|
69 |
|
|
70 |
GrantedAuthority selection = GrantedAuthoritySelectionDialog.select(getLayoutComposite().getShell(), getConversationHolder(), null);
|
|
70 | 71 |
return selection; |
71 | 72 |
} |
72 | 73 |
|
... | ... | |
101 | 102 |
*/ |
102 | 103 |
@Override |
103 | 104 |
public String getEmptyString() { |
104 |
return "No Granted Athorities yet."; |
|
105 |
return "No Granted Authorities yet.";
|
|
105 | 106 |
} |
106 | 107 |
|
107 | 108 |
/* |
Also available in: Unified diff
GrantedAuthoritySelectionDialog implemented for #2990 (implement missing parts of Groups admin details view)