Search in sources :

Example 1 with AppBuilder

use of com.axelor.studio.db.AppBuilder in project axelor-open-suite by axelor.

the class ImportService method importAppBuilderImg.

public Object importAppBuilderImg(Object bean, Map<String, Object> values) {
    assert bean instanceof AppBuilder;
    AppBuilder appBuilder = (AppBuilder) bean;
    String fileName = (String) values.get("fileName");
    String imageData = (String) values.get("imageData");
    if (fileName != null && imageData != null) {
        appBuilder.setImage(importImg(fileName, imageData));
    }
    appBuilder = appBuilderRepo.save(appBuilder);
    return appBuilder;
}
Also used : AppBuilder(com.axelor.studio.db.AppBuilder)

Example 2 with AppBuilder

use of com.axelor.studio.db.AppBuilder in project axelor-open-suite by axelor.

the class AppBuilderController method installApp.

public void installApp(ActionRequest request, ActionResponse response) throws AxelorException, IOException {
    AppBuilder appBuilder = request.getContext().asType(AppBuilder.class);
    appBuilder = Beans.get(AppBuilderRepository.class).find(appBuilder.getId());
    App app = appBuilder.getGeneratedApp();
    Beans.get(AppService.class).installApp(app, null);
    response.setSignal("refresh-app", true);
}
Also used : App(com.axelor.apps.base.db.App) AppService(com.axelor.apps.base.service.app.AppService) AppBuilder(com.axelor.studio.db.AppBuilder)

Example 3 with AppBuilder

use of com.axelor.studio.db.AppBuilder in project axelor-open-suite by axelor.

the class AppBuilderController method uninstallApp.

public void uninstallApp(ActionRequest request, ActionResponse response) throws AxelorException {
    AppBuilder appBuilder = request.getContext().asType(AppBuilder.class);
    appBuilder = Beans.get(AppBuilderRepository.class).find(appBuilder.getId());
    App app = appBuilder.getGeneratedApp();
    Beans.get(AppService.class).unInstallApp(app);
    response.setSignal("refresh-app", true);
}
Also used : App(com.axelor.apps.base.db.App) AppService(com.axelor.apps.base.service.app.AppService) AppBuilder(com.axelor.studio.db.AppBuilder)

Example 4 with AppBuilder

use of com.axelor.studio.db.AppBuilder in project axelor-open-suite by axelor.

the class ImportService method importAppBuilder.

public Object importAppBuilder(Object bean, Map<String, Object> values) {
    assert bean instanceof AppBuilder;
    AppBuilder appBuilder = (AppBuilder) bean;
    appBuilder = appBuilderRepo.save(appBuilder);
    Long appLoaderId = (Long) values.get("appLoaderId");
    if (appLoaderId != null) {
        appLoaderRepository.find(appLoaderId).addImportedAppBuilderSetItem(appBuilder);
    }
    return appBuilder;
}
Also used : AppBuilder(com.axelor.studio.db.AppBuilder)

Example 5 with AppBuilder

use of com.axelor.studio.db.AppBuilder in project axelor-open-suite by axelor.

the class MetaJsonFieldRepo method save.

@Override
public MetaJsonField save(MetaJsonField metaJsonField) {
    AppBuilder appBuilder = metaJsonField.getAppBuilder();
    if (appBuilder != null) {
        metaJsonField.setIncludeIf("__config__.app.isApp('" + appBuilder.getCode() + "')");
    }
    Beans.get(JsonFieldService.class).updateSelection(metaJsonField);
    return super.save(metaJsonField);
}
Also used : AppBuilder(com.axelor.studio.db.AppBuilder) JsonFieldService(com.axelor.studio.service.JsonFieldService)

Aggregations

AppBuilder (com.axelor.studio.db.AppBuilder)5 App (com.axelor.apps.base.db.App)2 AppService (com.axelor.apps.base.service.app.AppService)2 JsonFieldService (com.axelor.studio.service.JsonFieldService)1