agave-apps/apps-core/src/main/java/org/iplantc/service/apps/model/Software.java
/**
	 * Serializes the software object to json.
	 * @return JSON string representation of an object.
	 * @throws JSONException if unable to serialize a field to json
	 */
Serializes the software object to json.
@return JSON string representation of an object.
@throws JSONException if unable to serialize a field to json
Serializes the software object to json . @return JSON string representation of an object . @throws JSONException if unable to serialize a field to json
public String toJSON() throws JSONException
	{
		JSONWriter writer = new JSONStringer()
		.object()
			.key("id").value(getUniqueName())
			.key("name").value(name)
			.key("icon").value(icon)
			.key("uuid").value(uuid)
			.key("parallelism").value(parallelism)
			.key("defaultProcessorsPerNode").value(defaultProcessorsPerNode)
			.key("defaultMemoryPerNode").value(defaultMemoryPerNode)
			.key("defaultNodeCount").value(defaultNodes)
			.key("defaultMaxRunTime").value(defaultMaxRunTime)
			.key("defaultQueue").value(defaultQueue)
			.key("version").value(version)
			.key("revision").value(revisionCount)
			.key("isPublic").value(isPubliclyAvailable())
			.key("helpURI").value(helpURI)
			.key("label").value(label)
			.key("owner").value(owner)
			.key("shortDescription").value(shortDescription)
			.key("longDescription").value(longDescription)
			.key("tags").array();
				for(String tag: getTagsAsList()) {
					writer.value(tag);
				}
				writer.endArray()
			.key("ontology").array();
				for(String term: getOntologyAsList()) {
					writer.value(term);
				}
				writer.endArray()
			.key("executionType").value(executionType.name())
			.key("executionSystem").value(executionSystem.getSystemId())
			.key("deploymentPath").value(deploymentPath)
			.key("deploymentSystem").value(storageSystem.getSystemId())
			.key("templatePath").value(executablePath)
			.key("testPath").value(testPath)
			.key("checkpointable").value(checkpointable)
			.key("lastModified").value(new DateTime(lastUpdated).toString())
			.key("modules").array();
				for(String module: getModulesAsList()) {
					writer.value(module);
				}
				writer.endArray()
			.key("available").value(isAvailable());
		writer.key("inputs").array();
		for (SoftwareInput input : getOrderedInputs())
		{
			input.printJSON(writer);
		}
		writer.endArray();
		writer.key("parameters").array();
		for (SoftwareParameter param : getOrderedParameters())
		{
			param.printJSON(writer);
		}
		writer.endArray();
		writer.key("outputs").array();
		for (SoftwareOutput output : getOrderedOutputs())
		{
			output.printJSON(writer);
		}
		writer.endArray()
			.key("_links").object()
	        	.key("self").object()
	        		.key("href").value(TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_APPS_SERVICE) + getUniqueName())
		        .endObject()
		        .key("executionSystem").object()
	        		.key("href").value(TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_SYSTEM_SERVICE) + getExecutionSystem().getSystemId())
	        	.endObject()
	        	.key("storageSystem").object()
	        		.key("href").value(TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_SYSTEM_SERVICE) + getStorageSystem().getSystemId())
	        	.endObject()
	        	.key("history").object()
	    			.key("href").value(TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_APPS_SERVICE) + getUniqueName() + "/history")
	    		.endObject()
	        	.key("metadata").object()
	    			.key("href").value(TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_METADATA_SERVICE) + "data/?q=" + URLEncoder.encode("{\"associationIds\":\"" + uuid + "\"}"))
	    		.endObject()
	        	.key("owner").object()
					.key("href").value(TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_PROFILE_SERVICE) + getOwner())
				.endObject()
				.key("permissions").object()
	        		.key("href").value(TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_APPS_SERVICE) + getUniqueName() + "/pems")
		        .endObject()
	        .endObject()
		.endObject();
		return writer.toString();
	}
