package com.perforce.spark; import java.util.Map; import spark.ModelAndView; import spark.Spark; import spark.template.freemarker.FreeMarkerEngine; import com.perforce.spark.configuration.ConfigControl; import com.perforce.spark.navigation.NavBar; import com.perforce.spark.p4depot.DepotControl; public class Main { public static void main(String[] args) throws Exception { Spark.staticFileLocation("/public"); Spark.before((request, response) -> { ConnectionSession.basicAuth(request, response); if (!ConnectionSession.isValid(request)) { ConnectionSession.cookie(request, response); } }); Spark.get("/", (request, response) -> { Map<String, Object> attributes; attributes = NavBar.attributes("cover", request); String url = request.url(); url += "view/maven/test001/"; attributes.put("hosturl", url); return new ModelAndView(attributes, "page-cover.html"); }, new FreeMarkerEngine()); Spark.post("/login", (request, response) -> { Map<String, Object> attributes; attributes = ConnectionSession.login(request, response); return new ModelAndView(attributes, "page-cover.html"); }, new FreeMarkerEngine()); Spark.get("/logout", (request, response) -> { ConnectionSession.logout(request, response); response.redirect("/"); return null; }); Spark.get("/browse", (request, response) -> { Map<String, Object> attributes; attributes = ConnectionHelper.depots(request, response); return new ModelAndView(attributes, "page-depots.html"); }, new FreeMarkerEngine()); Spark.get("/browse/", (request, response) -> { Map<String, Object> attributes; attributes = ConnectionHelper.depots(request, response); return new ModelAndView(attributes, "page-depots.html"); }, new FreeMarkerEngine()); Spark.get("/browse/*", (request, response) -> { Map<String, Object> attributes; attributes = ConnectionHelper.browse(request, response); return new ModelAndView(attributes, "page-browse.html"); }, new FreeMarkerEngine()); Spark.get("/view/*", (request, response) -> { if (!ConnectionSession.isValid(request)) { String user = ConnectionConfig.getMavenUser(); String ticket = ConnectionConfig.getMavenTicket(); request.session().attribute(ConnectionSession.USER, user); request.session().attribute(ConnectionSession.TICKET, ticket); } return ConnectionHelper.view(request, response); }); Spark.get("/search", (request, response) -> { Map<String, Object> attributes; attributes = NavBar.attributes("search", request); return new ModelAndView(attributes, "page-search.html"); }, new FreeMarkerEngine()); Spark.get("/config", (request, response) -> { return ConfigControl.create(request, response); }, new FreeMarkerEngine()); Spark.get("/config/depot", (request, response) -> { Map<String, Object> attributes; attributes = AssetHelper.depot(request, response); return new ModelAndView(attributes, "page-depot.html"); }, new FreeMarkerEngine()); Spark.post("/config/create", (request, response) -> { return DepotControl.create(request, response); }, new FreeMarkerEngine()); Spark.get("/deploy", (request, response) -> { Map<String, Object> attributes; attributes = AssetHelper.deploy(request, response); return new ModelAndView(attributes, "page-deploy.html"); }, new FreeMarkerEngine()); Spark.post("/deploy/upload", (request, response) -> { Map<String, Object> attributes; attributes = AssetHelper.upload(request, response); return new ModelAndView(attributes, "page-upload.html"); }, new FreeMarkerEngine()); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#30 | 15807 | Paul Allen | Browse (list/grid view) | ||
#29 | 15782 | Paul Allen |
Update to UX - deploy has 3 process steps (including a submit report) |
||
#28 | 15252 | Paul Allen | Added create/edit support for repo configs. | ||
#27 | 15118 | Paul Allen | Added P4Search | ||
#26 | 15012 | Paul Allen | Proxy configuration. | ||
#25 | 14884 | Paul Allen | Moved create depot type into path and not a param. | ||
#24 | 14883 | Paul Allen | Submit via preview and redirect to asset | ||
#23 | 14866 | Paul Allen |
Create different Depot types. - Display site types |
||
#22 | 14864 | Paul Allen | Depot Configuration and Site type | ||
#21 | 14863 | Paul Allen | Change File/Dir browse to support extended options | ||
#20 | 14741 | Paul Allen | Fix upload for multiple files. | ||
#19 | 14726 | Paul Allen | Limit deploy control path, and remove AssetHelper | ||
#18 | 14725 | Paul Allen | Generic deploy/upload | ||
#17 | 14723 | Paul Allen | Tidy up deploy/upload | ||
#16 | 14228 | Paul Allen |
Moved View over to the new model. Retactor connection to package. |
||
#15 | 14226 | Paul Allen | Tidy up Browse elements over to micro MVC model | ||
#14 | 14181 | Paul Allen | Lots of updates and refactoring. | ||
#13 | 14048 | Paul Allen | Convert to Gradle with FatJar and updated splash screen. | ||
#12 | 14017 | Paul Allen | Proxy caching to Perforce and SLF4J logging. | ||
#11 | 14013 | Paul Allen | Basic proxy | ||
#10 | 13969 | Paul Allen | Depot list/create for Assets | ||
#9 | 13869 | Paul Allen |
- Fix logout when testing cookie. - Refactor ftl->html - Add local bootstrap |
||
#8 | 13863 | Paul Allen | Minor fix to session vs cookie for login check. | ||
#7 | 13862 | Paul Allen | Submit uploads to Perforce | ||
#6 | 13798 | Paul Allen | Basic file upload and login/logout cookie tidyup | ||
#5 | 13746 | Paul Allen | Basic File/Dir browsing and Cookie management. | ||
#4 | 13728 | Paul Allen | Error support | ||
#3 | 13727 | Paul Allen | Cover page and local CSS | ||
#2 | 13722 | Paul Allen | Login UX | ||
#1 | 13720 | Paul Allen | Perforce Asset Manager (PAM or P4AM) -- ideas |