agave-apps/apps-api/src/main/java/org/iplantc/service/apps/resources/impl/SoftwareCollectionImpl.java
/**
     * Serializes the given {@code apps} into a minimal JSON array of 
     * summary software objects.
     * @param apps
     * @return
     * @throws ResourceException
     */
Serializes the given  apps into a minimal JSON array of
summary software objects.
@param apps
@return
@throws ResourceException
Serializes the given apps into a minimal JSON array of summary software objects . @param apps @return @throws ResourceException
public ArrayNode serializeSoftwareCollection(List<Software> apps)
    throws ResourceException
    {
        log.debug("App manager found " + apps.size() + " applications.");
        ObjectMapper mapper = new ObjectMapper();
        ArrayNode jsonApps = mapper.createArrayNode();
        try
        { 	
        	if (hasJsonPathFilters()) {
        		for (Software app: apps) {
        			jsonApps.add(mapper.readTree(app.toJSON()));
        		}
        	} 
        	else {
	            for (Software app: apps) 
	            {   
	                ObjectNode node = mapper.createObjectNode()
	                    .put("id", app.getUniqueName())
	                    .put("name", app.getName())
	                    .put("version", app.getVersion())
	                    .put("revision", app.getRevisionCount())
	                    .put("executionSystem", app.getExecutionSystem().getSystemId())
	                    .put("shortDescription", app.getShortDescription())
	                    .put("isPublic", app.isPubliclyAvailable())
	                    .put("label", app.getLabel())
	                    .put("lastModified", new DateTime(app.getLastUpdated()).toString());
	                    node.putObject("_links")
	                        .putObject("self")
	                            .put("href", TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_APPS_SERVICE) + app.getUniqueName());
	                jsonApps.add(node);
	            }
        	}
            return jsonApps;
        }
        catch (Exception e)
        {
            log.error("Failed to list resources", e);
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL, e.getMessage(), e);
        }
    }
public ArrayNode serializeSoftwareCollection ( List < Software > apps ) throws ResourceException { log . debug ( "App manager found " + apps . size ( ) + " applications." ) ; ObjectMapper mapper = new ObjectMapper ( ) ; ArrayNode jsonApps = mapper . createArrayNode ( ) ; try { if ( hasJsonPathFilters ( ) ) { for ( Software app : apps ) { jsonApps . add ( mapper . readTree ( app . toJSON ( ) ) ) ; } } else { for ( Software app : apps ) { ObjectNode node = mapper . createObjectNode ( ) . put ( "id" , app . getUniqueName ( ) ) . put ( "name" , app . getName ( ) ) . put ( "version" , app . getVersion ( ) ) . put ( "revision" , app . getRevisionCount ( ) ) . put ( "executionSystem" , app . getExecutionSystem ( ) . getSystemId ( ) ) . put ( "shortDescription" , app . getShortDescription ( ) ) . put ( "isPublic" , app . isPubliclyAvailable ( ) ) . put ( "label" , app . getLabel ( ) ) . put ( "lastModified" , new DateTime ( app . getLastUpdated ( ) ) . toString ( ) ) ; node . putObject ( "_links" ) . putObject ( "self" ) . put ( "href" , TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_APPS_SERVICE ) + app . getUniqueName ( ) ) ; jsonApps . add ( node ) ; } } return jsonApps ; } catch ( Exception e ) { log . error ( "Failed to list resources" , e ) ; throw new ResourceException ( Status . SERVER_ERROR_INTERNAL , e . getMessage ( ) , e ) ; } }
Serializes the given {@code apps} into a minimal JSON array of
 summary software objects.
Serializes the given { @code apps } into a minimal JSON array of summary software objects .
// if we have full path filters, we should include the entire Sofware // object so all the fields will be present for filtering. // return summary response