Search in sources :

Example 1 with UploadToSpeciesListController

use of au.org.ala.spatial.composer.input.UploadToSpeciesListController in project spatial-portal by AtlasOfLivingAustralia.

the class ToolComposer method showExportSpeciesListDialog.

/**
     * Shows a "create species list" dialog for the supplied list box
     *
     * @param lb
     */
private void showExportSpeciesListDialog(Listbox lb) {
    String values = getScientificName(lb);
    LOGGER.debug("Creating species list with " + values);
    if (values.length() > 0) {
        UploadToSpeciesListController dialog = (UploadToSpeciesListController) Executions.createComponents("WEB-INF/zul/input/UploadToSpeciesList.zul", this, null);
        dialog.setSpecies(values);
        dialog.setCallback(new EventListener() {

            @Override
            public void onEvent(Event event) throws Exception {
                updateSpeciesListMessage((String) event.getData());
            }
        });
        try {
            dialog.setParent(this);
            dialog.doModal();
        } catch (Exception e) {
            LOGGER.error("Unable to export assemblage", e);
        }
    }
}
Also used : UploadToSpeciesListController(au.org.ala.spatial.composer.input.UploadToSpeciesListController) EventListener(org.zkoss.zk.ui.event.EventListener) IOException(java.io.IOException)

Example 2 with UploadToSpeciesListController

use of au.org.ala.spatial.composer.input.UploadToSpeciesListController in project spatial-portal by AtlasOfLivingAustralia.

the class AddSpeciesController method showExportSpeciesListDialog.

private void showExportSpeciesListDialog() {
    String values = getScientificName();
    LOGGER.debug("Creating species list with " + values);
    if (values.length() > 0) {
        UploadToSpeciesListController dialog = (UploadToSpeciesListController) Executions.createComponents("WEB-INF/zul/input/UploadToSpeciesList.zul", this, null);
        dialog.setSpecies(values);
        dialog.setCallback(new EventListener() {

            @Override
            public void onEvent(Event event) throws Exception {
                updateSpeciesListMessage((String) event.getData());
            }
        });
        try {
            dialog.setParent(this);
            dialog.doModal();
        } catch (Exception e) {
            LOGGER.error("Unable to export assemblage", e);
        }
    }
}
Also used : UploadToSpeciesListController(au.org.ala.spatial.composer.input.UploadToSpeciesListController) IOException(java.io.IOException)

Aggregations

UploadToSpeciesListController (au.org.ala.spatial.composer.input.UploadToSpeciesListController)2 IOException (java.io.IOException)2 EventListener (org.zkoss.zk.ui.event.EventListener)1