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);
|
||||
}
|
||||
|
||||
|
|
|
@ -361,4 +361,29 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -410,12 +410,24 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
JSONObject object = parsedJSON.isObject();
|
||||
GWT.log("Object is " + object);
|
||||
if(object != null){
|
||||
//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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue