예제 #1
0
 private void addAttributes(StringBuilder builder, Map<String, Object> attributes) {
   //
   // This feels a lot like a hack.
   //
   if (attributes != null && !attributes.isEmpty()) {
     builder.append("?aura.attributes=");
     builder.append(AuraTextUtil.urlencode(JsonEncoder.serialize(attributes, false, false)));
   }
 }
예제 #2
0
 @SuppressWarnings("unchecked")
 private Map<String, Object> getConfigMap(HttpServletRequest request) {
   Map<String, Object> configMap = null;
   String config = contextConfig.get(request);
   if (!AuraTextUtil.isNullEmptyOrWhitespace(config)) {
     if (config.startsWith(AuraTextUtil.urlencode("{"))) {
       // Decode encoded context json. Serialized AuraContext json always starts with "{"
       config = AuraTextUtil.urldecode(config);
     }
     configMap = (Map<String, Object>) new JsonReader().read(config);
   }
   return configMap;
 }
예제 #3
0
  /**
   * get the manifest URL.
   *
   * <p>This routine will simply return the string, it does not check to see if the manifest is
   * enabled first.
   *
   * @return a string for the manifest URL.
   */
  public static String getManifestUrl() throws QuickFixException {
    AuraContext context = Aura.getContextService().getCurrentContext();
    String contextPath = context.getContextPath();
    String ret = "";

    boolean serLastMod = context.getSerializeLastMod();
    StringBuilder defs = new StringBuilder(contextPath).append("/l/");
    StringBuilder sb = new StringBuilder();
    context.setSerializeLastMod(false);
    try {
      Aura.getSerializationService().write(context, null, AuraContext.class, sb, "HTML");
    } catch (IOException e) {
      throw new AuraRuntimeException(e);
    }
    context.setSerializeLastMod(serLastMod);
    String contextJson = AuraTextUtil.urlencode(sb.toString());
    defs.append(contextJson);
    defs.append("/app.manifest");
    ret = defs.toString();
    return ret;
  }