当前位置: 首页>>代码示例>>Java>>正文


Java RepositoryService.getDeploymentResourceNames方法代码示例

本文整理汇总了Java中org.activiti.engine.RepositoryService.getDeploymentResourceNames方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryService.getDeploymentResourceNames方法的具体用法?Java RepositoryService.getDeploymentResourceNames怎么用?Java RepositoryService.getDeploymentResourceNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.RepositoryService的用法示例。


在下文中一共展示了RepositoryService.getDeploymentResourceNames方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDeploymentResources

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
@GET
@Path("/{deploymentId}/resources")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getDeploymentResources(@PathParam("deploymentId") String deploymentId) {

    RepositoryService repositoryService = BPMNOSGIService.getRepositoryService();
    // Check if deployment exists
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    if (deployment == null) {
        throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
    }

    List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);
    DeploymentResourceResponseCollection deploymentResourceResponseCollection = new RestResponseFactory().createDeploymentResourceResponseList(deploymentId, resourceList, uriInfo.getBaseUri().toString());

    return Response.ok().entity(deploymentResourceResponseCollection).build();
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:18,代码来源:DeploymentService.java

示例2: listDeploymentResourceNames

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
/**
 * 显示每个部署包里的资源.
 */
@RequestMapping("console-listDeploymentResourceNames")
public String listDeploymentResourceNames(
        @RequestParam("deploymentId") String deploymentId, Model model) {
    RepositoryService repositoryService = processEngine
            .getRepositoryService();
    List<String> deploymentResourceNames = repositoryService
            .getDeploymentResourceNames(deploymentId);
    model.addAttribute("deploymentResourceNames", deploymentResourceNames);

    return "bpm/console-listDeploymentResourceNames";
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:15,代码来源:ConsoleController.java

示例3: queryFlowImage

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
@Test
public void queryFlowImage() throws Exception {
	
	String deploymentId = "10001";
	RepositoryService repositoryService = (RepositoryService) AppContext.getBean("repositoryService");
	List<String> names = repositoryService.getDeploymentResourceNames(deploymentId);
	for (String name : names) {
		System.out.println( name );
		if (name.endsWith(".png") || name.endsWith(".bmp")) {
			InputStream is = repositoryService.getResourceAsStream(deploymentId, name);
			FileUtils.copyInputStreamToFile(is, new File("/tmp/" + name));
		}
	}
	
}
 
开发者ID:billchen198318,项目名称:bamboobsc,代码行数:16,代码来源:TestBPMN001.java

示例4: getDeploymentResourceData

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
private byte[] getDeploymentResourceData(String deploymentId, String resourceId, RepositoryService
        repositoryService) {

    if (deploymentId == null) {
        throw new ActivitiIllegalArgumentException("No deployment id provided");
    }
    if (resourceId == null) {
        throw new ActivitiIllegalArgumentException("No resource id provided");
    }

    // Check if deployment exists
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    if (deployment == null) {
        throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
    }

    List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);

    if (resourceList.contains(resourceId)) {
        final InputStream resourceStream = repositoryService.getResourceAsStream(deploymentId, resourceId);

        try {
            return IOUtils.toByteArray(resourceStream);
        } catch (Exception e) {
            throw new ActivitiException("Error converting resource stream", e);
        }
    } else {
        // Resource not found in deployment
        throw new ActivitiObjectNotFoundException("Could not find a resource with id '" + resourceId + "' in deployment '" + deploymentId + "'.", String.class);
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:32,代码来源:ProcessDefinitionService.java

示例5: getDeploymentResourceForDifferentUrl

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
@GET
@Path("/{deploymentId}/resources/{resourcePath:.*}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getDeploymentResourceForDifferentUrl(@PathParam("deploymentId") String deploymentId, @PathParam("resourcePath") String resourcePath) {

    if (log.isDebugEnabled()) {
        log.debug("deploymentId:" + deploymentId + " resourcePath:" + resourcePath);
    }
    RepositoryService repositoryService = BPMNOSGIService.getRepositoryService();
    // Check if deployment exists
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    if (deployment == null) {
        throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
    }

    List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);

    if (resourceList.contains(resourcePath)) {
        // Build resource representation
        DeploymentResourceResponse deploymentResourceResponse = new RestResponseFactory()
                .createDeploymentResourceResponse(deploymentId, resourcePath,
                        Utils.resolveContentType(resourcePath), uriInfo.getBaseUri().toString());
        return Response.ok().entity(deploymentResourceResponse).build();

    } else {
        // Resource not found in deployment
        throw new ActivitiObjectNotFoundException("Could not find a resource with id '" + resourcePath
                + "' in deployment '" + deploymentId + "'.", Deployment.class);
    }

}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:32,代码来源:DeploymentService.java

示例6: getDeploymentResourceData

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
private byte[] getDeploymentResourceData(String deploymentId, String resourceId) {

        if (deploymentId == null) {
            throw new ActivitiIllegalArgumentException("No deployment id provided");
        }
        if (resourceId == null) {
            throw new ActivitiIllegalArgumentException("No resource id provided");
        }

        RepositoryService repositoryService = BPMNOSGIService.getRepositoryService();
        // Check if deployment exists
        Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
        if (deployment == null) {
            throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
        }

        List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);

        if (resourceList.contains(resourceId)) {
            final InputStream resourceStream = repositoryService.getResourceAsStream(deploymentId, resourceId);
            try {
                return IOUtils.toByteArray(resourceStream);
            } catch (Exception e) {
                throw new ActivitiException("Error converting resource stream", e);
            }
        } else {
            // Resource not found in deployment
            throw new ActivitiObjectNotFoundException("Could not find a resource with id '" + resourceId + "' in deployment '" + deploymentId + "'.", String.class);
        }
    }
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:31,代码来源:DeploymentService.java


注:本文中的org.activiti.engine.RepositoryService.getDeploymentResourceNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。