javaopendolphindolphin-platform

Calling Dolphin Platform Action with params returns error


Update: OK so the errors i saw came from another problem i now solved but the action is still not being called. Updated error logs

I am starting to create an app with the Dolphin Platform (V 0.6.1) and I need to call a server side action ("clicked"), which works fine, but as soon as I want to pass Params... I get the

CONTROLLER_ACTION_CALL_ERROR_BEAN error

What am i doing wrong? In the ControllerProxy documentation, it says the params must match names and count, which they do... I also tried passing only the MenuItemEntry, same error...

Controller

@DolphinController("MasterController")
public class MasterController {

@DolphinModel
    private MasterModel model;

    @Autowired
    private MitgliederRepository mitglieder;


   //This fills the listview in the MasterView
    @PostConstruct
    public void init() {
        for (Mitglieder next : mitglieder.findAll()) {
            add(next.getVorname());
        }
    }
    @Inject
    private BeanManager beanManager;

    @Inject
    private TaskExecutor taskExecutor;

    //creates Bean Items
    public void add(String item) {
        taskExecutor.execute(MasterController.class, c -> c.onAdded(item));
    }

    private void onAdded(String text) {
        final MenuItemEntry toDoItem = beanManager.create(MenuItemEntry.class);
        toDoItem.setText(text);
        model.getMenuItems().add(toDoItem);
    }

 @DolphinAction("clicked")
    public void clicked(@Param("name") String item, @Param("row") int row) {
        model.getMenuItems().get(row).setText(item);
    }

}

ViewBinder

public class MasterViewBinder extends AbstractViewBinder<MasterModel> {

....


@FXML
    private SplitPane splitPaneMaster;

    @FXML
    private StackPane stackPaneContent;

    @FXML
    private ListView<MenuItemEntry> listViewMenu;


 public void setContent(Pane node) {
        stackPaneContent.getChildren().setAll(node);
    }

public MasterViewBinder(ClientContext clientContext) {
        super(clientContext, "MasterController");
    }


 @Override
    protected void init() {
        ObservableList<MenuItemEntry> list = FXWrapper.wrapList(getModel().getMenuItems());
        getListViewMenu().setItems(list);
         listViewMenu.setOnMouseClicked((MouseEvent event) -> {
        ListView<MenuItemEntry> o = (ListView<MenuItemEntry>) event.getSource();
        MenuItemEntry item = o.getSelectionModel().getSelectedItem();
        int row = o.getSelectionModel().getSelectedIndex();
        invoke("clicked",new Param("name", item.getText()), new Param("row", row));
    });

    }

}

Model

@DolphinBean
public class MenuItemEntry {

    private Property<String> text;

    public String getText() {
        return text.get();
    }
    public void setText(String text) {
        this.text.set(text);
    }
    public Property<String> getTextProperty() {
        return text;
    }

    @Override
    public String toString() {
        return text.get();
    }
}
@DolphinBean
public class MasterModel {

    private ObservableList<MenuItemEntry> menuItems;

    public ObservableList<MenuItemEntry> getMenuItems() {
        return menuItems;
    }
   ....
}

Application

public class Zapp extends Application {

private static ClientContext clientContext;

@Override
public void init() throws Exception {
    ClientConfiguration config = new JavaFXConfiguration("http://localhost:8080/todo-app/dolphin");
    clientContext = ClientContextFactory.connect(config).get();
}

@Override
public void start(Stage primaryStage) throws Exception {
    URL url = Zapp.class.getResource("/sn/zapp/resources/views/Master.fxml"); 
    FXMLLoader loader = new FXMLLoader(url);
    MasterViewBinder viewController = new MasterViewBinder(clientContext);
    loader.setController(viewController);
    ContentNavigation.setMainController(viewController);
    SplitPane splitPaneMaster = (SplitPane)loader.load();
    viewController.setSplitPane(splitPaneMaster);
    Scene scene = new Scene(splitPaneMaster);
    primaryStage.setScene(scene);
    primaryStage.show();
}
public static ClientContext getClientContext() {
    return clientContext;
}

public static void main(String... args) {
    launch(args);
}
}

serverlog

     2015-11-28 17:41:21.557  INFO 4116 --- [nio-8080-exec-2] o.o.core.server.ServerConnector          : S:     received Command: dolphin_platform_intern_release
