Added show statistics, show datasets, show organizations buttons
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@129289 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a3f1b12453
commit
d47ec3dfaa
|
@ -4,7 +4,10 @@
|
|||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="workspace-sharing-widget-1.7.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-sharing-widget-TRUNK/workspace-sharing-widget-TRUNK">
|
||||
<dependent-module archiveName="ckan-metadata-publisher-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="ckan-util-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-util-library/ckan-util-library">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="context-root" value="gcube-ckan-datacatalog"/>
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
|
||||
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEventHandler;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.InsertMetadataEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.InsertMetadataEventHandler;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowStatisticsEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowStatisticsEventHandler;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowUserDatasetsEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowUserDatasetsEventHandler;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowUserOrganizationsEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowUserOrganizationsEventHandler;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.CreateDatasetForm;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Modal;
|
||||
|
@ -18,6 +21,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
|||
/**
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @author Costantino Perciante costantino.perciante@isti.cnr.it
|
||||
* Jun 10, 2016
|
||||
*/
|
||||
public class CkanEventHandlerManager {
|
||||
|
@ -33,23 +37,23 @@ public class CkanEventHandlerManager {
|
|||
|
||||
|
||||
private void bind() {
|
||||
|
||||
|
||||
// bind on insert metadata
|
||||
eventBus.addHandler(InsertMetadataEvent.TYPE, new InsertMetadataEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onInsertMetadata(InsertMetadataEvent loadSelecteReleaseEvent) {
|
||||
|
||||
|
||||
final Modal modal = new Modal(true, true);
|
||||
|
||||
|
||||
// request who's doing the insert
|
||||
GCubeCkanDataCatalog.service.getUser(new AsyncCallback<String>() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onSuccess(String username) {
|
||||
|
||||
|
||||
if(username != null){
|
||||
modal.setTitle("Insert Metadata");
|
||||
modal.setTitle("Publish Product");
|
||||
modal.addStyleName("insert-metadata-modal-style");
|
||||
modal.add(new CreateDatasetForm(username));
|
||||
modal.setCloseVisible(true);
|
||||
|
@ -57,30 +61,135 @@ public class CkanEventHandlerManager {
|
|||
}
|
||||
else
|
||||
Window.alert("Please, logout and login again then retry.");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
|
||||
Window.alert("Please, logout and login again then retry.");
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// bind on edit (TODO)
|
||||
eventBus.addHandler(EditMetadataEvent.TYPE, new EditMetadataEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onEditMetadata(EditMetadataEvent editMetadataEvent) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// show datasets event
|
||||
eventBus.addHandler(ShowUserDatasetsEvent.TYPE, new ShowUserDatasetsEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowDatasets(ShowUserDatasetsEvent showUserDatasetsEvent) {
|
||||
|
||||
// get the current path
|
||||
String currentPath = Window.Location.getHref();
|
||||
|
||||
// check if the "path" parameter is already present
|
||||
String currentParameter = Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER);
|
||||
|
||||
// the final path must be
|
||||
String queryPar = "?" + GCubeCkanDataCatalog.GET_PATH_PARAMETER + "=" + "/dashboard/datasets";
|
||||
|
||||
String finalPath;
|
||||
|
||||
if(currentParameter == null){
|
||||
finalPath = currentPath + queryPar;
|
||||
|
||||
}else{
|
||||
|
||||
// remove from the first "path" on
|
||||
int index = currentPath.lastIndexOf("?"+GCubeCkanDataCatalog.GET_PATH_PARAMETER);
|
||||
String firstPartOfThePath = currentPath.substring(0, index);
|
||||
finalPath = firstPartOfThePath + queryPar;
|
||||
|
||||
}
|
||||
|
||||
// redirect
|
||||
Window.Location.assign(finalPath);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
eventBus.addHandler(ShowUserOrganizationsEvent.TYPE, new ShowUserOrganizationsEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowOrganizations(
|
||||
ShowUserOrganizationsEvent showUserDatasetsEvent) {
|
||||
|
||||
// get the current path
|
||||
String currentPath = Window.Location.getHref();
|
||||
|
||||
// check if the "path" parameter is already present
|
||||
String currentParameter = Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER);
|
||||
|
||||
// the final path must be
|
||||
String queryPar = "?" + GCubeCkanDataCatalog.GET_PATH_PARAMETER + "=" + "/dashboard/organizations";
|
||||
|
||||
String finalPath;
|
||||
|
||||
if(currentParameter == null){
|
||||
finalPath = currentPath + queryPar;
|
||||
|
||||
}else{
|
||||
|
||||
// remove from the first "path" on
|
||||
int index = currentPath.lastIndexOf("?"+GCubeCkanDataCatalog.GET_PATH_PARAMETER);
|
||||
String firstPartOfThePath = currentPath.substring(0, index);
|
||||
finalPath = firstPartOfThePath + queryPar;
|
||||
|
||||
}
|
||||
|
||||
// redirect
|
||||
Window.Location.assign(finalPath);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// show statistics event
|
||||
eventBus.addHandler(ShowStatisticsEvent.TYPE, new ShowStatisticsEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowStatistics(ShowStatisticsEvent showStatisticsEvent) {
|
||||
|
||||
// get the current path
|
||||
String currentPath = Window.Location.getHref();
|
||||
|
||||
// check if the "path" parameter is already present
|
||||
String currentParameter = Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER);
|
||||
|
||||
// the final path must be
|
||||
String queryPar = "?" + GCubeCkanDataCatalog.GET_PATH_PARAMETER + "=" + "/stats";
|
||||
|
||||
String finalPath;
|
||||
|
||||
if(currentParameter == null){
|
||||
finalPath = currentPath + queryPar;
|
||||
|
||||
}else{
|
||||
|
||||
// remove from the first "path" on
|
||||
int index = currentPath.lastIndexOf("?"+GCubeCkanDataCatalog.GET_PATH_PARAMETER);
|
||||
String firstPartOfThePath = currentPath.substring(0, index);
|
||||
finalPath = firstPartOfThePath + queryPar;
|
||||
|
||||
}
|
||||
|
||||
// redirect
|
||||
Window.Location.assign(finalPath);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
|
@ -88,7 +197,4 @@ public class CkanEventHandlerManager {
|
|||
public HandlerManager getEventBus() {
|
||||
return eventBus;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
/**
|
||||
* Show catalog statistics event
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public class ShowStatisticsEvent extends GwtEvent<ShowStatisticsEventHandler> {
|
||||
|
||||
public static Type<ShowStatisticsEventHandler> TYPE = new Type<ShowStatisticsEventHandler>();
|
||||
|
||||
/**
|
||||
* Instantiates a new show statistics event.
|
||||
*/
|
||||
public ShowStatisticsEvent() {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||
*/
|
||||
@Override
|
||||
public Type<ShowStatisticsEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
|
||||
*/
|
||||
@Override
|
||||
protected void dispatch(ShowStatisticsEventHandler handler) {
|
||||
handler.onShowStatistics(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
/**
|
||||
* Event handler for show statistics event.
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public interface ShowStatisticsEventHandler extends EventHandler {
|
||||
|
||||
/**
|
||||
* Show statistics
|
||||
* @param showStatisticsEvent
|
||||
*/
|
||||
void onShowStatistics(ShowStatisticsEvent showStatisticsEvent);
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
/**
|
||||
* Raised when the user wants to see his datasets.
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public class ShowUserDatasetsEvent extends GwtEvent<ShowUserDatasetsEventHandler>{
|
||||
|
||||
public static Type<ShowUserDatasetsEventHandler> TYPE = new Type<ShowUserDatasetsEventHandler>();
|
||||
|
||||
/**
|
||||
* Instantiates a new show user datasets event.
|
||||
*/
|
||||
public ShowUserDatasetsEvent() {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||
*/
|
||||
@Override
|
||||
public Type<ShowUserDatasetsEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
|
||||
*/
|
||||
@Override
|
||||
protected void dispatch(ShowUserDatasetsEventHandler handler) {
|
||||
handler.onShowDatasets(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
/**
|
||||
* Event handler for the ShowUserDatasetsEvent
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public interface ShowUserDatasetsEventHandler extends EventHandler {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param showUserDatasetsEvent
|
||||
*/
|
||||
void onShowDatasets(ShowUserDatasetsEvent showUserDatasetsEvent);
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
/**
|
||||
* Raised when the user wants to see his organizations.
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public class ShowUserOrganizationsEvent extends GwtEvent<ShowUserOrganizationsEventHandler>{
|
||||
|
||||
public static Type<ShowUserOrganizationsEventHandler> TYPE = new Type<ShowUserOrganizationsEventHandler>();
|
||||
|
||||
/**
|
||||
* Instantiates a new show user organizations event.
|
||||
*/
|
||||
public ShowUserOrganizationsEvent() {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||
*/
|
||||
@Override
|
||||
public Type<ShowUserOrganizationsEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
|
||||
*/
|
||||
@Override
|
||||
protected void dispatch(ShowUserOrganizationsEventHandler handler) {
|
||||
handler.onShowOrganizations(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
/**
|
||||
* Event handler for the ShowUserOrganizationsEvent
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public interface ShowUserOrganizationsEventHandler extends EventHandler {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param showUserDatasetsEvent
|
||||
*/
|
||||
void onShowOrganizations(ShowUserOrganizationsEvent showUserDatasetsEvent);
|
||||
|
||||
}
|
|
@ -3,12 +3,17 @@
|
|||
*/
|
||||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.view;
|
||||
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.InsertMetadataEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowStatisticsEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowUserDatasetsEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowUserOrganizationsEvent;
|
||||
|
||||
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;
|
||||
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
|
@ -20,13 +25,17 @@ import com.google.gwt.user.client.ui.FlowPanel;
|
|||
* The Class CkanMetadataManagementPanel.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @author Costantino Perciante costantino.perciante@isti.cnr.it
|
||||
* Jun 9, 2016
|
||||
*/
|
||||
public class CkanMetadataManagementPanel extends FlowPanel{
|
||||
|
||||
private AlertBlock nav = new AlertBlock();
|
||||
private Button insertMeta = new Button("Insert Metadata");
|
||||
private Button editMeta = new Button("Edit Metadata");
|
||||
private Button insertMeta = new Button("Publish Product");
|
||||
private Button editMeta = new Button("Edit Product");
|
||||
private Button myDatasets = new Button("My Products");
|
||||
private Button myOrganizations = new Button("My Organizations");
|
||||
private Button statistics = new Button("Statistics");
|
||||
private HandlerManager eventBus;
|
||||
|
||||
/**
|
||||
|
@ -35,11 +44,31 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
*/
|
||||
public CkanMetadataManagementPanel(HandlerManager eventBus){
|
||||
this.eventBus = eventBus;
|
||||
// this.getElement().getStyle().setPaddingTop(H_OFFSET, Unit.PX);
|
||||
// this.getElement().getStyle().setPaddingBottom(H_OFFSET, Unit.PX);
|
||||
// this.getElement().getStyle().setPaddingTop(H_OFFSET, Unit.PX);
|
||||
// this.getElement().getStyle().setPaddingBottom(H_OFFSET, Unit.PX);
|
||||
|
||||
// set link style buttons
|
||||
myDatasets.setType(ButtonType.LINK);
|
||||
myOrganizations.setType(ButtonType.LINK);
|
||||
insertMeta.setType(ButtonType.LINK);
|
||||
editMeta.setType(ButtonType.LINK);
|
||||
editMeta.setVisible(false); // hide for now (it is not supported yet)
|
||||
statistics.setType(ButtonType.LINK);
|
||||
|
||||
// set icons
|
||||
myDatasets.setIcon(IconType.SITEMAP);
|
||||
myOrganizations.setIcon(IconType.BUILDING);
|
||||
insertMeta.setIcon(IconType.FILE);
|
||||
editMeta.setIcon(IconType.EDIT_SIGN);
|
||||
statistics.setIcon(IconType.BAR_CHART);
|
||||
|
||||
// hide edit and insert
|
||||
editMeta.setVisible(false);
|
||||
insertMeta.setVisible(false);
|
||||
|
||||
// add to navigation bar
|
||||
nav.add(myDatasets);
|
||||
nav.add(myOrganizations);
|
||||
nav.add(statistics);
|
||||
nav.add(insertMeta);
|
||||
nav.add(editMeta);
|
||||
nav.setClose(false);
|
||||
|
@ -69,7 +98,37 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
eventBus.fireEvent(new InsertMetadataEvent());
|
||||
eventBus.fireEvent(new EditMetadataEvent());
|
||||
}
|
||||
});
|
||||
|
||||
myDatasets.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
eventBus.fireEvent(new ShowUserDatasetsEvent());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
myOrganizations.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
eventBus.fireEvent(new ShowUserOrganizationsEvent());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
statistics.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
eventBus.fireEvent(new ShowStatisticsEvent());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -83,4 +142,15 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
public int getCurrentHeight(){
|
||||
return this.getOffsetHeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Those buttons can be only visible when the logged user has role editr/admin/sysadmin
|
||||
* @param show
|
||||
*/
|
||||
public void showInsertAndEditProductButtons(boolean show){
|
||||
|
||||
editMeta.setVisible(show);
|
||||
insertMeta.setVisible(show);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,18 +77,20 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate{
|
|||
@Override
|
||||
public void onSuccess(CkanRole result) {
|
||||
|
||||
setTopPanelVisible(true);
|
||||
|
||||
switch (result) {
|
||||
case ADMIN:
|
||||
setTopPanelVisible(true);
|
||||
showEditInsertButtons(true);
|
||||
break;
|
||||
case EDITOR:
|
||||
setTopPanelVisible(true);
|
||||
showEditInsertButtons(true);
|
||||
break;
|
||||
case MEMBER:
|
||||
setTopPanelVisible(false);
|
||||
showEditInsertButtons(false);
|
||||
break;
|
||||
case SYSADMIN:
|
||||
setTopPanelVisible(true);
|
||||
showEditInsertButtons(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -136,6 +138,13 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate{
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* show or hide edit/insert buttons according to the role
|
||||
*/
|
||||
public void showEditInsertButtons(boolean show){
|
||||
managementPanel.showInsertAndEditProductButtons(show);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instance ckan frame.
|
||||
*
|
||||
|
@ -154,8 +163,8 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate{
|
|||
private void initPanel() {
|
||||
setTopPanelVisible(false);
|
||||
addToTop(managementPanel);
|
||||
centerScrollable.add(ckanFramePanel);
|
||||
addToMiddle(centerScrollable);
|
||||
centerScrollable.add(ckanFramePanel);
|
||||
addToMiddle(centerScrollable);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,17 +172,17 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate{
|
|||
*/
|
||||
public void updateSize(){
|
||||
|
||||
RootPanel workspace = rootPanel;
|
||||
int topBorder = workspace.getAbsoluteTop();
|
||||
int leftBorder = workspace.getAbsoluteLeft();
|
||||
int footer = 0; //85 footer is bottombar + sponsor
|
||||
int rightScrollBar = 0;
|
||||
int rootHeight = Window.getClientHeight() - topBorder - 5 - footer;// - ((footer == null)?0:(footer.getOffsetHeight()-15));
|
||||
RootPanel workspace = rootPanel;
|
||||
int topBorder = workspace.getAbsoluteTop();
|
||||
int leftBorder = workspace.getAbsoluteLeft();
|
||||
int footer = 0; //85 footer is bottombar + sponsor
|
||||
int rightScrollBar = 0;
|
||||
int rootHeight = Window.getClientHeight() - topBorder - 5 - footer;// - ((footer == null)?0:(footer.getOffsetHeight()-15));
|
||||
int rootWidth = Window.getClientWidth() - 2* leftBorder - rightScrollBar;
|
||||
GWT.log("New iFrame size w: "+rootWidth + " h: "+rootHeight);
|
||||
this.setSize(rootWidth+"px",rootHeight+"px");
|
||||
int height = rootHeight - getTopPanelHeight();
|
||||
if(ckanFramePanel.getFrame()!=null)
|
||||
ckanFramePanel.getFrame().setSize(rootWidth+"px", height+"px");
|
||||
}
|
||||
GWT.log("New iFrame size w: "+rootWidth + " h: "+rootHeight);
|
||||
this.setSize(rootWidth+"px",rootHeight+"px");
|
||||
int height = rootHeight - getTopPanelHeight();
|
||||
if(ckanFramePanel.getFrame()!=null)
|
||||
ckanFramePanel.getFrame().setSize(rootWidth+"px", height+"px");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,6 +269,8 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
GroupManager groupManager = new LiferayGroupManager();
|
||||
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(groupManager.getGroupId(groupName), userManager.getUserId(username));
|
||||
|
||||
logger.debug("The list of roles for " + username + " into " + groupName + " is " + roles);
|
||||
|
||||
// the default one
|
||||
CkanRolesIntoLiferay mainRole = CkanRolesIntoLiferay.CATALOG_MEMBER;
|
||||
RolesIntoOrganization correspondentRoleToCheck = RolesIntoOrganization.MEMBER;
|
||||
|
|
Loading…
Reference in New Issue