public String toJSON ( ) throws JSONException { JSONWriter writer = new JSONStringer ( ) . object ( ) . key ( "id" ) . value ( getUniqueName ( ) ) . key ( "name" ) . value ( name ) . key ( "icon" ) . value ( icon ) . key ( "uuid" ) . value ( uuid ) . key ( "parallelism" ) . value ( parallelism ) . key ( "defaultProcessorsPerNode" ) . value ( defaultProcessorsPerNode ) . key ( "defaultMemoryPerNode" ) . value ( defaultMemoryPerNode ) . key ( "defaultNodeCount" ) . value ( defaultNodes ) . key ( "defaultMaxRunTime" ) . value ( defaultMaxRunTime ) . key ( "defaultQueue" ) . value ( defaultQueue ) . key ( "version" ) . value ( version ) . key ( "revision" ) . value ( revisionCount ) . key ( "isPublic" ) . value ( isPubliclyAvailable ( ) ) . key ( "helpURI" ) . value ( helpURI ) . key ( "label" ) . value ( label ) . key ( "owner" ) . value ( owner ) . key ( "shortDescription" ) . value ( shortDescription ) . key ( "longDescription" ) . value ( longDescription ) . key ( "tags" ) . array ( ) ; for ( String tag : getTagsAsList ( ) ) { writer . value ( tag ) ; } writer . endArray ( ) . key ( "ontology" ) . array ( ) ; for ( String term : getOntologyAsList ( ) ) { writer . value ( term ) ; } writer . endArray ( ) . key ( "executionType" ) . value ( executionType . name ( ) ) . key ( "executionSystem" ) . value ( executionSystem . getSystemId ( ) ) . key ( "deploymentPath" ) . value ( deploymentPath ) . key ( "deploymentSystem" ) . value ( storageSystem . getSystemId ( ) ) . key ( "templatePath" ) . value ( executablePath ) . key ( "testPath" ) . value ( testPath ) . key ( "checkpointable" ) . value ( checkpointable ) . key ( "lastModified" ) . value ( new DateTime ( lastUpdated ) . toString ( ) ) . key ( "modules" ) . array ( ) ; for ( String module : getModulesAsList ( ) ) { writer . value ( module ) ; } writer . endArray ( ) . key ( "available" ) . value ( isAvailable ( ) ) ; writer . key ( "inputs" ) . array ( ) ; for ( SoftwareInput input : getOrderedInputs ( ) ) { input . printJSON ( writer ) ; } writer . endArray ( ) ; writer . key ( "parameters" ) . array ( ) ; for ( SoftwareParameter param : getOrderedParameters ( ) ) { param . printJSON ( writer ) ; } writer . endArray ( ) ; writer . key ( "outputs" ) . array ( ) ; for ( SoftwareOutput output : getOrderedOutputs ( ) ) { output . printJSON ( writer ) ; } writer . endArray ( ) . key ( "_links" ) . object ( ) . key ( "self" ) . object ( ) . key ( "href" ) . value ( TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_APPS_SERVICE ) + getUniqueName ( ) ) . endObject ( ) . key ( "executionSystem" ) . object ( ) . key ( "href" ) . value ( TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_SYSTEM_SERVICE ) + getExecutionSystem ( ) . getSystemId ( ) ) . endObject ( ) . key ( "storageSystem" ) . object ( ) . key ( "href" ) . value ( TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_SYSTEM_SERVICE ) + getStorageSystem ( ) . getSystemId ( ) ) . endObject ( ) . key ( "history" ) . object ( ) . key ( "href" ) . value ( TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_APPS_SERVICE ) + getUniqueName ( ) + "/history" ) . endObject ( ) . key ( "metadata" ) . object ( ) . key ( "href" ) . value ( TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_METADATA_SERVICE ) + "data/?q=" + URLEncoder . encode ( "{\"associationIds\":\"" + uuid + "\"}" ) ) . endObject ( ) . key ( "owner" ) . object ( ) . key ( "href" ) . value ( TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_PROFILE_SERVICE ) + getOwner ( ) ) . endObject ( ) . key ( "permissions" ) . object ( ) . key ( "href" ) . value ( TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_APPS_SERVICE ) + getUniqueName ( ) + "/pems" ) . endObject ( ) . endObject ( ) . endObject ( ) ; return writer . toString ( ) ; }
Serializes the software object to json.
Serializes the software object to json .