18 package org.turro.contacts.proposal;
21 import java.io.Serializable;
22 import java.util.List;
23 import java.util.TreeSet;
24 import org.turro.action.Plugins;
25 import org.turro.auth.Authentication;
26 import org.turro.command.Command;
27 import org.turro.command.Context;
28 import org.turro.contacts.Contact;
29 import org.turro.elephant.context.Application;
30 import org.turro.elephant.impl.util.Serializer;
31 import org.turro.file.FileWrapper;
32 import org.turro.plugin.IPlugin;
33 import org.turro.plugin.contacts.IContact;
39 public class ProposalSet extends TreeSet<ContactProposal> implements Serializable {
41 private static final long serialVersionUID = 1;
51 public Object execute(Context context) {
53 command.execute(context);
64 private void addProposals(
IPlugin plugin) {
65 List<Contact> l = (List<Contact>) plugin.
getData(
"import");
70 l = (List<Contact>) plugin.
getData(
"importcsv");
72 add(
new ContactProposal(c,
"CSV Import [" + ic.
getName() +
"]"));
77 if(app.
isInRole(
"contact-proposal:list")) {
79 }
else if(app.
isInRole(
"contact-proposal:import")) {
86 if(app.
isInRole(
"contact-proposal:list")) {
88 if(ps !=
null) result.addAll(ps);
93 if(ps !=
null) result.addAll(ps);
98 }
else if(app.
isInRole(
"contact-proposal:import")) {
100 if(ps !=
null) result.addAll(ps);
static< T > T loadImplementation(Class< T > jclass)
static IContact getIContact()
IConstructor getConstructor()
boolean isInRole(String role)
static void serialize(String fileName, Object instance)
static Object deserialize(String fileName)
static File[] getFiles(String rootName)
void upload(final Command command)
Object getData(String id)
void setData(String id, Object data)