Package org.jibeframework.alfresco.node

Examples of org.jibeframework.alfresco.node.CMContent


      }
    });
    argumentsResolver.registerRequestParamResolver("contentId", new RequestParamArgumentResolver() {
      public void addToArgumentsCache(ArgumentCandidatesCache cache, Object paramValue) {
        if (paramValue != null) {
          CMContent content = repositoryService.fetch(CMContent.class, new NodeRef((String) paramValue));
          cache.add(CMContent.class, content);
        }
      }
    });
    argumentsResolver.registerRequestParamResolver("nodeId", new RequestParamArgumentResolver() {
View Full Code Here


  @SuppressWarnings("unchecked")
  @Remote
  public void openDocument(@RequestParam("version") String version, @RequestParam("nodeId") NodeRef nodeRef,
      @RequestParam("forceDownload") boolean forceDownload, Context context) {
    CMContent node = repositoryService.fetch(CMContent.class, nodeRef);
    if (!StringUtils.equals(version, "current")) {
      node = node.getVersion(version);
    }
    if (forceDownload) {
      // response.put("url", node.getDownloadUrl());
      // response.put("name", node.getName());
    } else {
      String name = node.getName();
      String mimeType = serviceRegistry.getMimetypeService().guessMimetype(name);
      HierarchicalConfiguration configuration = configService.getConfig(ConfigurationConfig.class)
          .getConfiguration();
      List<String> inlineMimeTypes = configuration.getList("inline-openable/type");
      boolean inline = inlineMimeTypes.contains(mimeType);
      String url = inline ? node.getContentUrl() : node.getDownloadUrl();
      // response.put("inline", inline);
      // response.put("url", url);
      // response.put("name", name);
    }
  }
View Full Code Here

TOP

Related Classes of org.jibeframework.alfresco.node.CMContent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.