use of au.org.ala.spatial.composer.sandbox.SandboxPasteController in project spatial-portal by AtlasOfLivingAustralia.
the class ToolComposer method onClick$btnUpload.
public void onClick$btnUpload(Event event) {
try {
LOGGER.debug("onClick$btnUpload(Event event)");
if (StringUtils.isNotEmpty((String) CommonData.getSettings().getProperty("sandbox.url", null)) && CommonData.getSettings().getProperty("import.points.layers-service", "false").equals("false")) {
SandboxPasteController spc = (SandboxPasteController) Executions.createComponents("WEB-INF/zul/sandbox/SandboxPaste.zul", getMapComposer(), null);
spc.setAddToMap(true);
spc.setParent(getMapComposer());
spc.doModal();
} else {
UploadSpeciesController usc = (UploadSpeciesController) Executions.createComponents("WEB-INF/zul/input/UploadSpecies.zul", this, null);
if (rSpeciesUploadSpecies.isSelected()) {
usc.setTbInstructions("3. Select file (comma separated ID (text), longitude (decimal degrees), latitude(decimal degrees))");
} else if (rSpeciesUploadLSID.isSelected()) {
usc.setTbInstructions("3. Select file (text file, one LSID or name per line)");
} else {
usc.setTbInstructions("3. Select file");
}
usc.setAddToMap(true);
usc.setParent(this);
usc.doModal();
}
} catch (Exception e) {
LOGGER.error("file upload error", e);
}
}
use of au.org.ala.spatial.composer.sandbox.SandboxPasteController in project spatial-portal by AtlasOfLivingAustralia.
the class MapComposer method importSpecies.
/**
* Species are imported through the species list tool.
*
* @param event
*/
public void importSpecies(Event event) {
String type = (String) event.getData();
if (type != null && type.length() > 0) {
if ("assemblage".equalsIgnoreCase(type)) {
Map params = new HashMap();
params.put("enableImportAssemblage", true);
openModal("WEB-INF/zul/add/AddSpecies.zul", params, "addspecieswindow");
} else {
if (StringUtils.isNotEmpty((String) CommonData.getSettings().getProperty("sandbox.url", null)) && CommonData.getSettings().getProperty("import.points.layers-service", "false").equals("false")) {
String sandboxEmbedded = CommonData.getSettings().getProperty("sandbox.embedded", "false");
if (sandboxEmbedded != null && Boolean.parseBoolean(sandboxEmbedded)) {
SandboxEmbeddedController spc = (SandboxEmbeddedController) Executions.createComponents("WEB-INF/zul/sandbox/SandboxExternal.zul", getMapComposer(), null);
spc.setAddToMap(true);
spc.setParent(getMapComposer());
spc.doModal();
} else {
SandboxPasteController spc = (SandboxPasteController) Executions.createComponents("WEB-INF/zul/sandbox/SandboxPaste.zul", getMapComposer(), null);
spc.setAddToMap(true);
spc.setParent(getMapComposer());
spc.doModal();
}
} else {
Map params = new HashMap();
params.put("setTbInstructions", "3. Select file (comma separated ID (text), " + "longitude (decimal degrees), latitude(decimal degrees))");
params.put("addToMap", true);
openModal("WEB-INF/zul/input/UploadSpecies.zul", params, "uploadspecieswindow");
}
}
}
}
use of au.org.ala.spatial.composer.sandbox.SandboxPasteController in project spatial-portal by AtlasOfLivingAustralia.
the class AddSpeciesController method onClick$btnUpload.
public void onClick$btnUpload(Event event) {
try {
if (StringUtils.isNotEmpty((String) CommonData.getSettings().getProperty("sandbox.url", null)) && CommonData.getSettings().getProperty("import.points.layers-service", "false").equals("false")) {
SandboxPasteController spc = (SandboxPasteController) Executions.createComponents("WEB-INF/zul/sandbox/SandboxPaste.zul", getMapComposer(), null);
spc.setAddToMap(true);
spc.setParent(getMapComposer());
spc.doModal();
} else {
UploadSpeciesController usc = (UploadSpeciesController) Executions.createComponents("WEB-INF/zul/input/UploadSpecies.zul", getMapComposer(), null);
if (rUploadCoordinates.isSelected()) {
usc.setTbInstructions(CommonData.lang("instruction_upload_species_csv"));
} else if (rUploadLSIDs.isSelected()) {
usc.setTbInstructions(CommonData.lang("instruction_upload_species_lsids"));
} else {
usc.setTbInstructions(CommonData.lang("instruction_upload_species_other"));
}
usc.setAddToMap(true);
usc.setDefineArea(chkArea.isChecked());
usc.setParent(getMapComposer());
usc.doModal();
}
} catch (Exception e) {
LOGGER.error("error displaying uploadspecies.zul", e);
}
}
Aggregations