Beispiel #1
0
        /// <summary>
        /// Build a relation to a resource.
        /// </summary>
        /// <param name="relName"> the name of the relation. </param>
        /// <param name="resourceType"> the type of the resource </param>
        /// <returns> the relation </returns>
        public static HalRelation build(string relName, Type resourceType, UriBuilder urlTemplate)
        {
            HalRelation relation = new HalRelation();

            relation.relName      = relName;
            relation.uriTemplate  = urlTemplate;
            relation.resourceType = resourceType;
            return(relation);
        }
Beispiel #2
0
 private HalVariableValue link(HalRelation relation, string resourcePath, string resourceId, string variablesPath)
 {
     if (resourcePath.StartsWith("/", StringComparison.Ordinal))
     {
         // trim leading / because otherwise it will be encode as %2F (see CAM-3091)
         resourcePath = resourcePath.Substring(1);
     }
     this.linker.createLink(relation, resourcePath, resourceId, variablesPath, this.name);
     return(this);
 }
Beispiel #3
0
        /// <summary>
        /// Can be used to embed a relation. Embedded all linked resources in the given relation.
        /// </summary>
        /// <param name="relation"> the relation to embedded </param>
        /// <param name="processEngine"> used to resolve the resources </param>
        /// <returns> the resource itself. </returns>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") public T embed(HalRelation relation, org.camunda.bpm.engine.ProcessEngine processEngine)
        public virtual T embed(HalRelation relation, ProcessEngine processEngine)
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.List<HalResource<?>> resolvedLinks = linker.resolve(relation, processEngine);
            IList <HalResource <object> > resolvedLinks = linker.resolve(relation, processEngine);

            if (resolvedLinks != null && resolvedLinks.Count > 0)
            {
                addEmbedded(relation.relName, resolvedLinks);
            }
            return((T)this);
        }