Search in sources :

Example 1 with KaleoCore

use of com.liferay.ide.kaleo.core.KaleoCore in project liferay-ide by liferay.

the class WorkflowValidationProxy method getGroovyFile.

protected File getGroovyFile() throws Exception {
    Object loadAdapter = _runtime.loadAdapter(ILiferayRuntime.class, null);
    ILiferayRuntime liferayRuntime = (ILiferayRuntime) loadAdapter;
    KaleoCore kaleoCore = KaleoCore.getDefault();
    if (liferayRuntime != null) {
        Version version = new Version(liferayRuntime.getPortalVersion());
        Bundle bundle = kaleoCore.getBundle();
        URL bundleURL = FileLocator.toFileURL(bundle.getEntry(_getGroovyWorkflowValidationScript(version)));
        return new File(bundleURL.getFile());
    }
    IStatus error = KaleoCore.createErrorStatus("Unable to locate groovy script");
    ILog log = kaleoCore.getLog();
    log.log(error);
    throw new CoreException(error);
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) CoreException(org.eclipse.core.runtime.CoreException) Version(org.osgi.framework.Version) Bundle(org.osgi.framework.Bundle) ILiferayRuntime(com.liferay.ide.server.core.ILiferayRuntime) ILog(org.eclipse.core.runtime.ILog) KaleoCore(com.liferay.ide.kaleo.core.KaleoCore) File(java.io.File) URL(java.net.URL)

Aggregations

KaleoCore (com.liferay.ide.kaleo.core.KaleoCore)1 ILiferayRuntime (com.liferay.ide.server.core.ILiferayRuntime)1 File (java.io.File)1 URL (java.net.URL)1 CoreException (org.eclipse.core.runtime.CoreException)1 ILog (org.eclipse.core.runtime.ILog)1 IStatus (org.eclipse.core.runtime.IStatus)1 Bundle (org.osgi.framework.Bundle)1 Version (org.osgi.framework.Version)1