Search in sources :

Example 6 with Authenticated

use of com.haulmont.cuba.security.app.Authenticated in project cuba by cuba-platform.

the class ScriptingManager method runGroovyScript.

@Authenticated
@Override
public String runGroovyScript(String scriptName) {
    try {
        Binding binding = new Binding();
        binding.setVariable("persistence", persistence);
        binding.setVariable("metadata", metadata);
        binding.setVariable("configuration", configuration);
        binding.setVariable("dataManager", dataManager);
        Object result = scripting.runGroovyScript(scriptName, binding);
        return String.valueOf(result);
    } catch (Exception e) {
        log.error("Error runGroovyScript", e);
        return ExceptionUtils.getStackTrace(e);
    }
}
Also used : Binding(groovy.lang.Binding) Authenticated(com.haulmont.cuba.security.app.Authenticated)

Aggregations

Authenticated (com.haulmont.cuba.security.app.Authenticated)6 EntityStatistics (com.haulmont.cuba.core.entity.EntityStatistics)2 QueryParser (com.haulmont.cuba.core.global.QueryParser)2 DbInitializationException (com.haulmont.cuba.core.sys.DbInitializationException)2 List (java.util.List)2 StrBuilder (org.apache.commons.lang.text.StrBuilder)2 MetaClass (com.haulmont.chile.core.model.MetaClass)1 com.haulmont.cuba.core (com.haulmont.cuba.core)1 EntityManager (com.haulmont.cuba.core.EntityManager)1 Query (com.haulmont.cuba.core.Query)1 Transaction (com.haulmont.cuba.core.Transaction)1 PersistenceConfig (com.haulmont.cuba.core.app.PersistenceConfig)1 PersistenceManagerAPI (com.haulmont.cuba.core.app.PersistenceManagerAPI)1 ServerConfig (com.haulmont.cuba.core.app.ServerConfig)1 Configuration (com.haulmont.cuba.core.global.Configuration)1 EmailAttachment (com.haulmont.cuba.core.global.EmailAttachment)1 Metadata (com.haulmont.cuba.core.global.Metadata)1 QueryTransformerFactory (com.haulmont.cuba.core.global.QueryTransformerFactory)1 DbUpdater (com.haulmont.cuba.core.sys.DbUpdater)1 DbmsType (com.haulmont.cuba.core.sys.persistence.DbmsType)1