Search in sources :

Example 51 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class CalculatedAttributeVM method deleteFormula.

@Command
@NotifyChange({ "selectedFormula", "formulas" })
public void deleteFormula() {
    ConfirmParams params = new MessageUtil.ConfirmParams(new MessageUtil.ConfirmHandler() {

        @Override
        public void onOk() {
            editedItem.removeFormula(selectedFormula);
            selectedFormula = null;
            initFormulas();
            notifyChange("selectedFormula", "formulas");
        }
    }, "survey.schema.attribute.calculated.formula.confirm_delete");
    params.setOkLabelKey("global.delete_item");
    MessageUtil.showConfirm(params);
}
Also used : ConfirmParams(org.openforis.collect.designer.util.MessageUtil.ConfirmParams) MessageUtil(org.openforis.collect.designer.util.MessageUtil) NotifyChange(org.zkoss.bind.annotation.NotifyChange) Command(org.zkoss.bind.annotation.Command) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand)

Example 52 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class CalculatedAttributeVM method addFormula.

@Command
@NotifyChange("formulas")
public void addFormula() {
    editingNewFormula = true;
    editedFormula = new Formula();
    openFormulaEditPopUp();
}
Also used : Formula(org.openforis.idm.metamodel.CalculatedAttributeDefinition.Formula) NotifyChange(org.zkoss.bind.annotation.NotifyChange) Command(org.zkoss.bind.annotation.Command) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand)

Example 53 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class TabsGroupComposer method addTab.

@Command
@NotifyChange({ "tabs" })
public void addTab() {
    UITab tab = new UITab();
    String tabName = generateNewTabName(tabsGroup);
    tab.setName(tabName);
    tabsGroup.addTab(tab);
}
Also used : UITab(org.openforis.collect.model.ui.UITab) NotifyChange(org.zkoss.bind.annotation.NotifyChange) Command(org.zkoss.bind.annotation.Command)

Example 54 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class SurveyEditVM method exportSchemaSummary.

@Command
public void exportSchemaSummary() {
    SchemaSummaryCSVExportJob job = new SchemaSummaryCSVExportJob();
    job.setJobManager(jobManager);
    job.setSurvey(survey);
    job.setLabelLanguage(currentLanguageCode);
    jobManager.start(job, survey.getId().toString());
    String statusPopUpTitle = Labels.getLabel("survey.schema.export_summary.process_status_popup.message", new String[] { survey.getName() });
    jobStatusPopUp = JobStatusPopUpVM.openPopUp(statusPopUpTitle, job, true);
}
Also used : SchemaSummaryCSVExportJob(org.openforis.collect.io.metadata.SchemaSummaryCSVExportJob) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand) Command(org.zkoss.bind.annotation.Command)

Example 55 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class SurveyEditVM method exportCEGridTemplate.

@Command
public void exportCEGridTemplate() throws IOException {
    File templateFile = new CollectEarthGridTemplateGenerator().generateTemplateCSVFile(survey);
    String fileName = String.format("%s_grid_template_%s.csv", survey.getName(), Dates.formatDateTime(new Date()));
    Filedownload.save(new FileInputStream(templateFile), MediaTypes.CSV_CONTENT_TYPE, fileName);
}
Also used : File(java.io.File) Date(java.util.Date) FileInputStream(java.io.FileInputStream) CollectEarthGridTemplateGenerator(org.openforis.collect.io.metadata.collectearth.CollectEarthGridTemplateGenerator) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand) Command(org.zkoss.bind.annotation.Command)

Aggregations

Command (org.zkoss.bind.annotation.Command)62 GlobalCommand (org.zkoss.bind.annotation.GlobalCommand)44 NotifyChange (org.zkoss.bind.annotation.NotifyChange)26 File (java.io.File)12 CollectSurvey (org.openforis.collect.model.CollectSurvey)10 MessageUtil (org.openforis.collect.designer.util.MessageUtil)9 UITab (org.openforis.collect.metamodel.ui.UITab)6 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)6 FileInputStream (java.io.FileInputStream)5 ConfirmParams (org.openforis.collect.designer.util.MessageUtil.ConfirmParams)5 UIOptions (org.openforis.collect.metamodel.ui.UIOptions)5 SurveyObject (org.openforis.idm.metamodel.SurveyObject)5 Media (org.zkoss.util.media.Media)5 Window (org.zkoss.zul.Window)5 UserCredential (es.bsc.compss.ui.auth.UserCredential)4 IOException (java.io.IOException)4 Date (java.util.Date)4 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)4 SessionStatus (org.openforis.collect.designer.session.SessionStatus)3 ConfirmHandler (org.openforis.collect.designer.util.MessageUtil.ConfirmHandler)3