Skip to content

saveSourceModel(final SaveModelAction action) - getFileUri is empty #645

@rsoika

Description

@rsoika

I try to implement a custom SourceModelStorage.

In the loadSourceModel I can get the source file uri with

    @Override
    public void loadSourceModel(final RequestModelAction action) {
        Map<String, String> options = action.getOptions();
        String uri = options.get("uri");
        ........
    }

This is a little bit clumsy but I am fine with this.

When I try to implement the method saveSourceModel I expect that SaveModelAction param provides me with the target file uri

    @Override
    public void saveSourceModel(final SaveModelAction action) {
        Optional<String> uri = action.getFileUri();
        ....
     }

Beside the fact that the method parameter has a different layout as in the load method the getFileUri() call always returns an empty String Optional. I wonder if this is a bug?

My only solution for now is to store the file path during the loadSourceModel method into my custom modelState so that I can reuse it the saveSourceModel

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions