Revision 50818ab7
Added by Katja Luther over 8 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/globis/GlobisActivator.java | ||
---|---|---|
17 | 17 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
18 | 18 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
19 | 19 |
import eu.etaxonomy.cdm.app.common.CdmImportSources; |
20 |
import eu.etaxonomy.cdm.common.AccountStore; |
|
21 |
import eu.etaxonomy.cdm.common.CdmUtils; |
|
20 | 22 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
21 | 23 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
22 | 24 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
... | ... | |
26 | 28 |
import eu.etaxonomy.cdm.io.common.Source; |
27 | 29 |
import eu.etaxonomy.cdm.io.globis.GlobisImportConfigurator; |
28 | 30 |
import eu.etaxonomy.cdm.model.common.ISourceable; |
31 |
import eu.etaxonomy.cdm.model.common.User; |
|
29 | 32 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
30 | 33 |
import eu.etaxonomy.cdm.model.name.ZoologicalName; |
31 | 34 |
|
... | ... | |
133 | 136 |
CdmDefaultImport<GlobisImportConfigurator> globisImport = new CdmDefaultImport<GlobisImportConfigurator>(); |
134 | 137 |
globisImport.invoke(config); |
135 | 138 |
|
139 |
if (config.isDoNewUser()){ |
|
140 |
//single user or all |
|
141 |
|
|
142 |
String user = CdmUtils.readInputLine("Please insert username : "); |
|
143 |
String pwd = CdmUtils.readInputLine("Please insert password for user '" + CdmUtils.Nz(user) + "': "); |
|
144 |
ICdmApplicationConfiguration app = globisImport.getCdmAppController(); |
|
145 |
app.getUserService().save(User.NewInstance(user, pwd)); |
|
146 |
} |
|
147 |
|
|
136 | 148 |
if (config.getCheck().equals(CHECK.CHECK_AND_IMPORT) || config.getCheck().equals(CHECK.IMPORT_WITHOUT_CHECK) ){ |
137 | 149 |
ICdmApplicationConfiguration app = globisImport.getCdmAppController(); |
138 | 150 |
ISourceable<?> obj = app.getCommonService().getSourcedObjectByIdInSource(ZoologicalName.class, "1000027", null); |
Also available in: Unified diff
adapt the import classes to the new return type ImportResult