Working on Task #12286: Align portlet container labels to the new CKAN mapping
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@171245 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
e3324ba6b7
commit
234a64ee00
|
@ -1,4 +1,9 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-6-0"
|
||||
date="2018-30-08">
|
||||
<Change>[Task #12286]: Align portlet container labels to the new CKAN
|
||||
mapping</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-5-3"
|
||||
date="2018-03-22">
|
||||
<Change>Minor fix</Change>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
|||
<groupId>org.gcube.portlets.gcubeckan</groupId>
|
||||
<artifactId>gcube-ckan-datacatalog</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.5.3-SNAPSHOT</version>
|
||||
<version>1.6.0-SNAPSHOT</version>
|
||||
<name>gCube CKAN Data Catalog</name>
|
||||
<description>The gCube CKAN Data Catalog portlet</description>
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class GCubeCkanDataCatalog implements EntryPoint {
|
|||
*/
|
||||
public void onModuleLoad() {
|
||||
|
||||
GCubeCkanDataCatalogPanel panel =new GCubeCkanDataCatalogPanel(RootPanel.get(DIV_PORTLET_ID), eventManager.getEventBus());
|
||||
GCubeCkanDataCatalogPanel panel = new GCubeCkanDataCatalogPanel(RootPanel.get(DIV_PORTLET_ID), eventManager.getEventBus());
|
||||
eventManager.setPanel(panel);
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
insertMeta.setIcon(IconType.FILE);
|
||||
editMeta.setIcon(IconType.EDIT_SIGN);
|
||||
statistics.setIcon(IconType.BAR_CHART);
|
||||
manageProduct.setIcon(IconType.CHECK_SIGN);
|
||||
manageProduct.setIcon(IconType.CHECK_SIGN);
|
||||
|
||||
// hide edit and insert
|
||||
shareLink.setEnabled(false);
|
||||
|
@ -152,7 +152,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private void addHandlers() {
|
||||
private void addHandlers() {
|
||||
|
||||
home.addClickHandler(new ClickHandler() {
|
||||
|
||||
|
@ -193,7 +193,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
types.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
|
@ -308,7 +308,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
/**
|
||||
* Button to manage the product.. for example in grsf case
|
||||
* @param value true or false
|
||||
* @param isManageProductEnabled
|
||||
* @param isManageProductEnabled
|
||||
*/
|
||||
public void showManageProductButton(boolean value){
|
||||
manageProduct.setVisible(value);
|
||||
|
@ -359,6 +359,31 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
myGroups.setVisible(false);
|
||||
statistics.setVisible(false);
|
||||
manageProduct.setVisible(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Customize label according translate.
|
||||
*
|
||||
* @param labelName the label name
|
||||
* @param translateValue the translate value
|
||||
*/
|
||||
public void customizeLabelAccordingTranslate(String labelName, String translateValue){
|
||||
|
||||
|
||||
if(labelName==null || labelName.isEmpty() || translateValue==null || translateValue.isEmpty())
|
||||
return;
|
||||
|
||||
if(labelName==organizations.getText()){
|
||||
organizations.setText(translateValue);
|
||||
}else if(labelName==groups.getText()){
|
||||
groups.setText(translateValue);
|
||||
}else if(labelName==items.getText()){
|
||||
items.setText(translateValue);
|
||||
}else if(labelName==types.getText()){
|
||||
types.setText(translateValue);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,21 +68,21 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
|
||||
this.rootPanel = rootPanel;
|
||||
this.eventBus = eventManager;
|
||||
|
||||
|
||||
//postMessage(obj.toString(), ckanFramePanel.getFrame());
|
||||
// send message about gateway url
|
||||
obj = new JSONObject();
|
||||
String landingPageVREs = Window.Location.getProtocol() + "//" + Window.Location.getHostName() + "/explore";
|
||||
JSONString value = new JSONString(landingPageVREs);
|
||||
obj.put("explore_vres_landing_page", value);
|
||||
|
||||
|
||||
ckanFramePanel = new CkanFramePanel(eventBus);
|
||||
managementPanel = new CkanMetadataManagementPanel(eventBus);
|
||||
ckanOrganizationsPanel = new CkanOrganizationsPanel(this);
|
||||
ckanGroupsPanel = new CkanGroupsPanel(this);
|
||||
initPanel();
|
||||
setTopPanelVisible(true);
|
||||
|
||||
|
||||
// decode parameters (they could have been encoded)
|
||||
final Map<String, String> paramsMap = new HashMap<String, String>(2);
|
||||
String queryParameters = Window.Location.getQueryString();
|
||||
|
@ -151,34 +151,34 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// check if management buttons need to be removed
|
||||
GCubeCkanDataCatalog.service.isViewPerVREEnabled(new AsyncCallback<String>() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
|
||||
|
||||
if(result != null && !result.isEmpty()){
|
||||
// hide all management buttons
|
||||
managementPanel.removeGenericManagementButtons();
|
||||
|
||||
|
||||
// set real relative path
|
||||
ckanAccessPoint.addPathInfo(result);
|
||||
|
||||
|
||||
// save this information
|
||||
viewPerVREPath = result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
|
||||
// ?
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// retrieve organizations
|
||||
GCubeCkanDataCatalog.service.getCkanOrganizationsNamesAndUrlsForUser(new AsyncCallback<List<BeanUserInOrgGroupRole>>() {
|
||||
|
||||
|
@ -207,15 +207,15 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
ckanGroupsPanel.setGroups(null);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// check if the url encodes a revert operation to be performed
|
||||
if(paramsMap.containsKey(GCubeCkanDataCatalog.REVERT_QUERY_PARAM) &&
|
||||
if(paramsMap.containsKey(GCubeCkanDataCatalog.REVERT_QUERY_PARAM) &&
|
||||
paramsMap.get(GCubeCkanDataCatalog.REVERT_QUERY_PARAM).equals("true")){
|
||||
|
||||
|
||||
eventBus.fireEvent(new ShowRevertOperationWidgetEvent(Window.Location.getHref()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Just check if it is enabled.. then we need to listen for dom events coming
|
||||
*/
|
||||
|
@ -410,11 +410,23 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
JSONObject object = parsedJSON.isObject();
|
||||
GWT.log("Object is " + object);
|
||||
if(object != null){
|
||||
height = object.get("height").isString().stringValue();
|
||||
if(object.containsKey("product"))
|
||||
productId = object.get("product").isString().stringValue();
|
||||
else
|
||||
isProductKeyMissing = true;
|
||||
//Supporting Task #12286: parsing the translate values for 'dataset', 'organization' and so on
|
||||
if(object.containsKey("translate")){
|
||||
JSONObject theTranslate = (JSONObject) object.get("translate");
|
||||
for (String key : theTranslate.keySet()) {
|
||||
String value = object.get(key).isString().stringValue();
|
||||
GWT.log("Customizing key " + key +" with translate: "+value);
|
||||
managementPanel.customizeLabelAccordingTranslate(key,value);
|
||||
}
|
||||
|
||||
}else if(object.containsKey("height")){
|
||||
|
||||
height = object.get("height").isString().stringValue();
|
||||
if(object.containsKey("product"))
|
||||
productId = object.get("product").isString().stringValue();
|
||||
else
|
||||
isProductKeyMissing = true;
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
GWT.log("Exception is " + e);
|
||||
|
@ -524,15 +536,15 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
ckanOrganizationsPanel.setVisible(false);
|
||||
ckanFramePanel.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show management panel
|
||||
* @param show
|
||||
*/
|
||||
public void showManagementPanel(boolean show){
|
||||
|
||||
|
||||
managementPanel.showManageProductButton(show);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -541,5 +553,5 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
public boolean isViewPerVREEnabled() {
|
||||
return viewPerVREPath != null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue