task_21363 #1
|
@ -33,11 +33,11 @@ import com.google.gwt.user.client.ui.ComplexPanel;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class CkanContentModeratorWidget.
|
* The Class CkanContentModeratorWidgetController.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
*
|
*
|
||||||
* Jun 15, 2021
|
* Jun 29, 2021
|
||||||
*/
|
*/
|
||||||
public class CkanContentModeratorWidgetController {
|
public class CkanContentModeratorWidgetController {
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public class CkanContentModeratorWidgetController {
|
||||||
for (T t : items) {
|
for (T t : items) {
|
||||||
CatalogueDataset clickedDataset = (CatalogueDataset) t;
|
CatalogueDataset clickedDataset = (CatalogueDataset) t;
|
||||||
CkanFramePanel cfp = new CkanFramePanel(eventBus);
|
CkanFramePanel cfp = new CkanFramePanel(eventBus);
|
||||||
cfp.instanceFrame(clickedDataset.getUrl(), null);
|
cfp.instanceFrame(clickedDataset.getUrl());
|
||||||
mainTabPanel.addTab(clickedDataset.getTitle(), cfp);
|
mainTabPanel.addTab(clickedDataset.getTitle(), cfp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public class CkanContentModeratorWidgetController {
|
||||||
case INIT:
|
case INIT:
|
||||||
break;
|
break;
|
||||||
case ONLOAD:
|
case ONLOAD:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -159,7 +159,7 @@ public class CkanContentModeratorWidgetController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onValueChanged(SelectItemsWithItemStatusEvent statusSelectedEvent) {
|
public void onValueChanged(SelectItemsWithItemStatusEvent statusSelectedEvent) {
|
||||||
GWT.log("On value changed: "+statusSelectedEvent.getItemStatus());
|
GWT.log("On value changed: " + statusSelectedEvent.getItemStatus());
|
||||||
if (statusSelectedEvent.getItemStatus() != null) {
|
if (statusSelectedEvent.getItemStatus() != null) {
|
||||||
howeView.loadItemsWithStatus(statusSelectedEvent.getItemStatus());
|
howeView.loadItemsWithStatus(statusSelectedEvent.getItemStatus());
|
||||||
mainTabPanel.selectTab(0);
|
mainTabPanel.selectTab(0);
|
||||||
|
|
|
@ -46,21 +46,6 @@ public class CkanFramePanel extends FlowPanel{
|
||||||
addLoading();
|
addLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Post message.
|
|
||||||
*
|
|
||||||
* @param msg the msg (as json)
|
|
||||||
* @param frameName the frame name
|
|
||||||
*/
|
|
||||||
protected native void sendMessage(String msg, String frameName) /*-{
|
|
||||||
console.log("Sending message " + msg);
|
|
||||||
// $wnd.parent.postMessage(msg,'*');
|
|
||||||
//var f = $wnd.frames[frameName];
|
|
||||||
//console.log(f);
|
|
||||||
//f.contentWindow.postMessage(msg, "*");
|
|
||||||
$wnd.frames[frameName].postMessage(msg,"*")
|
|
||||||
console.log("Message sent");
|
|
||||||
}-*/;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the.
|
* Prints the.
|
||||||
|
@ -72,14 +57,14 @@ public class CkanFramePanel extends FlowPanel{
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instance frame.
|
* Instance frame.
|
||||||
*
|
*
|
||||||
* @param datasetURL the dataset URL
|
* @param datasetURL the dataset URL
|
||||||
* @param messageToSend the message to send
|
|
||||||
* @return the frame
|
* @return the frame
|
||||||
*/
|
*/
|
||||||
public Frame instanceFrame(String datasetURL, final String messageToSend) {
|
public Frame instanceFrame(String datasetURL) {
|
||||||
GWT.log("Instancing new IFRAME with uri: "+datasetURL);
|
GWT.log("Instancing new IFRAME with uri: "+datasetURL);
|
||||||
try{
|
try{
|
||||||
if(frame != null)
|
if(frame != null)
|
||||||
|
@ -109,9 +94,6 @@ public class CkanFramePanel extends FlowPanel{
|
||||||
|
|
||||||
CkanFramePanel.this.remove(loading);
|
CkanFramePanel.this.remove(loading);
|
||||||
eventBus.fireEvent(new IFrameInstanciedEvent(frame, OPERATION.ONLOAD));
|
eventBus.fireEvent(new IFrameInstanciedEvent(frame, OPERATION.ONLOAD));
|
||||||
if(messageToSend!=null)
|
|
||||||
sendMessage(messageToSend, iFrameRandomName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
add(frame);
|
add(frame);
|
||||||
|
|
Loading…
Reference in New Issue