Beispiel #1
0
        ///
        ///	 <summary> * get a specific layout element by name, creates it if it does not exist
        ///	 *  </summary>
        ///	 * <param name="layout"> </param>
        ///	 * <param name="elementName"> </param>
        ///	 * <param name="partitionKeyName"> </param>
        ///	 * <param name="objectName">  </param>
        ///	 * <returns> JDFLayout: the element </returns>
        ///	 * <exception cref="JDFException"> if the location of a newly created element is not well defined  </exception>
        ///
        protected internal static JDFLayout getCreateLayoutElement(JDFResource layout, string elementName, string partitionKeyName, string objectName)
        {
            JDFLayout s = getLayoutElement(layout, elementName, partitionKeyName, objectName);

            if (s != null)
            {
                return(s);
            }
            if (JDFLayout.isNewLayout(layout))
            {
                s = (JDFLayout)layout.addPartition(EnumPartIDKey.getEnum(partitionKeyName), objectName);
            }
            else
            {
                s = (JDFLayout)layout.appendElement(elementName);
                s.setName(objectName);
            }
            return(s);
        }