BrightSide Workbench Full Report + Source Code
org.turro.importer.ImporterVM Class Reference

Public Member Functions

WsMember getMember ()
 
void setMember (WsMember member)
 
ImporterProvider getProvider ()
 
void setProvider (ImporterProvider provider)
 
void upload (@BindingParam("medias") Media medias[])
 
boolean isFullImport ()
 
void setFullImport (boolean fullImport)
 
void doImport ()
 
List< String > getHeaders ()
 
List< ImporterRegister > getData ()
 
List< WsMembergetMemberModel ()
 
List< ImporterProvidergetProviderModel ()
 

Detailed Description

Member Function Documentation

◆ doImport()

void org.turro.importer.ImporterVM.doImport ( )

Definition at line 92 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

92  {
93  if(provider != null) {
94  Dialogs.title(I_.get("Import data"))
95  .width("400px")
96  .height("200px")
97  .addField(DialogField.label(isFullImport() ?
98  "Importing removes previous data and replace it with the uploaded data. Want to proceed?" :
99  "Imported data will be added to current data. Want to proceed?"))
100  .onOk((dialogs) -> {
101  provider.processData(member);
102  provider.clear();
103  BindUtils.postNotifyChange(null, null, ImporterVM.this, "headers", "data");
104  })
105  .emptyCancel()
106  .show();
107  }
108  }
void processData(WsMember member)
Here is the call graph for this function:

◆ getData()

List<ImporterRegister> org.turro.importer.ImporterVM.getData ( )

Definition at line 117 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

117  {
118  if(provider != null) {
119  return provider.getData();
120  }
121  return null;
122  }
List< ImporterRegister > getData()
Here is the call graph for this function:

◆ getHeaders()

List<String> org.turro.importer.ImporterVM.getHeaders ( )

Definition at line 110 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

110  {
111  if(provider != null) {
112  return provider.getHeaders();
113  }
114  return null;
115  }
Here is the call graph for this function:

◆ getMember()

WsMember org.turro.importer.ImporterVM.getMember ( )

Definition at line 47 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

47  {
48  return member;
49  }

◆ getMemberModel()

List<WsMember> org.turro.importer.ImporterVM.getMemberModel ( )

Definition at line 124 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

124  {
125  return Clients.getMembersFor(Authentication.getIContact());
126  }
Here is the call graph for this function:

◆ getProvider()

ImporterProvider org.turro.importer.ImporterVM.getProvider ( )

Definition at line 57 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

57  {
58  return provider;
59  }

◆ getProviderModel()

List<ImporterProvider> org.turro.importer.ImporterVM.getProviderModel ( )

Definition at line 128 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

128  {
129  if(member != null) {
130  return Instances.cached().bySuper(AbstractImporterProvider.class, ImporterProvider.class)
131  .stream().filter(p -> p.getService().equals(member.getService()) && p.inRole()).toList();
132  }
133  return Collections.EMPTY_LIST;
134  }
Here is the call graph for this function:

◆ isFullImport()

boolean org.turro.importer.ImporterVM.isFullImport ( )

Definition at line 79 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

79  {
80  return provider != null && provider.isFullImport();
81  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFullImport()

void org.turro.importer.ImporterVM.setFullImport ( boolean  fullImport)

Definition at line 83 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

83  {
84  if(provider != null) {
85  this.provider.setFullImport(fullImport);
86  } else {
87  Toasts.message("Select provider first").show();
88  }
89  }
void setFullImport(boolean fullImport)
Here is the call graph for this function:

◆ setMember()

void org.turro.importer.ImporterVM.setMember ( WsMember  member)

Definition at line 52 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

52  {
53  if(provider != null) provider.clear();
54  this.member = member;
55  }
Here is the call graph for this function:

◆ setProvider()

void org.turro.importer.ImporterVM.setProvider ( ImporterProvider  provider)

Definition at line 62 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

62  {
63  if(provider != null) provider.clear();
64  this.provider = provider;
65  }
Here is the call graph for this function:

◆ upload()

void org.turro.importer.ImporterVM.upload ( @BindingParam("medias") Media  medias[])

Definition at line 69 of file elephant-www/src/main/java/org/turro/importer/ImporterVM.java.

69  {
70  if(provider != null) {
71  provider.clear();
72  for(Media media : medias) {
73  provider.setType(media.getName());
74  provider.importData(Medias.toReader(media));
75  }
76  }
77  }
void setType(ImporterDataType type)
Here is the call graph for this function:

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