Search in sources :

Example 16 with App

use of com.axelor.apps.base.db.App in project axelor-open-suite by axelor.

the class AppController method uninstallApp.

public void uninstallApp(ActionRequest request, ActionResponse response) throws AxelorException {
    App app = request.getContext().asType(App.class);
    app = Beans.get(AppRepository.class).find(app.getId());
    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)

Example 17 with App

use of com.axelor.apps.base.db.App in project axelor-open-suite by axelor.

the class AppBuilderService method build.

public AppBuilder build(AppBuilder appBuilder) throws AxelorException {
    checkCode(appBuilder);
    App app = appBuilder.getGeneratedApp();
    if (app == null) {
        app = new App(appBuilder.getName(), appBuilder.getCode());
    } else {
        app.setCode(appBuilder.getCode());
        app.setName(appBuilder.getName());
    }
    app.setIsCustom(true);
    app.setImage(appBuilder.getImage());
    app.setDescription(appBuilder.getDescription());
    Set<App> depends = new HashSet<App>();
    if (appBuilder.getDependsOnSet() != null) {
        depends.addAll(appBuilder.getDependsOnSet());
        app.setDependsOnSet(depends);
    }
    app.setSequence(appBuilder.getSequence());
    app.setModules(appBuilder.getModules());
    appBuilder.setGeneratedApp(appRepo.save(app));
    return appBuilder;
}
Also used : App(com.axelor.apps.base.db.App) HashSet(java.util.HashSet)

Example 18 with App

use of com.axelor.apps.base.db.App 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)

Aggregations

App (com.axelor.apps.base.db.App)18 AppRepository (com.axelor.apps.base.db.repo.AppRepository)7 AppService (com.axelor.apps.base.service.app.AppService)7 AxelorException (com.axelor.exception.AxelorException)3 File (java.io.File)3 ArrayList (java.util.ArrayList)3 AccessConfig (com.axelor.apps.base.db.AccessConfig)2 XMLImporter (com.axelor.data.xml.XMLImporter)2 MetaFile (com.axelor.meta.db.MetaFile)2 AppBuilder (com.axelor.studio.db.AppBuilder)2 FileOutputStream (java.io.FileOutputStream)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 HashSet (java.util.HashSet)2 AppSettings (com.axelor.app.AppSettings)1 IExceptionMessages (com.axelor.apps.base.exceptions.IExceptionMessages)1 FileUtils (com.axelor.common.FileUtils)1 Inflector (com.axelor.common.Inflector)1 Importer (com.axelor.data.Importer)1 CSVBind (com.axelor.data.csv.CSVBind)1