2015-11-28 17:41:21.562  INFO 4116 --- [nio-8080-exec-3] o.o.core.server.ServerConnector          : S:     received Command: CreatePresentationModel pmId 667ab952-5617-487c-8a82-ddbcc8ed81c3 pmType @@@ CONTROLLER_ACTION_CALL_PARAM_BEAN @@@  attributes [[baseValue:client, id:112C, propertyName:@@@ SOURCE_SYSTEM @@@, qualifier:null, tag:VALUE, value:client], [baseValue:null, id:113C, propertyName:valueType, qualifier:null, tag:VALUE, value:null], [baseValue:null, id:114C, propertyName:actionId, qualifier:null, tag:VALUE, value:null], [baseValue:null, id:115C, propertyName:value, qualifier:null, tag:VALUE, value:null]]
2015-11-28 17:41:21.565  INFO 4116 --- [nio-8080-exec-5] o.o.core.server.ServerConnector          : S:     received Command: ValueChanged attr:115C, null -> a1ef29a1-b543-4b94-963d-909772b31c54
2015-11-28 17:41:21.568  INFO 4116 --- [nio-8080-exec-7] o.o.core.server.ServerConnector          : S:     received Command: ValueChanged attr:113C, null -> 2
2015-11-28 17:41:21.572  INFO 4116 --- [nio-8080-exec-8] o.o.core.server.ServerConnector          : S:     received Command: ValueChanged attr:114C, null -> c02476a7-ad56-44fc-b65a-5e33e2e205ec
2015-11-28 17:41:21.575  INFO 4116 --- [nio-8080-exec-6] o.o.core.server.ServerConnector          : S:     received Command: ValueChanged attr:233S, 7ce31e6e-2f3d-4ad4-8e6d-458bf1ff9ac5 -> c02476a7-ad56-44fc-b65a-5e33e2e205ec
2015-11-28 17:41:21.579  INFO 4116 --- [nio-8080-exec-9] o.o.core.server.ServerConnector          : S:     received Command: dolphin_platform_intern_callControllerAction

client log

    Nov 28, 2015 5:40:03 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:03 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: CreatePresentationModel pmId @@@ CONTROLLER_ACTION_CALL_PARAM_BEAN @@@ pmType @@@ DOLPHIN_BEAN @@@  attributes [[propertyName:@@@ SOURCE_SYSTEM @@@, id:58C, qualifier:null, value:client, baseValue:client, tag:VALUE], [propertyName:@@@ JAVA_CLASS @@@, id:59C, qualifier:null, value:com.canoo.dolphin.impl.ControllerActionCallParamBean, baseValue:com.canoo.dolphin.impl.ControllerActionCallParamBean, tag:VALUE], [propertyName:value, id:60C, qualifier:null, value:0, baseValue:0, tag:VALUE], [propertyName:valueType, id:61C, qualifier:null, value:0, baseValue:0, tag:VALUE], [propertyName:actionId, id:62C, qualifier:null, value:0, baseValue:0, tag:VALUE]]
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: CreatePresentationModel pmId 879db4e5-8a8d-4835-8492-10088d0537a9 pmType @@@ CONTROLLER_ACTION_CALL_PARAM_BEAN @@@  attributes [[propertyName:@@@ SOURCE_SYSTEM @@@, id:63C, qualifier:null, value:client, baseValue:client, tag:VALUE], [propertyName:valueType, id:64C, qualifier:null, value:null, baseValue:null, tag:VALUE], [propertyName:actionId, id:65C, qualifier:null, value:null, baseValue:null, tag:VALUE], [propertyName:value, id:66C, qualifier:null, value:null, baseValue:null, tag:VALUE]]
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:60C, 0 -> 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:66C, null -> 6c07a93e-1aea-4652-a71f-2ac8f2900543
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:61C, 0 -> 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:64C, null -> 2
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:62C, 0 -> 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:65C, null -> 7ce31e6e-2f3d-4ad4-8e6d-458bf1ff9ac5
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:228S, 0 -> 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:232S, null -> fa9d1424-0b00-4129-8e66-6538b33c1e8b
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:229S, 0 -> 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:234S, null -> clicked
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:230S, 0 -> 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: ValueChanged attr:233S, null -> 7ce31e6e-2f3d-4ad4-8e6d-458bf1ff9ac5
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C: sending batch of size 1
Nov 28, 2015 5:40:04 PM java_util_logging_Logger$info$1 call
INFORMATION: C:           -> Command: dolphin_platform_intern_callControllerAction

Solution

  • This problem was based on a bug in the Dolphin Platform (http://www.dolphin-platform.io). We released version 0.7 yesterday (http://www.guigarage.com/2015/12/dolphin-platform-0-7-has-been-released/) and the bug is fixed in this release. Your shown code should work now ;)