BrightSide Workbench Full Report + Source Code
org.turro.contacts.proposal.ProposalSet Class Reference
Inheritance diagram for org.turro.contacts.proposal.ProposalSet:
Collaboration diagram for org.turro.contacts.proposal.ProposalSet:

Public Member Functions

void loadFromVCards (Application app, final Command command)
 

Static Public Member Functions

static void serialize (Application app, ProposalSet instance)
 
static ProposalSet deserialize (Application app)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 39 of file ProposalSet.java.

Member Function Documentation

◆ deserialize()

static ProposalSet org.turro.contacts.proposal.ProposalSet.deserialize ( Application  app)
static

Definition at line 84 of file ProposalSet.java.

84  {
85  ProposalSet result = new ProposalSet();
86  if(app.isInRole("contact-proposal:list")) {
87  ProposalSet ps = (ProposalSet) Serializer.deserialize("/proposals/data.ser");
88  if(ps != null) result.addAll(ps);
89  File[] fs = Serializer.getFiles("/proposals/imported");
90  if(fs != null) {
91  for(File f : fs) {
92  ps = (ProposalSet) Serializer.deserialize(f);
93  if(ps != null) result.addAll(ps);
94  f.delete();
95  }
96  }
97  ProposalSet.serialize(app, result);
98  } else if(app.isInRole("contact-proposal:import")) {
99  ProposalSet ps = (ProposalSet) Serializer.deserialize("/proposals/imported/" + Authentication.getIContact().getId() + ".ser");
100  if(ps != null) result.addAll(ps);
101  }
102  return result;
103  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFromVCards()

void org.turro.contacts.proposal.ProposalSet.loadFromVCards ( Application  app,
final Command  command 
)

Definition at line 43 of file ProposalSet.java.

43  {
44  final IPlugin plugin = Plugins.loadImplementation(IPlugin.class, "vcard");
45  if(plugin != null) {
46  plugin.setData("constructor", app.getConstructor());
47  if(command != null) {
48  FileWrapper fw = new FileWrapper((File) plugin.getData("importFolder"));
49  fw.upload(new Command() {
50  @Override
51  public Object execute(Context context) {
52  addProposals(plugin);
53  command.execute(context);
54  return null;
55  }
56  });
57  return;
58  } else {
59  addProposals(plugin);
60  }
61  }
62  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ serialize()

static void org.turro.contacts.proposal.ProposalSet.serialize ( Application  app,
ProposalSet  instance 
)
static

Definition at line 76 of file ProposalSet.java.

76  {
77  if(app.isInRole("contact-proposal:list")) {
78  Serializer.serialize("/proposals/data.ser", instance);
79  } else if(app.isInRole("contact-proposal:import")) {
80  Serializer.serialize("/proposals/imported/" + Authentication.getIContact().getId() + ".ser", instance);
81  }
82  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: