diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java index f7ec816f4b97a0a8cea274515611948b2127b00c..a826512ce7c45c07eb7ccc953af5395cbf0f9364 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Dict.java @@ -91,11 +91,9 @@ public abstract class Dict public static final String CHOOSE_METAPROJECT = "choose_metaproject"; - public static final String CREATE_NOT_EXISTING_METAPROJECTS_CONFIRMATION_TITLE = - "create_not_existing_metaprojects_confirmation_title"; + public static final String CREATE_NOT_EXISTING_METAPROJECTS_CONFIRMATION_TITLE = "create_not_existing_metaprojects_confirmation_title"; - public static final String CREATE_NOT_EXISTING_METAPROJECTS_CONFIRMATION_MSG = - "create_not_existing_metaprojects_confirmation_msg"; + public static final String CREATE_NOT_EXISTING_METAPROJECTS_CONFIRMATION_MSG = "create_not_existing_metaprojects_confirmation_msg"; // // Form @@ -103,30 +101,23 @@ public abstract class Dict public static final String UNSAVED_FORM_CHANGES_INFO = "unsaved_form_changes_info"; - public static final String SAVE_UNCHANGED_FORM_CONFIRMATION_TITLE = - "save_unchanged_form_confirmation_title"; + public static final String SAVE_UNCHANGED_FORM_CONFIRMATION_TITLE = "save_unchanged_form_confirmation_title"; - public static final String SAVE_UNCHANGED_FORM_CONFIRMATION_MSG = - "save_unchanged_form_confirmation_msg"; + public static final String SAVE_UNCHANGED_FORM_CONFIRMATION_MSG = "save_unchanged_form_confirmation_msg"; - public static final String RESET_UNSAVED_FORM_CHANGES_CONFIRMATION_TITLE = - "reset_unsaved_form_changes_confirmation_title"; + public static final String RESET_UNSAVED_FORM_CHANGES_CONFIRMATION_TITLE = "reset_unsaved_form_changes_confirmation_title"; - public static final String REVERT_UNSAVED_FORM_CHANGES_CONFIRMATION_TITLE = - "revert_unsaved_form_changes_confirmation_title"; + public static final String REVERT_UNSAVED_FORM_CHANGES_CONFIRMATION_TITLE = "revert_unsaved_form_changes_confirmation_title"; - public static final String LOSE_UNSAVED_FORM_CHANGES_CONFIRMATION_MSG = - "lose_unsaved_form_changes_confirmation_msg"; + public static final String LOSE_UNSAVED_FORM_CHANGES_CONFIRMATION_MSG = "lose_unsaved_form_changes_confirmation_msg"; // // Table Modifications // - public static final String CONFIRM_SAVE_TABLE_MODIFICATIONS_DIALOG_TITLE = - "confirm_save_table_modifications_dialog_title"; + public static final String CONFIRM_SAVE_TABLE_MODIFICATIONS_DIALOG_TITLE = "confirm_save_table_modifications_dialog_title"; - public static final String CONFIRM_SAVE_TABLE_MODIFICATIONS_DIALOG_MESSAGE = - "confirm_save_table_modifications_dialog_message"; + public static final String CONFIRM_SAVE_TABLE_MODIFICATIONS_DIALOG_MESSAGE = "confirm_save_table_modifications_dialog_message"; public static final String TABLE_MODIFICATIONS = "table_modifications"; @@ -170,8 +161,7 @@ public abstract class Dict public static final String TOOLTIP_CONFIG_DISABLED = "tooltip_config_disabled"; - public static final String TOOLTIP_VOCABULARY_MANAGED_INTERNALLY = - "tooltip_vocabulary_managed_internally"; + public static final String TOOLTIP_VOCABULARY_MANAGED_INTERNALLY = "tooltip_vocabulary_managed_internally"; public static final String TOOLTIP_VIEW_DATASET = "tooltip_view_dataset"; @@ -273,8 +263,7 @@ public abstract class Dict public static final String IDENTIFIER = "identifier"; - public static final String SAMPLE_PROPERTIES_PANEL_SAMPLE_IDENTIFIER = - "sample_properties_panel_sample_identifier"; + public static final String SAMPLE_PROPERTIES_PANEL_SAMPLE_IDENTIFIER = "sample_properties_panel_sample_identifier"; public static final String NO_MATCH = "no_match"; @@ -334,16 +323,13 @@ public abstract class Dict public static final String PROJECT_SELECTOR_TOOLTIP = "project_selector_tooltip"; - public static final String PROJECT_SELECTOR_DESCRIPTION_NOT_AVAILABLE = - "project_selector_description_not_available"; + public static final String PROJECT_SELECTOR_DESCRIPTION_NOT_AVAILABLE = "project_selector_description_not_available"; public static final String PROJECT_SELECTOR_CODE_COLUMN = "project_selector_code_column"; - public static final String PROJECT_SELECTOR_DETAILS_LINK_LABEL = - "project_selector_details_link_label"; + public static final String PROJECT_SELECTOR_DETAILS_LINK_LABEL = "project_selector_details_link_label"; - public static final String PROJECT_SELECTOR_DETAILS_LINK_TOOLTIP = - "project_selector_details_link_tooltip"; + public static final String PROJECT_SELECTOR_DETAILS_LINK_TOOLTIP = "project_selector_details_link_tooltip"; // // Dataset Browser @@ -353,17 +339,14 @@ public abstract class Dict public static final String NO_DATASETS_SELECTED = "no_datasets_selected"; - public static final String DATASETS_FROM_DIFFERENT_STORES_SELECTED = - "datasets_from_different_stores_selected"; + public static final String DATASETS_FROM_DIFFERENT_STORES_SELECTED = "datasets_from_different_stores_selected"; - public static final String PERFORM_COMPUTATION_ON_ALL_DATASETS_MSG_TEMPLATE = - "perform_computation_on_all_datasets_msg_template"; + public static final String PERFORM_COMPUTATION_ON_ALL_DATASETS_MSG_TEMPLATE = "perform_computation_on_all_datasets_msg_template"; public static final String PERFORM_COMPUTATION_ON_SELECTED_OR_ALL_DATASETS_MSG_TEMPLATE = "perform_computation_on_selected_or_all_datasets_msg_template"; - public static final String PERFORM_ARCHIVING_ON_ALL_DATASETS_MSG_TEMPLATE = - "perform_archiving_on_all_datasets_msg_template"; + public static final String PERFORM_ARCHIVING_ON_ALL_DATASETS_MSG_TEMPLATE = "perform_archiving_on_all_datasets_msg_template"; public static final String PERFORM_ARCHIVING_ON_SELECTED_OR_ALL_DATASETS_MSG_TEMPLATE = "perform_archiving_on_selected_or_all_datasets_msg_template"; @@ -478,11 +461,9 @@ public abstract class Dict public static final String MISSING_VOCABULARY_TERMS = "missing_vocabulary_terms"; - public static final String VOCABULARY_SHOW_AVAILABLE_TERMS_IN_CHOOSERS = - "vocabulary_show_available_terms_in_choosers"; + public static final String VOCABULARY_SHOW_AVAILABLE_TERMS_IN_CHOOSERS = "vocabulary_show_available_terms_in_choosers"; - public static final String CONFIRM_VOCABULARY_SHOW_AVAILABLE_TERMS_IN_CHOOSERS_MSG = - "confirm_vocabulary_show_available_terms_in_chooosers_msg"; + public static final String CONFIRM_VOCABULARY_SHOW_AVAILABLE_TERMS_IN_CHOOSERS_MSG = "confirm_vocabulary_show_available_terms_in_chooosers_msg"; public static final String MANDATORY = "mandatory"; @@ -516,17 +497,13 @@ public abstract class Dict public static final String UNASSIGN_BUTTON_LABEL = "unassign_button_label"; - public static final String UNASSIGNMENT_CONFIRMATION_DIALOG_TITLE = - "unassignment_confirmation_dialog_title"; + public static final String UNASSIGNMENT_CONFIRMATION_DIALOG_TITLE = "unassignment_confirmation_dialog_title"; - public static final String UNASSIGNMENT_CONFIRMATION_TEMPLATE_WITHOUT_PROPERTIES = - "unassignment_confirmation_template_without_properties"; + public static final String UNASSIGNMENT_CONFIRMATION_TEMPLATE_WITHOUT_PROPERTIES = "unassignment_confirmation_template_without_properties"; - public static final String UNASSIGNMENT_CONFIRMATION_TEMPLATE_WITH_PROPERTIES = - "unassignment_confirmation_template_with_properties"; + public static final String UNASSIGNMENT_CONFIRMATION_TEMPLATE_WITH_PROPERTIES = "unassignment_confirmation_template_with_properties"; - public static final String EDIT_PROPERTY_TYPE_ASSIGNMENT_TITLE = - "edit_property_type_assignment_title"; + public static final String EDIT_PROPERTY_TYPE_ASSIGNMENT_TITLE = "edit_property_type_assignment_title"; // // Entity Property History Browser @@ -576,8 +553,7 @@ public abstract class Dict public static final String DELETE_CONFIRMATION_MESSAGE = "delete_confirmation_message"; - public static final String DELETE_CONFIRMATION_MESSAGE_WITH_REASON_TEMPLATE = - "delete_confirmation_message_with_reason_template"; + public static final String DELETE_CONFIRMATION_MESSAGE_WITH_REASON_TEMPLATE = "delete_confirmation_message_with_reason_template"; public static final String DELETING_PERMANENTLY = "deleting_permanently"; @@ -589,21 +565,17 @@ public abstract class Dict public static final String DELETING_FORCE_DISALLOWED_TYPES = "deleting_force_disallowed_types"; - public static final String DELETING_FORCE_DISALLOWED_TYPES_TOOLTIP = - "deleting_force_disallowed_types_tooltip"; + public static final String DELETING_FORCE_DISALLOWED_TYPES_TOOLTIP = "deleting_force_disallowed_types_tooltip"; public static final String DELETING = "deleting"; - public static final String DELETE_PERMANENTLY_PROGRESS_MESSAGE = - "delete_permanently_progress_message"; + public static final String DELETE_PERMANENTLY_PROGRESS_MESSAGE = "delete_permanently_progress_message"; public static final String DELETE_PROGRESS_MESSAGE = "delete_progress_message"; - public static final String CANNOT_MODIFY_DELETED_ENTITY_TITLE = - "cannot_modify_deleted_entity_title"; + public static final String CANNOT_MODIFY_DELETED_ENTITY_TITLE = "cannot_modify_deleted_entity_title"; - public static final String CANNOT_MODIFY_DELETED_ENTITY_MSG = - "cannot_modify_deleted_entity_msg"; + public static final String CANNOT_MODIFY_DELETED_ENTITY_MSG = "cannot_modify_deleted_entity_msg"; public static final String DELETION_BROWSER = "deletion_browser"; @@ -619,22 +591,17 @@ public abstract class Dict public static final String BUTTON_DELETE_PERMANENTLY = "button_delete_permanently"; - public static final String REVERT_DELETIONS_CONFIRMATION_TITLE = - "revert_deletions_confirmation_title"; + public static final String REVERT_DELETIONS_CONFIRMATION_TITLE = "revert_deletions_confirmation_title"; - public static final String REVERT_DELETIONS_CONFIRMATION_MSG = - "revert_deletions_confirmation_msg"; + public static final String REVERT_DELETIONS_CONFIRMATION_MSG = "revert_deletions_confirmation_msg"; public static final String REVERT_DELETIONS_PROGRESS = "revert_deletions_progress"; - public static final String REVERT_ENTITY_DELETION_CONFIRMATION_MSG = - "revert_entity_deletion_confirmation_msg"; + public static final String REVERT_ENTITY_DELETION_CONFIRMATION_MSG = "revert_entity_deletion_confirmation_msg"; - public static final String PERMANENT_DELETIONS_CONFIRMATION_TITLE = - "permanent_deletions_confirmation_title"; + public static final String PERMANENT_DELETIONS_CONFIRMATION_TITLE = "permanent_deletions_confirmation_title"; - public static final String PERMANENT_DELETIONS_CONFIRMATION_MSG = - "permanent_deletions_confirmation_msg"; + public static final String PERMANENT_DELETIONS_CONFIRMATION_MSG = "permanent_deletions_confirmation_msg"; public static final String PREMANENT_DELETIONS_PROGRESS = "permanent_deletions_progress"; @@ -688,8 +655,7 @@ public abstract class Dict public static final String DATA_SET_TYPE = "data_set_type"; - public static final String EXTERNAL_DATA_EXPERIMENT_IDENTIFIER = - "external_data_experiment_identifier"; + public static final String EXTERNAL_DATA_EXPERIMENT_IDENTIFIER = "external_data_experiment_identifier"; public static final String EXTERNAL_DATA_SAMPLE_IDENTIFIER = "external_data_sample_identifier"; @@ -721,17 +687,13 @@ public abstract class Dict public static final String CONFIRM_DATASET_UPLOAD_MSG = "confirm_dataset_upload_msg"; - public static final String CONFIRM_DATASET_UPLOAD_FILE_NAME_FIELD = - "confirm_dataset_upload_file_name_field"; + public static final String CONFIRM_DATASET_UPLOAD_FILE_NAME_FIELD = "confirm_dataset_upload_file_name_field"; - public static final String CONFIRM_DATASET_UPLOAD_COMMENT_FIELD = - "confirm_dataset_upload_comment_field"; + public static final String CONFIRM_DATASET_UPLOAD_COMMENT_FIELD = "confirm_dataset_upload_comment_field"; - public static final String CONFIRM_DATASET_UPLOAD_USER_FIELD = - "confirm_dataset_upload_user_field"; + public static final String CONFIRM_DATASET_UPLOAD_USER_FIELD = "confirm_dataset_upload_user_field"; - public static final String CONFIRM_DATASET_UPLOAD_PASSWORD_FIELD = - "confirm_dataset_upload_password_field"; + public static final String CONFIRM_DATASET_UPLOAD_PASSWORD_FIELD = "confirm_dataset_upload_password_field"; public static final String DATASET_NOT_AVAILABLE_MSG = "dataset_not_available_msg"; @@ -741,8 +703,7 @@ public abstract class Dict public static final String LINKED_DATA_SET_LINK = "linked_data_set_link"; - public static final String LINKED_DATA_SET_LINK_NOT_AVAILABLE_MSG = - "linked_data_set_link_not_available"; + public static final String LINKED_DATA_SET_LINK_NOT_AVAILABLE_MSG = "linked_data_set_link_not_available"; // // Sample Registration @@ -880,6 +841,14 @@ public abstract class Dict public static final String TERMS = "terms"; + public static final String VOCABULARY_TERMS_DESCRIPTION = "descriptions"; + + public static final String VOCABULARY_TERMS_DESCRIPTION_EMPTY = "vocabulary_terms_description_empty"; + + public static final String VOCABULARY_TERMS_LABEL = "labels"; + + public static final String VOCABULARY_TERMS_LABEL_EMPTY = "vocabulary_terms_label_empty"; + public static final String VOCABULARY_TERMS_BROWSER = "VOCABULARY_TERMS_BROWSER"; public static final String TERM_FOR_SAMPLES_USAGE = "TERM_FOR_SAMPLES_USAGE"; @@ -904,22 +873,17 @@ public abstract class Dict public static final String UPDATE_VOCABULARY_TERMS_MESSAGE = "update_vocabulary_terms_message"; - public static final String UPDATE_VOCABULARY_TERMS_MESSAGE_2 = - "update_vocabulary_terms_message_2"; + public static final String UPDATE_VOCABULARY_TERMS_MESSAGE_2 = "update_vocabulary_terms_message_2"; - public static final String VOCABULARY_TERMS_VALIDATION_MESSAGE = - "vocabulary_terms_validation_message"; + public static final String VOCABULARY_TERMS_VALIDATION_MESSAGE = "vocabulary_terms_validation_message"; public static final String DELETE_VOCABULARY_TERMS_BUTTON = "delete_vocabulary_terms_button"; - public static final String DELETE_VOCABULARY_TERMS_INVALID_TITLE = - "delete_vocabulary_terms_invalid_title"; + public static final String DELETE_VOCABULARY_TERMS_INVALID_TITLE = "delete_vocabulary_terms_invalid_title"; - public static final String DELETE_VOCABULARY_TERMS_INVALID_MESSAGE = - "delete_vocabulary_terms_invalid_message"; + public static final String DELETE_VOCABULARY_TERMS_INVALID_MESSAGE = "delete_vocabulary_terms_invalid_message"; - public static final String DELETE_VOCABULARY_TERMS_CONFIRMATION_TITLE = - "delete_vocabulary_terms_confirmation_title"; + public static final String DELETE_VOCABULARY_TERMS_CONFIRMATION_TITLE = "delete_vocabulary_terms_confirmation_title"; public static final String DELETE_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_NO_REPLACEMENTS_SINGULAR = "delete_vocabulary_terms_confirmation_message_no_replacements_singular"; @@ -932,17 +896,14 @@ public abstract class Dict public static final String EDIT_VOCABULARY_TERM_BUTTON = "edit_vocabulary_term_button"; - public static final String MAKE_OFFICIAL_VOCABULARY_TERM_BUTTON = - "make_official_vocabulary_term_button"; + public static final String MAKE_OFFICIAL_VOCABULARY_TERM_BUTTON = "make_official_vocabulary_term_button"; - public static final String MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_TITLE = - "make_official_vocabulary_terms_confirmation_title"; + public static final String MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_TITLE = "make_official_vocabulary_terms_confirmation_title"; public static final String MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_SINGULAR = "make_official_vocabulary_terms_confirmation_message_singular"; - public static final String MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_MESSAGE = - "make_official_vocabulary_terms_confirmation_message"; + public static final String MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_MESSAGE = "make_official_vocabulary_terms_confirmation_message"; // // Space Browser @@ -991,11 +952,9 @@ public abstract class Dict public static final String METAPROJECT_TREE_INFO_LINK = "metaproject_tree_info_link"; - public static final String METAPROJECT_TREE_DESCRIPTION_NOT_AVAILABLE = - "metaproject_tree_description_not_available"; + public static final String METAPROJECT_TREE_DESCRIPTION_NOT_AVAILABLE = "metaproject_tree_description_not_available"; - public static final String METAPROJECT_TREE_METAPROJECT_TOOLTIP = - "metaproject_tree_metaproject_tooltip"; + public static final String METAPROJECT_TREE_METAPROJECT_TOOLTIP = "metaproject_tree_metaproject_tooltip"; // // Metaproject Browser @@ -1004,18 +963,15 @@ public abstract class Dict public static final String METAPROJECT_BROWSER_TREE_TITLE = "metaproject_browser_tree_title"; - public static final String METAPROJECT_BROWSER_TREE_TOOLTIP = - "metaproject_browser_tree_tooltip"; + public static final String METAPROJECT_BROWSER_TREE_TOOLTIP = "metaproject_browser_tree_tooltip"; - public static final String METAPROJECT_BROWSER_ENTITIES_TITLE = - "metaproject_browser_entities_title"; + public static final String METAPROJECT_BROWSER_ENTITIES_TITLE = "metaproject_browser_entities_title"; // // Metaproject Entities // - public static final String METAPROJECT_ENTITIES_EXPERIMENTS = - "metaproject_entities_experiments"; + public static final String METAPROJECT_ENTITIES_EXPERIMENTS = "metaproject_entities_experiments"; public static final String METAPROJECT_ENTITIES_SAMPLES = "metaproject_entities_samples"; @@ -1107,11 +1063,9 @@ public abstract class Dict public static final String TOO_MANY_VISIBLE_COLUMNS_MSG = "TOO_MANY_VISIBLE_COLUMNS_MSG"; - public static final String VISIBLE_COLUMNS_LIMIT_EXCEEDED_MSG = - "VISIBLE_COLUMNS_LIMIT_EXCEEDED_MSG"; + public static final String VISIBLE_COLUMNS_LIMIT_EXCEEDED_MSG = "VISIBLE_COLUMNS_LIMIT_EXCEEDED_MSG"; - public static final String VISIBLE_COLUMNS_LIMIT_REACHED_MSG = - "VISIBLE_COLUMNS_LIMIT_REACHED_MSG"; + public static final String VISIBLE_COLUMNS_LIMIT_REACHED_MSG = "VISIBLE_COLUMNS_LIMIT_REACHED_MSG"; // // User Settings Dialog @@ -1119,20 +1073,17 @@ public abstract class Dict public static final String HOME_GROUP_LABEL = "home_group_label"; - public static final String CHANGE_USER_SETTINGS_DIALOG_TITLE = - "change_user_settings_dialog_title"; + public static final String CHANGE_USER_SETTINGS_DIALOG_TITLE = "change_user_settings_dialog_title"; public static final String ABOUT_BOX_DIALOG_TITLE = "about_box_dialog_title"; public static final String USE_WILDCARD_SEARCH_MODE_LABEL = "use_wildcard_search_mode_label"; - public static final String USE_WILDCARD_SEARCH_MODE_TOOLTIP = - "use_wildcard_search_mode_tooltip"; + public static final String USE_WILDCARD_SEARCH_MODE_TOOLTIP = "use_wildcard_search_mode_tooltip"; public static final String RESET_USER_SETTINGS_BUTTON = "reset_user_settings_button"; - public static final String RESET_USER_SETTINGS_CONFIRMATION_MSG = - "reset_user_settings_confirmation_msg"; + public static final String RESET_USER_SETTINGS_CONFIRMATION_MSG = "reset_user_settings_confirmation_msg"; public static final String REAL_NUMBER_FORMATING_FIELDS = "real_number_formating_fields"; @@ -1192,8 +1143,7 @@ public abstract class Dict public static final String ENTITY_TYPE_ASSIGNMENTS = "entity_type_assignments"; - public static final String COMBO_BOX_EXPECTED_VALUE_FROM_THE_LIST = - "combo_box_expected_value_from_the_list"; + public static final String COMBO_BOX_EXPECTED_VALUE_FROM_THE_LIST = "combo_box_expected_value_from_the_list"; public static final String DETAILS_TITLE = "details_title"; @@ -1245,8 +1195,7 @@ public abstract class Dict public static final String ADD_ATTACHMENT = "add_attachment"; - public static final String EXPERIMENT_SAMPLES_SELCTION_TITLE = - "experiment_samples_selction_title"; + public static final String EXPERIMENT_SAMPLES_SELCTION_TITLE = "experiment_samples_selction_title"; public static final String DATA_SET_UPLOAD = "data_set_upload"; @@ -1256,14 +1205,11 @@ public abstract class Dict public static final String SHOW_RELATED_DATASETS_DIALOG_TITLE = "show_related_datasets"; - public static final String SHOW_RELATED_DATASETS_DIALOG_MESSAGE = - "show_related_datasets_message"; + public static final String SHOW_RELATED_DATASETS_DIALOG_MESSAGE = "show_related_datasets_message"; - public static final String SHOW_RELATED_DATASETS_DIALOG_RADIO_LABEL = - "show_related_datasets_radio_label"; + public static final String SHOW_RELATED_DATASETS_DIALOG_RADIO_LABEL = "show_related_datasets_radio_label"; - public static final String MESSAGE_NO_EXTERNAL_UPLOAD_SERVICE = - "message_no_external_upload_service"; + public static final String MESSAGE_NO_EXTERNAL_UPLOAD_SERVICE = "message_no_external_upload_service"; public static final String DATA_STORE = "data_store"; @@ -1273,8 +1219,7 @@ public abstract class Dict public static final String EDIT_PERSONS = "edit_persons"; - public static final String ADD_PERSON_TO_AUTHORIZATION_GROUP_TITLE = - "add_person_to_authorization_group_title"; + public static final String ADD_PERSON_TO_AUTHORIZATION_GROUP_TITLE = "add_person_to_authorization_group_title"; public static final String PERSONS_IDS_LABEL = "persons_ids_label"; @@ -1294,11 +1239,9 @@ public abstract class Dict public static final String REMOVE_PERSONS_FROM_AUTHORIZATION_GROUP_CONFIRMATION_MESSAGE = "remove_persons_from_authorization_group_confirmation_message"; - public static final String DEACTIVATE_PERSONS_CONFIRMATION_TITLE = - "deactivate_persons_confirmation_title"; + public static final String DEACTIVATE_PERSONS_CONFIRMATION_TITLE = "deactivate_persons_confirmation_title"; - public static final String DEACTIVATE_PERSONS_CONFIRMATION_MESSAGE = - "deactivate_persons_confirmation_message"; + public static final String DEACTIVATE_PERSONS_CONFIRMATION_MESSAGE = "deactivate_persons_confirmation_message"; public static final String ALL_RADIO = "all_radio"; @@ -1376,8 +1319,7 @@ public abstract class Dict public static final String MORE_RESULTS_FOUND_TITLE = "more_results_found_title"; - public static final String ADD_UNOFFICIAL_VOCABULARY_TERM_DIALOG_TITLE = - "add_unofficial_vocabulary_term_dialog_title"; + public static final String ADD_UNOFFICIAL_VOCABULARY_TERM_DIALOG_TITLE = "add_unofficial_vocabulary_term_dialog_title"; public static final String CUSTOM_IMPORT = "custom_import"; @@ -1415,8 +1357,7 @@ public abstract class Dict // Active users - public static final String ACTIVE_USERS_EMAIL_SENT_CONFIRMATION = - "active_users_email_sent_confirmation"; + public static final String ACTIVE_USERS_EMAIL_SENT_CONFIRMATION = "active_users_email_sent_confirmation"; public static final String ACTIVE_USERS_DIALOG = "active_users_dialog"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java index e4618504dcb0d1e75e9c949875087370ba1336e8..197321206af947019199b304c6f249647a39035f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java @@ -22,27 +22,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import com.extjs.gxt.ui.client.Style.Scroll; -import com.extjs.gxt.ui.client.event.ButtonEvent; -import com.extjs.gxt.ui.client.event.Events; -import com.extjs.gxt.ui.client.event.SelectionChangedEvent; -import com.extjs.gxt.ui.client.event.SelectionChangedListener; -import com.extjs.gxt.ui.client.event.SelectionListener; -import com.extjs.gxt.ui.client.widget.MessageBox; -import com.extjs.gxt.ui.client.widget.Text; -import com.extjs.gxt.ui.client.widget.VerticalPanel; -import com.extjs.gxt.ui.client.widget.Window; -import com.extjs.gxt.ui.client.widget.button.Button; -import com.extjs.gxt.ui.client.widget.form.FileUploadField; -import com.extjs.gxt.ui.client.widget.form.FormPanel; -import com.extjs.gxt.ui.client.widget.form.FormPanel.Encoding; -import com.extjs.gxt.ui.client.widget.form.FormPanel.Method; -import com.extjs.gxt.ui.client.widget.form.LabelField; -import com.extjs.gxt.ui.client.widget.form.TextArea; -import com.extjs.gxt.ui.client.widget.form.TextField; -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.user.client.ui.Widget; - import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; @@ -83,6 +62,27 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.VocabularyTermGridIDs; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.VocabularyTermReplacement; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.VocabularyTermWithStats; +import com.extjs.gxt.ui.client.Style.Scroll; +import com.extjs.gxt.ui.client.event.ButtonEvent; +import com.extjs.gxt.ui.client.event.Events; +import com.extjs.gxt.ui.client.event.SelectionChangedEvent; +import com.extjs.gxt.ui.client.event.SelectionChangedListener; +import com.extjs.gxt.ui.client.event.SelectionListener; +import com.extjs.gxt.ui.client.widget.MessageBox; +import com.extjs.gxt.ui.client.widget.Text; +import com.extjs.gxt.ui.client.widget.VerticalPanel; +import com.extjs.gxt.ui.client.widget.Window; +import com.extjs.gxt.ui.client.widget.button.Button; +import com.extjs.gxt.ui.client.widget.form.FileUploadField; +import com.extjs.gxt.ui.client.widget.form.FormPanel; +import com.extjs.gxt.ui.client.widget.form.FormPanel.Encoding; +import com.extjs.gxt.ui.client.widget.form.FormPanel.Method; +import com.extjs.gxt.ui.client.widget.form.LabelField; +import com.extjs.gxt.ui.client.widget.form.TextArea; +import com.extjs.gxt.ui.client.widget.form.TextField; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Widget; + /** * Grid displaying vocabularies. * @@ -100,7 +100,8 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> private static final int LABEL_WIDTH_IN_REPLACEMENT_DIALOG = 200; // browser consists of the grid and the paging toolbar - private static final String BROWSER_ID = GenericConstants.ID_PREFIX + "vocabulary-term-browser"; + private static final String BROWSER_ID = GenericConstants.ID_PREFIX + + "vocabulary-term-browser"; private final class RefreshCallback extends AbstractAsyncCallback<Void> { @@ -121,12 +122,15 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> private final Vocabulary vocabulary; public static IDisposableComponent create( - final IViewContext<ICommonClientServiceAsync> viewContext, Vocabulary vocabulary) + final IViewContext<ICommonClientServiceAsync> viewContext, + Vocabulary vocabulary) { - return new VocabularyTermGrid(viewContext, vocabulary).asDisposableWithoutToolbar(); + return new VocabularyTermGrid(viewContext, vocabulary) + .asDisposableWithoutToolbar(); } - private VocabularyTermGrid(IViewContext<ICommonClientServiceAsync> viewContext, + private VocabularyTermGrid( + IViewContext<ICommonClientServiceAsync> viewContext, Vocabulary vocabulary) { super(viewContext, createBrowserId(vocabulary), true, @@ -140,8 +144,8 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> @Override protected ColumnDefsAndConfigs<TableModelRowWithObject<VocabularyTermWithStats>> createColumnsDefinition() { - ColumnDefsAndConfigs<TableModelRowWithObject<VocabularyTermWithStats>> definitions = - super.createColumnsDefinition(); + ColumnDefsAndConfigs<TableModelRowWithObject<VocabularyTermWithStats>> definitions = super + .createColumnsDefinition(); definitions.setGridCellRendererFor(VocabularyTermGridIDs.URL, LinkRenderer.createExternalLinkRenderer()); definitions.setGridCellRendererFor(CommonGridIDs.DESCRIPTION, @@ -153,7 +157,8 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> { addEntityOperationsLabel(); - Button addButton = new Button(viewContext.getMessage(Dict.ADD_VOCABULARY_TERMS_BUTTON)); + Button addButton = new Button( + viewContext.getMessage(Dict.ADD_VOCABULARY_TERMS_BUTTON)); addButton.addSelectionListener(new SelectionListener<ButtonEvent>() { @Override @@ -164,67 +169,68 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> }); addButton(addButton); - Button batchUpdateButton = - new Button(viewContext.getMessage(Dict.UPDATE_VOCABULARY_TERMS_BUTTON)); - batchUpdateButton.addSelectionListener(new SelectionListener<ButtonEvent>() - { - @Override - public void componentSelected(ButtonEvent ce) - { - createUpdateTermsDialog().show(); - } - }); + Button batchUpdateButton = new Button( + viewContext.getMessage(Dict.UPDATE_VOCABULARY_TERMS_BUTTON)); + batchUpdateButton + .addSelectionListener(new SelectionListener<ButtonEvent>() + { + @Override + public void componentSelected(ButtonEvent ce) + { + createUpdateTermsDialog().show(); + } + }); addButton(batchUpdateButton); - Button editButton = - createSelectedItemButton( - viewContext.getMessage(Dict.EDIT_VOCABULARY_TERM_BUTTON), - new ISelectedEntityInvoker<BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>>>() - { + Button editButton = createSelectedItemButton( + viewContext.getMessage(Dict.EDIT_VOCABULARY_TERM_BUTTON), + new ISelectedEntityInvoker<BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>>>() + { - @Override - public void invoke( - BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>> selectedItem, - boolean keyPressed) - { - final VocabularyTermWithStats term = - selectedItem.getBaseObject().getObjectOrNull(); - createEditDialog(term.getTerm()).show(); - } - }); + @Override + public void invoke( + BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>> selectedItem, + boolean keyPressed) + { + final VocabularyTermWithStats term = selectedItem + .getBaseObject().getObjectOrNull(); + createEditDialog(term.getTerm()).show(); + } + }); addButton(editButton); - Button deleteButton = - createSelectedItemsButton( - viewContext.getMessage(Dict.DELETE_VOCABULARY_TERMS_BUTTON), - new SelectionListener<ButtonEvent>() - { - @Override - public void componentSelected(ButtonEvent ce) - { - deleteTerms(); - } - }); + Button deleteButton = createSelectedItemsButton( + viewContext.getMessage(Dict.DELETE_VOCABULARY_TERMS_BUTTON), + new SelectionListener<ButtonEvent>() + { + @Override + public void componentSelected(ButtonEvent ce) + { + deleteTerms(); + } + }); addButton(deleteButton); if (getWebClientConfiguration().getAllowAddingUnofficialTerms()) { - Button makeOfficialButton = - new Button(viewContext.getMessage(Dict.MAKE_OFFICIAL_VOCABULARY_TERM_BUTTON), - new SelectionListener<ButtonEvent>() - { - @Override - public void componentSelected(ButtonEvent ce) - { - makeOfficial(); - } - }); + Button makeOfficialButton = new Button( + viewContext + .getMessage(Dict.MAKE_OFFICIAL_VOCABULARY_TERM_BUTTON), + new SelectionListener<ButtonEvent>() + { + @Override + public void componentSelected(ButtonEvent ce) + { + makeOfficial(); + } + }); addButton(makeOfficialButton); } if (vocabulary.isManagedInternally()) { - String tooltip = viewContext.getMessage(Dict.TOOLTIP_VOCABULARY_MANAGED_INTERNALLY); + String tooltip = viewContext + .getMessage(Dict.TOOLTIP_VOCABULARY_MANAGED_INTERNALLY); disableButton(addButton, tooltip); disableButton(batchUpdateButton, tooltip); disableButton(editButton, tooltip); @@ -242,9 +248,11 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> final String code = term.getCode(); final String description = term.getDescription(); final String label = term.getLabel(); - final String title = viewContext.getMessage(Dict.EDIT_TITLE, "Vocabulary Term", code); + final String title = viewContext.getMessage(Dict.EDIT_TITLE, + "Vocabulary Term", code); - return new AbstractRegistrationDialog(viewContext, title, postRegistrationCallback) + return new AbstractRegistrationDialog(viewContext, title, + postRegistrationCallback) { private final DescriptionField descriptionField; @@ -259,15 +267,18 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> boolean mandatory = false; - labelField = createTextField(viewContext.getMessage(Dict.LABEL), mandatory); + labelField = createTextField( + viewContext.getMessage(Dict.LABEL), mandatory); FieldUtil.setValueWithUnescaping(labelField, label); labelField.setMaxLength(GenericConstants.COLUMN_LABEL); addField(labelField); - descriptionField = createDescriptionField(viewContext, mandatory); + descriptionField = createDescriptionField(viewContext, + mandatory); FieldUtil.setValueWithUnescaping(descriptionField, description); addField(descriptionField); - // if vocabulary term cannot be choosen from list there is no need to edit order + // if vocabulary term cannot be choosen from list there is no + // need to edit order if (vocabulary.isChosenFromList()) { termSelectionWidget = createTermSelectionWidget(); @@ -288,7 +299,8 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> term.setOrdinal(extractPreviousTermOrdinal() + 1); } - viewContext.getService().updateVocabularyTerm(term, registrationCallback); + viewContext.getService().updateVocabularyTerm(term, + registrationCallback); } private VocabularyTermSelectionWidget createTermSelectionWidget() @@ -306,9 +318,9 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> previousTermCodeOrNull = currentTermCode; } boolean mandatory = false; - VocabularyTermSelectionWidget result = - new VocabularyTermSelectionWidget(getId() + "_edit_pos", - "Position after", mandatory, allTerms, previousTermCodeOrNull); + VocabularyTermSelectionWidget result = new VocabularyTermSelectionWidget( + getId() + "_edit_pos", "Position after", mandatory, + allTerms, previousTermCodeOrNull); result.setEmptyText("empty value == beginning"); return result; } @@ -320,8 +332,10 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> { // - 0 if nothing is selected (move to the beginning), // - (otherwise) selected term's ordinal - VocabularyTermModel selectedItem = termSelectionWidget.getValue(); - return selectedItem != null ? selectedItem.getTerm().getOrdinal() : 0; + VocabularyTermModel selectedItem = termSelectionWidget + .getValue(); + return selectedItem != null ? selectedItem.getTerm() + .getOrdinal() : 0; } }; } @@ -347,7 +361,8 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> DefaultResultSetConfig<String, TableModelRowWithObject<VocabularyTermWithStats>> resultSetConfig, AbstractAsyncCallback<TypedTableResultSet<VocabularyTermWithStats>> callback) { - viewContext.getService().listVocabularyTerms(vocabulary, resultSetConfig, callback); + viewContext.getService().listVocabularyTerms(vocabulary, + resultSetConfig, callback); } @Override @@ -355,7 +370,8 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> TableExportCriteria<TableModelRowWithObject<VocabularyTermWithStats>> exportCriteria, AbstractAsyncCallback<String> callback) { - viewContext.getService().prepareExportVocabularyTerms(exportCriteria, callback); + viewContext.getService().prepareExportVocabularyTerms(exportCriteria, + callback); } @Override @@ -366,10 +382,11 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> private Window createUpdateTermsDialog() { - final String title = - viewContext.getMessage(Dict.UPDATE_VOCABULARY_TERMS_TITLE, vocabulary.getCode()); + final String title = viewContext.getMessage( + Dict.UPDATE_VOCABULARY_TERMS_TITLE, vocabulary.getCode()); - return new AbstractRegistrationDialog(viewContext, title, postRegistrationCallback) + return new AbstractRegistrationDialog(viewContext, title, + postRegistrationCallback) { public static final String ID = GenericConstants.ID_PREFIX @@ -388,19 +405,21 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> form.setMethod(Method.POST); form.add(AbstractRegistrationForm.createHiddenField( AbstractRegistrationForm.SESSION_KEYS_NUMBER, "1")); - form.add(AbstractRegistrationForm.createHiddenSessionField(termsSessionKey, 0)); + form.add(AbstractRegistrationForm.createHiddenSessionField( + termsSessionKey, 0)); insert(createMessageField(), 0); addField(createImportFileField()); - form.addListener(Events.Submit, new FormPanelListener(new InfoBox(viewContext)) + form.addListener(Events.Submit, new FormPanelListener( + new InfoBox(viewContext)) { @Override protected void onSuccessfullUpload() { - viewContext.getService().updateVocabularyTerms(termsSessionKey, - TechId.create(vocabulary), + viewContext.getService().updateVocabularyTerms( + termsSessionKey, TechId.create(vocabulary), new AbstractAsyncCallback<Void>(viewContext) { @@ -420,17 +439,19 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> }); saveButton.removeAllListeners(); - saveButton.addSelectionListener(new SelectionListener<ButtonEvent>() - { - @Override - public final void componentSelected(final ButtonEvent ce) - { - if (form.isValid()) + saveButton + .addSelectionListener(new SelectionListener<ButtonEvent>() { - form.submit(); - } - } - }); + @Override + public final void componentSelected( + final ButtonEvent ce) + { + if (form.isValid()) + { + form.submit(); + } + } + }); DialogWithOnlineHelpUtils.addHelpButton(viewContext, this, createHelpPageIdentifier()); @@ -438,8 +459,8 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> private FileUploadField createImportFileField() { - BasicFileFieldManager fileManager = - new BasicFileFieldManager(termsSessionKey, 1, "File"); + BasicFileFieldManager fileManager = new BasicFileFieldManager( + termsSessionKey, 1, "File"); fileManager.setMandatory(); return fileManager.getFields().get(0); } @@ -448,13 +469,13 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> { final LabelField messageField = new LabelField(); messageField.setStyleAttribute("margin-left", "5px"); - final String fileFormat = - viewContext.getMessage(Dict.VOCABULARY_TERMS_FILE_FORMAT); - final String exportMsg = - viewContext.getMessage(Dict.UPDATE_VOCABULARY_TERMS_MESSAGE_2); - final String msgText = - viewContext.getMessage(Dict.UPDATE_VOCABULARY_TERMS_MESSAGE, - fileFormat, exportMsg); + final String fileFormat = viewContext + .getMessage(Dict.VOCABULARY_TERMS_FILE_FORMAT); + final String exportMsg = viewContext + .getMessage(Dict.UPDATE_VOCABULARY_TERMS_MESSAGE_2); + final String msgText = viewContext.getMessage( + Dict.UPDATE_VOCABULARY_TERMS_MESSAGE, fileFormat, + exportMsg); messageField.setText(msgText); return messageField; } @@ -467,7 +488,8 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> private HelpPageIdentifier createHelpPageIdentifier() { - return new HelpPageIdentifier(HelpPageIdentifier.HelpPageDomain.TERM, + return new HelpPageIdentifier( + HelpPageIdentifier.HelpPageDomain.TERM, HelpPageIdentifier.HelpPageAction.BATCH_UPDATE); } @@ -476,24 +498,34 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> private Window createAddNewTermsDialog() { - final String title = viewContext.getMessage(Dict.ADD_VOCABULARY_TERMS_TITLE); + final String title = viewContext + .getMessage(Dict.ADD_VOCABULARY_TERMS_TITLE); - return new AbstractRegistrationDialog(viewContext, title, postRegistrationCallback) + return new AbstractRegistrationDialog(viewContext, title, + postRegistrationCallback) { private final VocabularyTermSelectionWidget termSelectionWidget; private final TextArea newTermCodesArea; - { + private final TextArea newTermsLabelsArea; + private final TextArea newTermDescriptionsArea; + + { form.setLabelWidth(LABEL_WIDTH); form.setFieldWidth(FIELD_WIDTH); this.setWidth(LABEL_WIDTH + FIELD_WIDTH + 50); newTermCodesArea = createNewTermCodesArea(); addField(newTermCodesArea); + newTermsLabelsArea = createNewTermLabelArea(); + addField(newTermsLabelsArea); + newTermDescriptionsArea = createNewTermDescriptionArea(); + addField(newTermDescriptionsArea); - // if vocabulary term cannot be choosen from list there is no need to edit order + // if vocabulary term cannot be choosen from list there is no + // need to edit order if (vocabulary.isChosenFromList()) { termSelectionWidget = createTermSelectionWidget(); @@ -511,9 +543,34 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> protected void register(AsyncCallback<Void> registrationCallback) { List<VocabularyTerm> newVocabularyTermCodes = extractNewVocabularyTermCodes(); + String[] labels = extractNewVocabularyTermLabels(); + if (labels.length != 0 && newVocabularyTermCodes.size() != labels.length) + { + MessageBox.alert("Error", "You need to have the same number of codes and labels.", null); + } else + { + for (int i = 0; i < labels.length; i++) + { + newVocabularyTermCodes.get(i).setLabel(labels[i]); + } + } + String[] descriptions = extractNewVocabularyTermDescriptions(); + if (descriptions.length != 0 && newVocabularyTermCodes.size() != descriptions.length) + { + MessageBox.alert("Error", "You need to have the same number of codes and descriptions.", null); + } else + { + for (int i = 0; i < descriptions.length; i++) + { + newVocabularyTermCodes.get(i).setDescription(descriptions[i]); + } + } + Long previousTermOrdinal = extractPreviousTermOrdinal(); - viewContext.getService().addVocabularyTerms(TechId.create(vocabulary), - newVocabularyTermCodes, previousTermOrdinal, registrationCallback); + + viewContext.getService().addVocabularyTerms( + TechId.create(vocabulary), newVocabularyTermCodes, + previousTermOrdinal, registrationCallback); } private TextArea createNewTermCodesArea() @@ -525,24 +582,63 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> return result; } + private TextArea createNewTermDescriptionArea() + { + final TextArea result = new TextArea(); + result.setFieldLabel(viewContext.getMessage(Dict.VOCABULARY_TERMS_DESCRIPTION)); + result.setEmptyText(viewContext.getMessage(Dict.VOCABULARY_TERMS_DESCRIPTION_EMPTY)); + return result; + } + + private TextArea createNewTermLabelArea() + { + final TextArea result = new TextArea(); + result.setFieldLabel(viewContext.getMessage(Dict.VOCABULARY_TERMS_LABEL)); + result.setEmptyText(viewContext.getMessage(Dict.VOCABULARY_TERMS_LABEL_EMPTY)); + return result; + } + private VocabularyTermSelectionWidget createTermSelectionWidget() { // by default - append final List<VocabularyTerm> allTerms = getTerms(); - final String lastTermCodeOrNull = - (allTerms.size() > 0) ? allTerms.get(allTerms.size() - 1).getCode() - : null; + final String lastTermCodeOrNull = (allTerms.size() > 0) ? allTerms.get(allTerms.size() - 1).getCode() : null; boolean mandatory = false; VocabularyTermSelectionWidget result = - new VocabularyTermSelectionWidget(getId() + "_add_pos", - "Position after", mandatory, allTerms, lastTermCodeOrNull); + new VocabularyTermSelectionWidget(getId() + "_add_pos", "Position after", mandatory, allTerms, lastTermCodeOrNull); result.setEmptyText("empty value == beginning"); return result; } private List<VocabularyTerm> extractNewVocabularyTermCodes() { - return VocabularyTermValidator.getTerms(newTermCodesArea.getValue()); + return VocabularyTermValidator.getTerms(newTermCodesArea + .getValue()); + } + + private String[] extractNewVocabularyTermLabels() + { + String value = newTermsLabelsArea.getValue(); + if (value != null) + { + return value.split(","); + } else + { + return new String[] {}; + } + + } + + private String[] extractNewVocabularyTermDescriptions() + { + String value = newTermDescriptionsArea.getValue(); + if (value != null) + { + return value.split(","); + } else + { + return new String[] {}; + } } /** @@ -552,21 +648,25 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> { if (termSelectionWidget == null) { - // last terms position (append) if vocabulary will not be chosen from list + // last terms position (append) if vocabulary will not be + // chosen from list final List<VocabularyTerm> allTerms = getTerms(); - return (allTerms.size() > 0) ? allTerms.get(allTerms.size() - 1) - .getOrdinal() : 0L; + return (allTerms.size() > 0) ? allTerms.get( + allTerms.size() - 1).getOrdinal() : 0L; } else { // 0 if nothing was selected to enable prepend - VocabularyTermModel selectedItem = termSelectionWidget.getValue(); - return selectedItem != null ? selectedItem.getTerm().getOrdinal() : 0L; + VocabularyTermModel selectedItem = termSelectionWidget + .getValue(); + return selectedItem != null ? selectedItem.getTerm() + .getOrdinal() : 0L; } } private HelpPageIdentifier createHelpPageIdentifier() { - return new HelpPageIdentifier(HelpPageIdentifier.HelpPageDomain.TERM, + return new HelpPageIdentifier( + HelpPageIdentifier.HelpPageDomain.TERM, HelpPageIdentifier.HelpPageAction.REGISTER); } }; @@ -581,27 +681,27 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> @Override public DatabaseModificationKind[] getRelevantModifications() { - // refresh when any high level entity or property assignment is modified/created/deleted - return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.DATA_SET), - DatabaseModificationKind.edit(ObjectKind.DATA_SET), - DatabaseModificationKind.createOrDelete(ObjectKind.EXPERIMENT), - DatabaseModificationKind.edit(ObjectKind.EXPERIMENT), - DatabaseModificationKind.createOrDelete(ObjectKind.MATERIAL), - DatabaseModificationKind.edit(ObjectKind.MATERIAL), - DatabaseModificationKind.createOrDelete(ObjectKind.SAMPLE), - DatabaseModificationKind.edit(ObjectKind.SAMPLE), - DatabaseModificationKind.createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - DatabaseModificationKind.edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - // (unofficial) terms may also be created outside of the grid - DatabaseModificationKind.createOrDelete(ObjectKind.VOCABULARY_TERM), - DatabaseModificationKind.edit(ObjectKind.VOCABULARY_TERM) }; + // refresh when any high level entity or property assignment is + // modified/created/deleted + return new DatabaseModificationKind[] { + DatabaseModificationKind.createOrDelete(ObjectKind.DATA_SET), + DatabaseModificationKind.edit(ObjectKind.DATA_SET), + DatabaseModificationKind.createOrDelete(ObjectKind.EXPERIMENT), + DatabaseModificationKind.edit(ObjectKind.EXPERIMENT), + DatabaseModificationKind.createOrDelete(ObjectKind.MATERIAL), + DatabaseModificationKind.edit(ObjectKind.MATERIAL), + DatabaseModificationKind.createOrDelete(ObjectKind.SAMPLE), + DatabaseModificationKind.edit(ObjectKind.SAMPLE), + DatabaseModificationKind.createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + DatabaseModificationKind.edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + // (unofficial) terms may also be created outside of the grid + DatabaseModificationKind.createOrDelete(ObjectKind.VOCABULARY_TERM), + DatabaseModificationKind.edit(ObjectKind.VOCABULARY_TERM) }; } private void deleteTerms() { - List<BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>>> terms = - getSelectedItems(); + List<BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>>> terms = getSelectedItems(); if (terms.isEmpty()) { return; @@ -609,16 +709,17 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> if (terms.size() == getTerms().size()) { MessageBox.alert(viewContext.getMessage(Dict.DELETE_VOCABULARY_TERMS_INVALID_TITLE), - viewContext.getMessage(Dict.DELETE_VOCABULARY_TERMS_INVALID_MESSAGE), null); + viewContext.getMessage(Dict.DELETE_VOCABULARY_TERMS_INVALID_MESSAGE), + null); return; } Set<String> selectedTerms = new HashSet<String>(); List<VocabularyTerm> termsToBeDeleted = new ArrayList<VocabularyTerm>(); - List<VocabularyTermReplacement> termsToBeReplaced = - new ArrayList<VocabularyTermReplacement>(); + List<VocabularyTermReplacement> termsToBeReplaced = new ArrayList<VocabularyTermReplacement>(); for (BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>> model : terms) { - VocabularyTerm term = model.getBaseObject().getObjectOrNull().getTerm(); + VocabularyTerm term = model.getBaseObject().getObjectOrNull() + .getTerm(); selectedTerms.add(term.getCode()); if (model.getBaseObject().getObjectOrNull().getTotalUsageCounter() > 0) { @@ -644,17 +745,13 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> String message; if (size == 1) { - message = - viewContext - .getMessage(Dict.DELETE_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_NO_REPLACEMENTS_SINGULAR); + message = viewContext.getMessage(Dict.DELETE_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_NO_REPLACEMENTS_SINGULAR); } else { - message = - viewContext.getMessage( - Dict.DELETE_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_NO_REPLACEMENTS, - size); + message = viewContext.getMessage(Dict.DELETE_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_NO_REPLACEMENTS, size); } - ConfirmationDialog confirmationDialog = new ConfirmationDialog(title, message) + ConfirmationDialog confirmationDialog = new ConfirmationDialog( + title, message) { @Override protected void onYes() @@ -673,14 +770,14 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> termsForReplacement.add(term); } } - askForReplacements(termsToBeDeleted, termsToBeReplaced, termsForReplacement); + askForReplacements(termsToBeDeleted, termsToBeReplaced, + termsForReplacement); } } private void makeOfficial() { - List<BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>>> terms = - getSelectedItems(); + List<BaseEntityModel<TableModelRowWithObject<VocabularyTermWithStats>>> terms = getSelectedItems(); if (terms.isEmpty()) { return; @@ -695,29 +792,25 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> termsToBeOfficial.add(term); } - String title = - viewContext.getMessage(Dict.MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_TITLE); + String title = viewContext.getMessage(Dict.MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_TITLE); int size = termsToBeOfficial.size(); String message; if (size == 1) { - message = - viewContext - .getMessage(Dict.MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_SINGULAR); + message = viewContext.getMessage(Dict.MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_SINGULAR); } else { - message = - viewContext.getMessage( - Dict.MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_MESSAGE, size); + message = viewContext.getMessage(Dict.MAKE_OFFICIAL_VOCABULARY_TERMS_CONFIRMATION_MESSAGE, size); } - ConfirmationDialog confirmationDialog = new ConfirmationDialog(title, message) + ConfirmationDialog confirmationDialog = new ConfirmationDialog(title, + message) { @Override protected void onYes() { RefreshCallback callback = new RefreshCallback(viewContext); - viewContext.getService().makeVocabularyTermsOfficial(TechId.create(vocabulary), - termsToBeOfficial, callback); + viewContext.getService().makeVocabularyTermsOfficial( + TechId.create(vocabulary), termsToBeOfficial, callback); } }; @@ -735,14 +828,18 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> return terms; } - private void askForReplacements(final List<VocabularyTerm> termsToBeDeleted, + private void askForReplacements( + final List<VocabularyTerm> termsToBeDeleted, final List<VocabularyTermReplacement> termsToBeReplaced, List<VocabularyTerm> termsForReplacement) { VerticalPanel panel = new VerticalPanel(); int totalNumber = termsToBeDeleted.size() + termsToBeReplaced.size(); - panel.add(new Text(viewContext.getMessage( - Dict.DELETE_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_FOR_REPLACEMENTS, totalNumber))); + panel.add(new Text( + viewContext + .getMessage( + Dict.DELETE_VOCABULARY_TERMS_CONFIRMATION_MESSAGE_FOR_REPLACEMENTS, + totalNumber))); final FormPanel formPanel = new FormPanel(); formPanel.setLabelWidth(LABEL_WIDTH_IN_REPLACEMENT_DIALOG); formPanel.setFieldWidth(FIELD_WIDTH_IN_REPLACEMENT_DIALOG); @@ -750,28 +847,34 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> formPanel.setHeaderVisible(false); formPanel.setBodyBorder(false); panel.add(formPanel); - String title = viewContext.getMessage(Dict.DELETE_VOCABULARY_TERMS_CONFIRMATION_TITLE); - String okButtonLable = viewContext.getMessage(Dict.ADD_VOCABULARY_TERMS_OK_BUTTON); - final SimpleDialog dialog = new SimpleDialog(panel, title, okButtonLable, viewContext); + String title = viewContext + .getMessage(Dict.DELETE_VOCABULARY_TERMS_CONFIRMATION_TITLE); + String okButtonLable = viewContext + .getMessage(Dict.ADD_VOCABULARY_TERMS_OK_BUTTON); + final SimpleDialog dialog = new SimpleDialog(panel, title, + okButtonLable, viewContext); dialog.setScrollMode(Scroll.AUTOY); - dialog.setWidth(LABEL_WIDTH_IN_REPLACEMENT_DIALOG + FIELD_WIDTH_IN_REPLACEMENT_DIALOG + 50); + dialog.setWidth(LABEL_WIDTH_IN_REPLACEMENT_DIALOG + + FIELD_WIDTH_IN_REPLACEMENT_DIALOG + 50); dialog.setEnableOfAcceptButton(false); for (final VocabularyTermReplacement termToBeReplaced : termsToBeReplaced) { String term = termToBeReplaced.getTerm().getCode(); - // TODO 2009-06-26, IA: do we really want to load almost all the terms from large + // TODO 2009-06-26, IA: do we really want to load almost all the + // terms from large // vocabulary to the drop down list? - final VocabularyTermSelectionWidget s = - new VocabularyTermSelectionWidget(getId() + term, term, true, - termsForReplacement, null); + final VocabularyTermSelectionWidget s = new VocabularyTermSelectionWidget( + getId() + term, term, true, termsForReplacement, null); s.addSelectionChangedListener(new SelectionChangedListener<VocabularyTermModel>() { @Override - public void selectionChanged(SelectionChangedEvent<VocabularyTermModel> se) + public void selectionChanged( + SelectionChangedEvent<VocabularyTermModel> se) { VocabularyTermModel selectedItem = se.getSelectedItem(); - termToBeReplaced.setReplacementCode(selectedItem == null ? null - : selectedItem.getTerm().getCode()); + termToBeReplaced + .setReplacementCode(selectedItem == null ? null + : selectedItem.getTerm().getCode()); dialog.setEnableOfAcceptButton(formPanel.isValid()); } }); @@ -787,8 +890,9 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> } }); - DialogWithOnlineHelpUtils.addHelpButton(viewContext, dialog, new HelpPageIdentifier( - HelpPageIdentifier.HelpPageDomain.TERM, HelpPageIdentifier.HelpPageAction.DELETE)); + DialogWithOnlineHelpUtils.addHelpButton(viewContext, dialog, + new HelpPageIdentifier(HelpPageIdentifier.HelpPageDomain.TERM, + HelpPageIdentifier.HelpPageAction.DELETE)); dialog.show(); } @@ -796,8 +900,9 @@ public class VocabularyTermGrid extends TypedTableGrid<VocabularyTermWithStats> List<VocabularyTermReplacement> termsToBeReplaced) { RefreshCallback callback = new RefreshCallback(viewContext); - viewContext.getService().deleteVocabularyTerms(TechId.create(vocabulary), termsToBeDeleted, - termsToBeReplaced, callback); + viewContext.getService().deleteVocabularyTerms( + TechId.create(vocabulary), termsToBeDeleted, termsToBeReplaced, + callback); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js index c1ef1765117b79ebab411c0a13d602c984327b87..ac1f98a73dfc50553e2a1e47914fc4fcb6607905 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js @@ -693,6 +693,10 @@ var common = { is_managed_internally: "Managed Internally?", url_template: "URL Template", terms: "Terms", + descriptions: "Descriptions", + vocabulary_terms_description_empty: "Comma separated list of descriptions or none.", + labels: "Labels", + vocabulary_terms_label_empty: "Comma separated list of labels or none.", VOCABULARY_TERMS_BROWSER: "Vocabulary Terms of {0}", TERM_FOR_SAMPLES_USAGE: "Usages for Samples", TERM_FOR_DATA_SET_USAGE: "Usages for Data Sets",