/**
     * Method called when the onUpload event happens.
     *
     * @param Media
     *            Media to be imported.
     */
    public void importProject(Media media) {

        String file = media.getName();

        if (checkFileFormat(file)) {

            if (importCalendars.isChecked()) {

                try {
                    importCalendar(media.getStreamData(), file);
                    messages.showMessage(Level.INFO, _(file
                            + ": Calendar import successfully!"));
                } catch (InstanceNotFoundException e) {
                    messages.showMessage(Level.ERROR, _("Instance not found."));
                } catch (ValidationException e) {
                    messages.showMessage(Level.ERROR, e.getMessage());
                }

            } else if (importTasks.isChecked()) {
                importProject(media.getStreamData(), file);

                messages.showMessage(Level.INFO, _(file
                        + ": Task import successfully!"));

            } else if (importAll.isChecked()) {

                try {
                    importAll(media.getStreamData(), file);
                    messages.showMessage(Level.INFO, _(file
                            + ": Import successfully!"));
                } catch (InstanceNotFoundException e) {
                    messages.showMessage(Level.ERROR, _("Instance not found."));
                } catch (ValidationException e) {
                    messages.showMessage(Level.ERROR, e.getMessage());
                }

            } else {
                messages.showMessage(Level.WARNING,
                        _("Select one of the options."));
            }

        } else {
            messages.showMessage(Level.ERROR,
                    _("The only current supported formats are mpp and planner."));
        }

    }
 public void deleteTaskQualityForm(TaskQualityForm taskQualityForm) {
     try {
         assignedTaskQualityFormsToOrderElementModel
                 .removeAdvanceAssignmentIfNeeded(taskQualityForm);
     } catch (ValidationException e) {
         showInformativeMessage(e.getMessage());
         return;
     }
     assignedTaskQualityFormsToOrderElementModel
             .deleteTaskQualityForm(taskQualityForm);
     reloadTaskQualityForms();
 }