2016-06-13 09:48:29 +02:00
/ * *
*
* /
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.view ;
2021-06-15 18:37:17 +02:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ClickedCMSManageProductButtonEvent ;
2016-06-22 16:23:51 +02:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEvent ;
2016-06-13 09:48:29 +02:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.InsertMetadataEvent ;
2019-12-09 12:33:01 +01:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.PublishOnZenodoEvent ;
2017-04-03 16:43:36 +02:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShareLinkEvent ;
2016-12-12 14:49:42 +01:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowDatasetsEvent ;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowGroupsEvent ;
2016-06-22 17:09:57 +02:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowHomeEvent ;
2016-11-29 17:20:50 +01:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowManageProductWidgetEvent ;
2016-12-12 14:49:42 +01:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowOrganizationsEvent ;
2016-06-22 16:23:51 +02:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowStatisticsEvent ;
2017-09-19 11:55:45 +02:00
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowTypesEvent ;
2016-06-13 09:48:29 +02:00
import com.github.gwtbootstrap.client.ui.AlertBlock ;
import com.github.gwtbootstrap.client.ui.Button ;
import com.github.gwtbootstrap.client.ui.constants.AlertType ;
import com.github.gwtbootstrap.client.ui.constants.ButtonType ;
2016-06-22 16:23:51 +02:00
import com.github.gwtbootstrap.client.ui.constants.IconType ;
2016-11-30 11:17:30 +01:00
import com.google.gwt.dom.client.Style.Float ;
2017-02-16 17:50:43 +01:00
import com.google.gwt.dom.client.Style.FontWeight ;
2016-06-13 09:48:29 +02:00
import com.google.gwt.dom.client.Style.Unit ;
import com.google.gwt.event.dom.client.ClickEvent ;
import com.google.gwt.event.dom.client.ClickHandler ;
import com.google.gwt.event.shared.HandlerManager ;
import com.google.gwt.user.client.ui.FlowPanel ;
2016-12-12 14:49:42 +01:00
import com.google.gwt.user.client.ui.InlineHTML ;
2016-06-13 09:48:29 +02:00
/ * *
* The Class CkanMetadataManagementPanel .
*
* @author Francesco Mangiacrapa francesco . mangiacrapa @isti.cnr.it
2021-06-15 18:37:17 +02:00
* @author Costantino Perciante costantino . perciante @isti.cnr.it Jun 9 , 2016
*
2016-06-13 09:48:29 +02:00
* /
2021-06-15 18:37:17 +02:00
public class CkanMetadataManagementPanel extends FlowPanel {
2016-06-13 09:48:29 +02:00
2018-08-30 17:35:45 +02:00
/ * *
*
* /
private static final String MY_PREFIX = " My " ;
2021-06-15 18:37:17 +02:00
private static final String MANAGE_GRSF_ITEM_TOOLTIP = " By pushing on this button, you will be able to manage the item you are viewing. "
2017-02-16 17:50:43 +01:00
+ " Manageable items are the GRSF ones. " ;
2021-06-15 18:37:17 +02:00
private static final String MANAGE_CMS_ITEMS_TOOLTIP = " By pushing on this button, you will be able to manage (APPROVING or REJECTING) the item under approval "
+ " Manageable items are not APPROVED and NOT PUBLISHED in the Catalogue. " ;
2016-06-13 09:48:29 +02:00
private AlertBlock nav = new AlertBlock ( ) ;
2016-12-12 14:49:42 +01:00
// generic
2016-06-22 17:09:57 +02:00
private Button home = new Button ( " Home " ) ;
2016-12-12 14:49:42 +01:00
private Button organizations = new Button ( " Organizations " ) ;
private Button groups = new Button ( " Groups " ) ;
2017-02-16 17:50:43 +01:00
private Button items = new Button ( " Items " ) ;
2017-09-19 11:55:45 +02:00
private Button types = new Button ( " Types " ) ;
2016-12-12 14:49:42 +01:00
// user's own
2017-02-06 18:30:47 +01:00
private InlineHTML separatorMyInfo = null ;
2016-12-12 14:49:42 +01:00
private InlineHTML separatorAdminButtons = null ;
2017-02-15 17:09:58 +01:00
private Button myDatasets = new Button ( " My Items " ) ;
2016-06-22 16:23:51 +02:00
private Button myOrganizations = new Button ( " My Organizations " ) ;
2016-06-23 18:30:01 +02:00
private Button myGroups = new Button ( " My Groups " ) ;
2016-12-12 14:49:42 +01:00
// statistics
2016-06-22 16:23:51 +02:00
private Button statistics = new Button ( " Statistics " ) ;
2016-12-12 14:49:42 +01:00
// other stuff
2017-04-04 16:31:21 +02:00
private Button shareLink = new Button ( " Share Link " ) ;
2020-01-21 17:12:29 +01:00
private Button uploadToZenodo = new Button ( " Upload to Zenodo " ) ;
2017-02-15 17:09:58 +01:00
private Button insertMeta = new Button ( " Publish Item " ) ;
private Button editMeta = new Button ( " Edit Item " ) ;
2022-02-17 17:01:25 +01:00
private Button manageGRSFProduct = new Button ( " Manage GRSF Item " ) ; //GRSF Manage
private Button manageCModS = new Button ( " Manage Items " ) ; //Moderation
2016-06-13 09:48:29 +02:00
private HandlerManager eventBus ;
/ * *
* Instantiates a new ckan metadata management panel .
2018-08-30 17:35:45 +02:00
*
* @param eventBus the event bus
2016-06-13 09:48:29 +02:00
* /
2021-06-15 18:37:17 +02:00
public CkanMetadataManagementPanel ( HandlerManager eventBus ) {
2016-06-13 09:48:29 +02:00
this . eventBus = eventBus ;
2021-06-15 18:37:17 +02:00
// this.getElement().getStyle().setPaddingTop(H_OFFSET, Unit.PX);
// this.getElement().getStyle().setPaddingBottom(H_OFFSET, Unit.PX);
2016-06-22 16:23:51 +02:00
// set link style buttons
2016-06-22 17:09:57 +02:00
home . setType ( ButtonType . LINK ) ;
2016-12-12 14:49:42 +01:00
organizations . setType ( ButtonType . LINK ) ;
groups . setType ( ButtonType . LINK ) ;
2017-02-16 17:50:43 +01:00
items . setType ( ButtonType . LINK ) ;
2017-09-19 11:55:45 +02:00
types . setType ( ButtonType . LINK ) ;
2017-04-11 16:04:27 +02:00
2016-06-22 16:23:51 +02:00
myDatasets . setType ( ButtonType . LINK ) ;
myOrganizations . setType ( ButtonType . LINK ) ;
2016-06-23 18:30:01 +02:00
myGroups . setType ( ButtonType . LINK ) ;
2016-12-12 14:49:42 +01:00
statistics . setType ( ButtonType . LINK ) ;
2017-04-11 16:04:27 +02:00
2017-04-04 16:31:21 +02:00
shareLink . setType ( ButtonType . LINK ) ;
2020-01-21 17:12:29 +01:00
uploadToZenodo . setType ( ButtonType . LINK ) ;
2016-06-13 09:48:29 +02:00
insertMeta . setType ( ButtonType . LINK ) ;
editMeta . setType ( ButtonType . LINK ) ;
2021-06-15 18:37:17 +02:00
manageGRSFProduct . setType ( ButtonType . PRIMARY ) ;
manageGRSFProduct . getElement ( ) . getStyle ( ) . setFloat ( Float . RIGHT ) ;
2022-02-17 17:01:25 +01:00
manageCModS . setType ( ButtonType . PRIMARY ) ;
manageCModS . getElement ( ) . getStyle ( ) . setFloat ( Float . RIGHT ) ;
2022-02-17 17:15:11 +01:00
manageCModS . getElement ( ) . getStyle ( ) . setMarginRight ( 20 , Unit . PX ) ;
2016-06-22 16:23:51 +02:00
// set icons
2016-06-22 17:09:57 +02:00
home . setIcon ( IconType . HOME ) ;
2016-12-12 14:49:42 +01:00
organizations . setIcon ( IconType . BUILDING ) ;
groups . setIcon ( IconType . GROUP ) ;
2017-02-16 17:50:43 +01:00
items . setIcon ( IconType . SITEMAP ) ;
2017-09-19 11:55:45 +02:00
types . setIcon ( IconType . FILE_TEXT ) ;
2017-04-03 16:43:36 +02:00
shareLink . setIcon ( IconType . SHARE ) ;
2020-01-21 17:12:29 +01:00
uploadToZenodo . setIcon ( IconType . CIRCLE_ARROW_UP ) ;
2016-06-22 16:23:51 +02:00
myDatasets . setIcon ( IconType . SITEMAP ) ;
myOrganizations . setIcon ( IconType . BUILDING ) ;
2016-06-23 18:30:01 +02:00
myGroups . setIcon ( IconType . GROUP ) ;
2016-06-22 16:23:51 +02:00
insertMeta . setIcon ( IconType . FILE ) ;
editMeta . setIcon ( IconType . EDIT_SIGN ) ;
statistics . setIcon ( IconType . BAR_CHART ) ;
2021-06-15 18:37:17 +02:00
manageGRSFProduct . setIcon ( IconType . CHECK_SIGN ) ;
2022-02-17 17:01:25 +01:00
manageCModS . setIcon ( IconType . CHECK_SIGN ) ;
2016-12-12 14:49:42 +01:00
2016-06-22 16:23:51 +02:00
// hide edit and insert
2017-04-04 16:31:21 +02:00
shareLink . setEnabled ( false ) ;
2020-01-21 17:12:29 +01:00
uploadToZenodo . setEnabled ( false ) ;
2016-06-23 18:30:01 +02:00
editMeta . setVisible ( false ) ;
2016-06-22 16:23:51 +02:00
insertMeta . setVisible ( false ) ;
2021-06-15 18:37:17 +02:00
manageGRSFProduct . setVisible ( false ) ;
manageGRSFProduct . setEnabled ( false ) ;
2022-02-17 17:01:25 +01:00
manageCModS . setVisible ( false ) ;
manageCModS . setEnabled ( false ) ;
2021-06-15 18:37:17 +02:00
// manage GRSF item info
manageGRSFProduct . setTitle ( MANAGE_GRSF_ITEM_TOOLTIP ) ;
manageGRSFProduct . getElement ( ) . getStyle ( ) . setFontWeight ( FontWeight . BOLD ) ;
2017-04-11 16:04:27 +02:00
2021-06-15 18:37:17 +02:00
// manage CMS item info
2022-02-17 17:01:25 +01:00
manageCModS . setTitle ( MANAGE_CMS_ITEMS_TOOLTIP ) ;
manageCModS . getElement ( ) . getStyle ( ) . setFontWeight ( FontWeight . BOLD ) ;
2016-06-22 16:23:51 +02:00
// add to navigation bar
2016-06-22 17:09:57 +02:00
nav . add ( home ) ;
2016-12-12 14:49:42 +01:00
nav . add ( organizations ) ;
nav . add ( groups ) ;
2017-02-16 17:50:43 +01:00
nav . add ( items ) ;
2017-09-19 11:55:45 +02:00
nav . add ( types ) ;
2016-12-12 14:49:42 +01:00
nav . add ( statistics ) ;
2017-02-06 18:30:47 +01:00
separatorMyInfo = new InlineHTML ( " <span style= \" font-weight:bold;vertical-alignment:middle; \" >|</span> " ) ;
separatorMyInfo . setVisible ( true ) ;
nav . add ( separatorMyInfo ) ;
2016-06-22 16:23:51 +02:00
nav . add ( myOrganizations ) ;
2016-06-23 18:30:01 +02:00
nav . add ( myGroups ) ;
2016-12-12 17:08:03 +01:00
nav . add ( myDatasets ) ;
2016-12-12 14:49:42 +01:00
separatorAdminButtons = new InlineHTML ( " <span style= \" font-weight:bold;vertical-alignment:middle; \" >|</span> " ) ;
2017-04-04 16:31:21 +02:00
separatorAdminButtons . setVisible ( true ) ;
2016-12-12 14:49:42 +01:00
nav . add ( separatorAdminButtons ) ;
2017-04-04 16:31:21 +02:00
nav . add ( shareLink ) ;
2020-01-21 17:12:29 +01:00
nav . add ( uploadToZenodo ) ;
2016-06-13 09:48:29 +02:00
nav . add ( insertMeta ) ;
nav . add ( editMeta ) ;
2021-06-15 18:37:17 +02:00
nav . add ( manageGRSFProduct ) ;
2022-02-17 17:01:25 +01:00
nav . add ( manageCModS ) ;
2016-06-13 09:48:29 +02:00
nav . setClose ( false ) ;
nav . setType ( AlertType . INFO ) ;
nav . getElement ( ) . getStyle ( ) . setMarginBottom ( 0 , Unit . PX ) ;
nav . getElement ( ) . getStyle ( ) . setBackgroundColor ( " #FFF " ) ;
addHandlers ( ) ;
add ( nav ) ;
}
/ * *
2018-08-30 17:35:45 +02:00
* Adds the handlers .
2016-06-13 09:48:29 +02:00
* /
2018-08-30 15:19:49 +02:00
private void addHandlers ( ) {
2016-06-23 18:30:01 +02:00
2016-06-22 17:09:57 +02:00
home . addClickHandler ( new ClickHandler ( ) {
2016-06-23 18:30:01 +02:00
2016-06-22 17:09:57 +02:00
@Override
public void onClick ( ClickEvent event ) {
2016-06-23 18:30:01 +02:00
2016-06-22 17:09:57 +02:00
eventBus . fireEvent ( new ShowHomeEvent ( ) ) ;
2016-06-23 18:30:01 +02:00
2016-06-22 17:09:57 +02:00
}
} ) ;
2016-06-13 09:48:29 +02:00
2016-12-12 14:49:42 +01:00
organizations . addClickHandler ( new ClickHandler ( ) {
@Override
public void onClick ( ClickEvent event ) {
eventBus . fireEvent ( new ShowOrganizationsEvent ( false ) ) ;
}
} ) ;
groups . addClickHandler ( new ClickHandler ( ) {
@Override
public void onClick ( ClickEvent event ) {
eventBus . fireEvent ( new ShowGroupsEvent ( false ) ) ;
}
} ) ;
2017-02-16 17:50:43 +01:00
items . addClickHandler ( new ClickHandler ( ) {
2016-12-12 14:49:42 +01:00
@Override
public void onClick ( ClickEvent event ) {
eventBus . fireEvent ( new ShowDatasetsEvent ( false ) ) ;
}
} ) ;
2018-08-30 15:19:49 +02:00
2017-09-19 11:55:45 +02:00
types . addClickHandler ( new ClickHandler ( ) {
@Override
public void onClick ( ClickEvent event ) {
eventBus . fireEvent ( new ShowTypesEvent ( false ) ) ;
}
} ) ;
2016-12-12 14:49:42 +01:00
2016-06-13 09:48:29 +02:00
insertMeta . addClickHandler ( new ClickHandler ( ) {
@Override
public void onClick ( ClickEvent event ) {
eventBus . fireEvent ( new InsertMetadataEvent ( ) ) ;
}
} ) ;
editMeta . addClickHandler ( new ClickHandler ( ) {
@Override
public void onClick ( ClickEvent event ) {
2016-06-22 16:23:51 +02:00
eventBus . fireEvent ( new EditMetadataEvent ( ) ) ;
}
} ) ;
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
myDatasets . addClickHandler ( new ClickHandler ( ) {
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
@Override
public void onClick ( ClickEvent event ) {
2016-06-23 18:30:01 +02:00
2016-12-12 14:49:42 +01:00
eventBus . fireEvent ( new ShowDatasetsEvent ( true ) ) ;
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
}
} ) ;
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
myOrganizations . addClickHandler ( new ClickHandler ( ) {
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
@Override
public void onClick ( ClickEvent event ) {
2016-06-23 18:30:01 +02:00
2016-12-12 14:49:42 +01:00
eventBus . fireEvent ( new ShowOrganizationsEvent ( true ) ) ;
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
}
} ) ;
2016-06-23 18:30:01 +02:00
myGroups . addClickHandler ( new ClickHandler ( ) {
@Override
public void onClick ( ClickEvent event ) {
2016-12-12 14:49:42 +01:00
eventBus . fireEvent ( new ShowGroupsEvent ( true ) ) ;
2016-06-23 18:30:01 +02:00
}
} ) ;
2016-06-22 16:23:51 +02:00
statistics . addClickHandler ( new ClickHandler ( ) {
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
@Override
public void onClick ( ClickEvent event ) {
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
eventBus . fireEvent ( new ShowStatisticsEvent ( ) ) ;
2016-06-23 18:30:01 +02:00
2016-06-13 09:48:29 +02:00
}
} ) ;
2021-06-15 18:37:17 +02:00
manageGRSFProduct . addClickHandler ( new ClickHandler ( ) {
@Override
public void onClick ( ClickEvent event ) {
eventBus . fireEvent ( new ShowManageProductWidgetEvent (
GCubeCkanDataCatalogPanel . getLatestSelectedProductIdentifier ( ) ) ) ;
}
} ) ;
2022-02-17 17:01:25 +01:00
manageCModS . addClickHandler ( new ClickHandler ( ) {
2016-11-29 17:20:50 +01:00
@Override
public void onClick ( ClickEvent event ) {
2021-06-15 18:37:17 +02:00
eventBus . fireEvent ( new ClickedCMSManageProductButtonEvent ( ) ) ;
2016-11-29 17:20:50 +01:00
}
} ) ;
2017-04-11 16:04:27 +02:00
2017-04-03 16:43:36 +02:00
shareLink . addClickHandler ( new ClickHandler ( ) {
2017-04-11 16:04:27 +02:00
2017-04-03 16:43:36 +02:00
@Override
public void onClick ( ClickEvent event ) {
2017-04-11 16:04:27 +02:00
2017-04-03 16:43:36 +02:00
eventBus . fireEvent ( new ShareLinkEvent ( GCubeCkanDataCatalogPanel . getLatestSelectedProductIdentifier ( ) ) ) ;
2017-04-11 16:04:27 +02:00
2017-04-03 16:43:36 +02:00
}
} ) ;
2021-06-15 18:37:17 +02:00
2020-01-21 17:12:29 +01:00
uploadToZenodo . addClickHandler ( new ClickHandler ( ) {
2021-06-15 18:37:17 +02:00
2019-12-09 12:03:51 +01:00
@Override
public void onClick ( ClickEvent event ) {
2021-06-15 18:37:17 +02:00
eventBus . fireEvent (
new PublishOnZenodoEvent ( GCubeCkanDataCatalogPanel . getLatestSelectedProductIdentifier ( ) ) ) ;
2019-12-09 12:03:51 +01:00
}
} ) ;
2016-06-13 09:48:29 +02:00
}
/ * *
* Gets the current height .
*
* @return the current height
* /
2021-06-15 18:37:17 +02:00
public int getCurrentHeight ( ) {
2016-06-13 09:48:29 +02:00
return this . getOffsetHeight ( ) ;
}
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
/ * *
2021-06-15 18:37:17 +02:00
* Those buttons can be only visible when the logged user has role
* edit / admin / sysadmin .
2018-08-30 17:35:45 +02:00
*
* @param show the show
2016-06-22 16:23:51 +02:00
* /
2021-06-15 18:37:17 +02:00
public void showInsertAndEditProductButtons ( boolean show ) {
2016-06-23 18:30:01 +02:00
2021-06-15 18:37:17 +02:00
// editMeta.setVisible(show); TODO
// separatorAdminButtons.setVisible(show);
2016-06-22 16:23:51 +02:00
insertMeta . setVisible ( show ) ;
2016-06-23 18:30:01 +02:00
2016-06-22 16:23:51 +02:00
}
2016-06-29 18:35:01 +02:00
2016-11-29 17:20:50 +01:00
/ * *
2021-06-15 18:37:17 +02:00
* Button to manage the GRSF product . . for example in grsf case
2018-08-30 17:35:45 +02:00
*
2016-11-29 17:20:50 +01:00
* @param value true or false
* /
2021-06-15 18:37:17 +02:00
public void showManageGRSFProductButton ( boolean value ) {
manageGRSFProduct . setVisible ( value ) ;
2016-11-29 17:20:50 +01:00
}
2016-12-12 14:49:42 +01:00
2016-11-30 11:17:30 +01:00
/ * *
2018-08-30 17:35:45 +02:00
* Enable or disable the manage product button .
*
* @param value the value
2016-11-30 11:17:30 +01:00
* /
2021-06-15 18:37:17 +02:00
public void enableManageGRSFProductButton ( boolean value ) {
manageGRSFProduct . setEnabled ( value ) ;
}
/ * *
2022-02-17 17:01:25 +01:00
* Button to manage the products under moderation via Content Moderation System ( CMS )
2021-06-15 18:37:17 +02:00
*
* @param value true or false
* /
public void showManageCMSProductsButton ( boolean value ) {
2022-02-17 17:01:25 +01:00
manageCModS . setVisible ( value ) ;
2021-06-15 18:37:17 +02:00
}
/ * *
* Enable manage CMS products button .
*
* @param value the value
* /
public void enableManageCMSProductsButton ( boolean value ) {
2022-02-17 17:01:25 +01:00
manageCModS . setEnabled ( value ) ;
2016-11-30 11:17:30 +01:00
}
2017-04-11 16:04:27 +02:00
2017-04-03 16:43:36 +02:00
/ * *
2018-08-30 17:35:45 +02:00
* Enable or disable the share link button .
*
* @param value the value
2017-04-03 16:43:36 +02:00
* /
2021-06-15 18:37:17 +02:00
public void enableShareItemButton ( boolean value ) {
2017-04-03 16:43:36 +02:00
shareLink . setEnabled ( value ) ;
}
2016-12-12 14:49:42 +01:00
2019-12-09 12:33:01 +01:00
/ * *
* Enable publish on zenodo button .
*
* @param value the value
* /
2021-06-15 18:37:17 +02:00
public void enablePublishOnZenodoButton ( boolean value ) {
2020-01-21 17:12:29 +01:00
uploadToZenodo . setEnabled ( value ) ;
2019-12-09 12:33:01 +01:00
}
2021-10-05 11:33:37 +02:00
/ * *
* Visibility publish on zenodo button .
*
* @param value the value
* /
public void visibilityPublishOnZenodoButton ( boolean value ) {
uploadToZenodo . setVisible ( value ) ;
}
2019-12-09 12:33:01 +01:00
2016-06-29 18:35:01 +02:00
/ * *
2018-08-30 17:35:45 +02:00
* Show only home / statistics buttons .
2016-06-29 18:35:01 +02:00
* /
2021-06-15 18:37:17 +02:00
public void doNotShowUserRelatedInfo ( ) {
2016-06-29 18:35:01 +02:00
2017-02-06 18:30:47 +01:00
separatorMyInfo . setVisible ( false ) ;
2017-04-11 16:04:27 +02:00
separatorAdminButtons . setVisible ( false ) ;
shareLink . setVisible ( false ) ;
2020-01-21 17:12:29 +01:00
uploadToZenodo . setVisible ( false ) ;
2016-06-29 18:35:01 +02:00
insertMeta . setVisible ( false ) ;
editMeta . setVisible ( false ) ;
myDatasets . setVisible ( false ) ;
myOrganizations . setVisible ( false ) ;
myGroups . setVisible ( false ) ;
2021-06-15 18:37:17 +02:00
manageGRSFProduct . setVisible ( false ) ;
2022-02-17 17:01:25 +01:00
manageCModS . setVisible ( false ) ;
2016-06-29 18:35:01 +02:00
}
2017-11-28 14:41:53 +01:00
2018-08-30 17:35:45 +02:00
/ * *
* Removes the generic management buttons .
* /
2017-11-28 14:41:53 +01:00
public void removeGenericManagementButtons ( ) {
2017-11-30 17:00:49 +01:00
home . setVisible ( true ) ;
2017-11-28 14:41:53 +01:00
organizations . setVisible ( false ) ;
groups . setVisible ( false ) ;
items . setVisible ( false ) ;
types . setVisible ( false ) ;
separatorMyInfo . setVisible ( false ) ;
separatorAdminButtons . setVisible ( false ) ;
myDatasets . setVisible ( false ) ;
myOrganizations . setVisible ( false ) ;
myGroups . setVisible ( false ) ;
statistics . setVisible ( false ) ;
2021-06-15 18:37:17 +02:00
manageGRSFProduct . setVisible ( false ) ;
2022-02-17 17:01:25 +01:00
manageCModS . setVisible ( false ) ;
2018-08-30 15:19:49 +02:00
}
/ * *
* Customize label according translate .
*
2021-06-15 18:37:17 +02:00
* @param labelName the label name
2018-08-30 15:19:49 +02:00
* @param translateValue the translate value
* /
2021-06-15 18:37:17 +02:00
public void customizeLabelAccordingTranslate ( String labelName , String translateValue ) {
2018-08-30 15:19:49 +02:00
2021-06-15 18:37:17 +02:00
if ( labelName = = null | | labelName . isEmpty ( ) | | translateValue = = null | | translateValue . isEmpty ( ) )
2018-08-30 15:19:49 +02:00
return ;
2018-08-30 17:35:45 +02:00
// GWT.log("labelName "+labelName);
// GWT.log("translateValue "+translateValue);
// GWT.log("organizations "+organizations.getText());
2021-06-15 18:37:17 +02:00
if ( labelName . compareToIgnoreCase ( organizations . getText ( ) . trim ( ) ) = = 0 ) {
2018-08-30 15:19:49 +02:00
organizations . setText ( translateValue ) ;
2021-06-15 18:37:17 +02:00
// return;
} else if ( labelName . compareToIgnoreCase ( groups . getText ( ) . trim ( ) ) = = 0 ) {
2018-08-30 15:19:49 +02:00
groups . setText ( translateValue ) ;
2021-06-15 18:37:17 +02:00
// return;
} else if ( labelName . compareToIgnoreCase ( items . getText ( ) . trim ( ) ) = = 0 ) {
2018-08-30 15:19:49 +02:00
items . setText ( translateValue ) ;
2021-06-15 18:37:17 +02:00
// return;
} else if ( labelName . compareToIgnoreCase ( types . getText ( ) . trim ( ) ) = = 0 ) {
2018-08-30 15:19:49 +02:00
types . setText ( translateValue ) ;
2021-06-15 18:37:17 +02:00
// return;
2018-08-30 17:35:45 +02:00
}
2021-06-15 18:37:17 +02:00
String mylabelName = MY_PREFIX + labelName ;
2018-08-30 17:35:45 +02:00
// GWT.log("mylabelName "+mylabelName);
// GWT.log("myDatasets.getText() "+myDatasets.getText());
2021-06-15 18:37:17 +02:00
if ( mylabelName . compareToIgnoreCase ( myDatasets . getText ( ) . trim ( ) ) = = 0 ) {
myDatasets . setText ( MY_PREFIX + translateValue ) ;
// return;
} else if ( mylabelName . compareToIgnoreCase ( myOrganizations . getText ( ) . trim ( ) ) = = 0 ) {
myOrganizations . setText ( MY_PREFIX + translateValue ) ;
// return;
} else if ( mylabelName . compareToIgnoreCase ( myGroups . getText ( ) . trim ( ) ) = = 0 ) {
myGroups . setText ( MY_PREFIX + translateValue ) ;
// return;
2018-08-30 15:19:49 +02:00
}
2017-11-28 14:41:53 +01:00
}
2018-08-30 17:35:45 +02:00
/ * *
* Capitalize .
*
* @param stringValue the translate value
* @return the string
* /
2021-06-15 18:37:17 +02:00
public static String capitalize ( String stringValue ) {
return stringValue . substring ( 0 , 1 ) . toUpperCase ( ) + stringValue . substring ( 1 , stringValue . length ( ) ) ;
2018-08-30 17:35:45 +02:00
}
2016-06-13 09:48:29 +02:00
}