package com.perforce.spark.depot; 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.navigation.NavBar; import com.perforce.spark.repository.RepoFactory; import com.perforce.spark.repository.RepoInterface; import com.perforce.spark.site.GroupSite; public class DepotControl extends AbstractControl { public static ModelAndView getCreateDepot(Request request, Response response) { Map<String, Object> model; model = NavBar.attributes("config", request); ArtifactType type = getType(request); model.put("type", type); model.put("site", getSite(request)); try { IOptionsServer p4 = ConnectionSession.get(request, response); model.put("depots", DepotFactory.listByType(p4, type)); p4.disconnect(); } catch (P4JavaException e) { return error(e); } return new ModelAndView(model, "/configuration/page-create.html"); } public static void postCreateDepot(Request request, Response response) { try { IOptionsServer p4 = ConnectionSession.get(request, response); RepoInterface repo = RepoFactory.create(request); DepotModel depotModel = new DepotModel(repo); depotModel.create(p4); } catch (Exception e) { e.printStackTrace(); } } public static ModelAndView getEditDepot(Request request, Response response) { Map<String, Object> model; model = NavBar.attributes("config", request); String repoID = getRepo(request); try { IOptionsServer p4 = ConnectionSession.get(request, response); DepotModel depot = DepotFactory.getByName(p4, repoID); model.put("depot", depot); RepoInterface repo = depot.getRepo(); ArtifactType type = repo.getArtifactType(); model.put("type", type); model.put("site", repo.getSiteType()); if (repo instanceof GroupSite) { GroupSite group = (GroupSite) repo; model.put("depots", DepotFactory.listByType(p4, type)); model.put("list", group.getList(p4)); } p4.disconnect(); } catch (P4JavaException e) { return error(e); } return new ModelAndView(model, "/configuration/page-create.html"); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 15252 | Paul Allen | Added create/edit support for repo configs. | ||
#4 | 15094 | Paul Allen | Added support for Proxy and Group. | ||
#3 | 15030 | Paul Allen | Post the depot 'id' back and update the form on a click event. | ||
#2 | 15012 | Paul Allen | Proxy configuration. | ||
#1 | 14884 | Paul Allen | Moved create depot type into path and not a param. | ||
//guest/paul_allen/p4am/src/main/java/com/perforce/spark/p4depot/DepotControl.java | |||||
#4 | 14866 | Paul Allen |
Create different Depot types. - Display site types |
||
#3 | 14863 | Paul Allen | Change File/Dir browse to support extended options | ||
#2 | 14228 | Paul Allen |
Moved View over to the new model. Retactor connection to package. |
||
#1 | 14181 | Paul Allen | Lots of updates and refactoring. |