@@ -0,0 +1,1821 @@
+package org.eclipse.cmf.occi.core.gen.alloy.services;%0A%0Aimport java.util.Date;%0A%0Aimport org.eclipse.cmf.occi.core.Attribute;%0Aimport org.eclipse.cmf.occi.core.Category;%0Aimport org.eclipse.cmf.occi.core.DataType;%0Aimport org.eclipse.cmf.occi.core.Extension;%0Aimport org.eclipse.cmf.occi.core.Kind;%0A%0Apublic class GenUtils%0A%7B%0A%09/**%0A%09 * Get the current date.%0A%09 * @return the current date.%0A%09 */%0A%09public String getNow() %7B%0A%09%09return new Date().toString();%0A%09%7D%0A%0A%09/**%0A%09 * Get the file path of an extension.%0A%09 * @param extension the given extension.%0A%09 * @return the file path of the given extension.%0A%09 */%0A%09public String getFilePath(Extension extension) %7B%0A%09%09return extension.eResource().getURI().toString();%0A%09%7D%0A%0A%09/**%0A%09 * %0A%09 * @param category%0A%09 * @param context%0A%09 * @return%0A%09 */%0A%09public String getScope(Category category, Category context)%0A%09%7B%0A%09%09StringBuffer sb = new StringBuffer();%0A%09%09if((Extension)category.eContainer() != (Extension)context.eContainer()) %7B%0A%09%09%09sb.append(((Extension)category.eContainer()).getName()).append('/');%0A%09%09%7D%0A%09%09return sb.toString();%0A%09%7D%0A%0A%09/**%0A%09 * %0A%09 * @param kind%0A%09 * @return%0A%09 */%0A%09public String getScope4KindParent(Kind kind)%0A%09%7B%0A%09%09return getScope(kind.getParent(), kind);%0A%09%7D%0A%0A%09/**%0A%09 * %0A%09 * @param attribute%0A%09 * @param suffix%0A%09 * @return%0A%09 */%0A%09public String getSigAttributeType(Attribute attribute, String suffix)%0A%09%7B%0A%09%09StringBuffer sb = new StringBuffer();%0A%09%09DataType type = attribute.getType();%0A%09%09Extension typeExtension = (Extension)type.eContainer();%0A%09%09Extension attributeExtension = (Extension)attribute.eResource().getContents().get(0);%0A%09%09if(typeExtension != attributeExtension) %7B%0A%09%09%09if(! (suffix == null && type.getName().equals(%22String%22))) %7B%0A%09%09%09%09sb.append(typeExtension.getName()).append('/');%0A%09%09%09%7D%0A%09%09%7D%0A%09%09sb.append(type.getName());%0A%09%09if(suffix != null) %7B%0A%09%09%09sb.append(suffix);%0A%09%09%7D%0A%09%09return sb.toString();%0A%09%7D%0A%7D%0A

Add genUtils for the Alloy Generator.