How to get asset inside a extension

Hi, im try to prgramm my first Extension, but i need some help, i want the user to be able to select an Asset in the Designer e.g.

@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_ASSET) @SimpleProperty(description = "Language File") public void langFile(String langFile) { this.langFile = langFile; }

Now i want to read that file

 if (MediaUtil.isExternalFile(path) &&
                new PermissionResultHandler() {
                    public void HandlePermissionResponse(String permission, boolean granted) {
                    if (granted) {
                    } else {
                        container.$form().dispatchPermissionDeniedEvent(AutoI18N.this, "Json", permission);
            jsonPath = (path == null) ? "" : path;
            Gson gson = new Gson();
            JsonReader reader;
            try {
                reader = new JsonReader(new FileReader(jsonPath));
                Map trans = gson.fromJson(reader.toString(), Map.class);
                translations = gson.fromJson(trans.get("en").toString(), Map.class);
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block

but nothing happens, what am i doing wrong ?

1 Like

Anyone here that can help me ?
Its the only feature I don’t get to work its frustrating :sob:

you might want to ask in the Open Source Development community