package com.perforce.spark.configuration; import java.util.ArrayList; import java.util.List; import java.util.Map; import spark.ModelAndView; import spark.Request; import spark.Response; import com.perforce.p4java.exception.P4JavaException; import com.perforce.p4java.server.IOptionsServer; import com.perforce.spark.artifact.ArtifactType; import com.perforce.spark.common.AbstractControl; import com.perforce.spark.connection.ConnectionSession; import com.perforce.spark.depot.DepotFactory; import com.perforce.spark.navigation.ListItem; import com.perforce.spark.navigation.NavBar; import com.perforce.spark.site.SiteType; public class ConfigControl extends AbstractControl { public static ModelAndView listDepots(Request request, Response response) { Map<String, Object> model; model = NavBar.attributes("config", request); // create list of depot types List<ListItem> types = new ArrayList<>(); for (ArtifactType a : ArtifactType.list()) { String title = a.getTitle(); String path = "/create/depot/" + a.getId(); types.add(new ListItem(title, path)); } model.put("types", types); try { IOptionsServer p4 = ConnectionSession.get(request, response); model.put("stores", DepotFactory.listBySite(p4, SiteType.STORE)); model.put("proxies", DepotFactory.listBySite(p4, SiteType.PROXY)); model.put("groups", DepotFactory.listBySite(p4, SiteType.GROUP)); } catch (P4JavaException e) { return error(e); } return new ModelAndView(model, "/configuration/page-config.html"); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#8 | 15012 | Paul Allen | Proxy configuration. | ||
#7 | 14884 | Paul Allen | Moved create depot type into path and not a param. | ||
#6 | 14866 | Paul Allen |
Create different Depot types. - Display site types |
||
#5 | 14864 | Paul Allen | Depot Configuration and Site type | ||
#4 | 14863 | Paul Allen | Change File/Dir browse to support extended options | ||
#3 | 14725 | Paul Allen | Generic deploy/upload | ||
#2 | 14228 | Paul Allen |
Moved View over to the new model. Retactor connection to package. |
||
#1 | 14181 | Paul Allen | Lots of updates and refactoring. |