Search in sources :

Example 76 with org.wso2.carbon.humantask.client.api.types

use of org.wso2.carbon.humantask.client.api.types in project carbon-business-process by wso2.

the class HumanTaskDAOConnectionImpl method getDeploymentUnit.

public DeploymentUnitDAO getDeploymentUnit(int tenantId, String md5sum) {
    Query q = entityManager.createQuery("select hu from org.wso2.carbon.humantask.core.dao.jpa.openjpa.model" + ".DeploymentUnit hu WHERE hu.status=?1 and hu.tenantId=?2 and hu.checksum=?3");
    q.setParameter(1, TaskPackageStatus.ACTIVE);
    q.setParameter(2, tenantId);
    q.setParameter(3, md5sum);
    List<DeploymentUnit> resultList = q.getResultList();
    DeploymentUnit deploymentUnit = null;
    if (resultList.size() != 0) {
        deploymentUnit = resultList.get(0);
    }
    return deploymentUnit;
}
Also used : Query(javax.persistence.Query) HumanTaskDeploymentUnit(org.wso2.carbon.humantask.core.deployment.HumanTaskDeploymentUnit)

Example 77 with org.wso2.carbon.humantask.client.api.types

use of org.wso2.carbon.humantask.client.api.types in project ballerina by ballerina-lang.

the class TextDocumentServiceUtil method prepareCompilerContext.

/**
 * Prepare the compiler context.
 *
 * @param packageRepository  Package Repository
 * @param sourceRoot         LSDocument for Source Root
 * @param preserveWhitespace Preserve Whitespace
 * @return {@link CompilerContext}     Compiler context
 */
public static CompilerContext prepareCompilerContext(PackageRepository packageRepository, LSDocument sourceRoot, boolean preserveWhitespace, WorkspaceDocumentManager documentManager, CompilerPhase compilerPhase) {
    org.wso2.ballerinalang.compiler.util.CompilerContext context = new CompilerContext();
    context.put(PackageRepository.class, packageRepository);
    CompilerOptions options = CompilerOptions.getInstance(context);
    options.put(PROJECT_DIR, sourceRoot.getSourceRoot());
    if (null == compilerPhase) {
        throw new AssertionError("Compiler Phase can not be null.");
    }
    options.put(COMPILER_PHASE, compilerPhase.toString());
    options.put(PRESERVE_WHITESPACE, Boolean.valueOf(preserveWhitespace).toString());
    if (isProjectDir(sourceRoot.getSourceRoot(), sourceRoot.getURIString())) {
        context.put(SourceDirectory.class, new LangServerFSProjectDirectory(sourceRoot.getSourceRootPath(), documentManager));
    } else {
        context.put(SourceDirectory.class, new LangServerFSProgramDirectory(sourceRoot.getSourceRootPath(), documentManager));
    }
    return context;
}
Also used : CompilerContext(org.wso2.ballerinalang.compiler.util.CompilerContext) CompilerOptions(org.wso2.ballerinalang.compiler.util.CompilerOptions) LangServerFSProgramDirectory(org.ballerinalang.langserver.workspace.repository.LangServerFSProgramDirectory) CompilerContext(org.wso2.ballerinalang.compiler.util.CompilerContext) LangServerFSProjectDirectory(org.ballerinalang.langserver.workspace.repository.LangServerFSProjectDirectory)

Example 78 with org.wso2.carbon.humantask.client.api.types

use of org.wso2.carbon.humantask.client.api.types in project ballerina by ballerina-lang.

the class LSPackageCache method loadPackagesMap.

private void loadPackagesMap() {
    CompilerContext tempCompilerContext = CommonUtil.prepareTempCompilerContext();
    for (String staticPkgName : staticPkgNames) {
        PackageID packageID = new PackageID(new org.wso2.ballerinalang.compiler.util.Name("ballerina"), new org.wso2.ballerinalang.compiler.util.Name(staticPkgName), new org.wso2.ballerinalang.compiler.util.Name("0.0.0"));
        this.packageMap.put(getPackageName(packageID), LSPackageLoader.getPackageById(tempCompilerContext, packageID));
    }
}
Also used : CompilerContext(org.wso2.ballerinalang.compiler.util.CompilerContext) PackageID(org.ballerinalang.model.elements.PackageID)

Aggregations

APIManagementException (org.wso2.carbon.apimgt.core.exception.APIManagementException)18 APIMgtAdminService (org.wso2.carbon.apimgt.core.api.APIMgtAdminService)13 HashMap (java.util.HashMap)12 Query (javax.persistence.Query)9 ErrorDTO (org.wso2.carbon.apimgt.rest.api.common.dto.ErrorDTO)9 ArrayList (java.util.ArrayList)8 Map (java.util.Map)8 APIMgtDAOException (org.wso2.carbon.apimgt.core.exception.APIMgtDAOException)5 TAttachment (org.wso2.carbon.attachment.mgt.skeleton.types.TAttachment)5 APIPolicy (org.wso2.carbon.apimgt.core.models.policy.APIPolicy)4 AttachmentDAO (org.wso2.carbon.attachment.mgt.core.dao.AttachmentDAO)4 AttachmentMgtException (org.wso2.carbon.attachment.mgt.core.exceptions.AttachmentMgtException)4 AttachmentMgtException (org.wso2.carbon.attachment.mgt.skeleton.AttachmentMgtException)4 Test (org.testng.annotations.Test)3 ConfigurationException (org.wso2.carbon.config.ConfigurationException)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 File (java.io.File)2 PrintStream (java.io.PrintStream)2 Connection (java.sql.Connection)2 List (java.util.List)2