public List<Asset> getJavaScriptLibraries() {
    String jQueryUIPath = symbolSource.valueForSymbol(JQuerySymbolConstants.JQUERY_UI_PATH);
    if (!jQueryUIPath.endsWith("/")) {

      jQueryUIPath += "/";
    }

    final List<Asset> javaScriptStack = new ArrayList<Asset>();

    javaScriptStack.add(
        assetSource.getClasspathAsset(
            String.format(
                "%s%s/jquery.ui.datepicker%s.js",
                jQueryUIPath,
                (!productionMode ? "/minified" : ""),
                (!productionMode ? ".min" : ""))));

    final Asset datePickerI18nAsset = getLocaleAsset(threadLocale.getLocale(), jQueryUIPath);

    if (datePickerI18nAsset != null) {
      javaScriptStack.add(datePickerI18nAsset);
    }

    javaScriptStack.add(
        assetSource.getExpandedAsset("${assets.path}/components/datefield/datefield.js"));

    return javaScriptStack;
  }
Esempio n. 2
0
  public Resource getResourceFormStylesheetLink(StylesheetLink link) {

    String[] path = link.getURL().split("/");

    StringBuilder sb = new StringBuilder();

    Boolean flag = false;

    for (int i = 0; i < path.length; i++) {

      if (path[i].equalsIgnoreCase("css")) flag = true;

      if (flag) {
        sb.append("/");

        sb.append(path[i]);
      }
    }

    String ctxPath = "context:" + sb.toString().substring(1);

    Asset a = assetSource.getExpandedAsset(ctxPath);

    return a.getResource();
  }
        public Asset map(String path) {
          Asset asset = assetSource.getExpandedAsset(path);

          return asset;
        }