Exemple #1
0
 /**
  * Get UIComponent to process render a node which has specified mimeType
  *
  * @param mimeType
  * @param container
  * @return
  * @throws Exception
  */
 public static UIComponent getUIComponent(String mimeType, UIContainer container)
     throws Exception {
   UIExtensionManager manager = WCMCoreUtils.getService(UIExtensionManager.class);
   List<UIExtension> extensions = manager.getUIExtensions(FILE_VIEWER_EXTENSION_TYPE);
   Map<String, Object> context = new HashMap<String, Object>();
   context.put(MIME_TYPE, mimeType.toLowerCase());
   for (UIExtension extension : extensions) {
     UIComponent uiComponent = manager.addUIExtension(extension, context, container);
     if (uiComponent != null) return uiComponent;
   }
   return null;
 }
  public UIComponent getUIComponent(String mimeType) throws Exception {
    if (mimeType != null && !mimeType.startsWith("text") && !mimeType.startsWith("application")) {
      UIExtensionManager manager = getApplicationComponent(UIExtensionManager.class);
      List<UIExtension> extensions =
          manager.getUIExtensions(org.exoplatform.ecm.webui.utils.Utils.FILE_VIEWER_EXTENSION_TYPE);
      Map<String, Object> context = new HashMap<String, Object>();
      context.put(org.exoplatform.ecm.webui.utils.Utils.MIME_TYPE, mimeType);
      for (UIExtension extension : extensions) {
        UIComponent uiComponent = manager.addUIExtension(extension, context, this);
        if (uiComponent != null) return uiComponent;
      }
    }

    return null;
  }
 private List<UIExtension> getUIExtensionList() {
   UIExtensionManager manager = getApplicationComponent(UIExtensionManager.class);
   return manager.getUIExtensions(EXTENSION_TYPE);
 }