Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjphillips2009-11-12 21:06:25 +0000
committerjphillips2009-11-12 21:06:25 +0000
commit45d1d52db2d3fb5a695a9a793f61b30ee61ff2b8 (patch)
tree23f5a8a2d67717ae512baa16b96785a665d8efff
parent6ec748ad459d04b7cb67a92f3ec54ff7a7d25ed3 (diff)
downloadorg.eclipse.osee-45d1d52db2d3fb5a695a9a793f61b30ee61ff2b8.tar.gz
org.eclipse.osee-45d1d52db2d3fb5a695a9a793f61b30ee61ff2b8.tar.xz
org.eclipse.osee-45d1d52db2d3fb5a695a9a793f61b30ee61ff2b8.zip
-rw-r--r--org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/function/CreateBranchFunction.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/function/CreateBranchFunction.java b/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/function/CreateBranchFunction.java
new file mode 100644
index 00000000000..147a8110252
--- /dev/null
+++ b/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/function/CreateBranchFunction.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright(c) 2009 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.manager.servlet.function;
+
+import java.net.HttpURLConnection;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.osee.framework.manager.servlet.MasterServletActivator;
+import org.eclipse.osee.framework.manager.servlet.data.HttpBranchCreationInfo;
+
+/**
+ * @author Jeff C. Phillips
+ */
+public class CreateBranchFunction {
+
+ public void processRequest(HttpServletRequest req, HttpServletResponse resp)throws Exception {
+ HttpBranchCreationInfo info = new HttpBranchCreationInfo(req);
+ int branchId = -1;
+ branchId =
+ MasterServletActivator.getInstance().getBranchCreation().createBranch(info.getBranch(), info.getAuthorId(),
+ info.getCreationComment(), info.getPopulateBaseTxFromAddressingQueryId(),
+ info.getDestinationBranchId());
+ if (branchId == -1) {
+ resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
+ resp.setContentType("text/plain");
+ resp.getWriter().write("Unknown Error during branch creation.");
+ } else {
+ resp.setStatus(HttpServletResponse.SC_ACCEPTED);
+ resp.setContentType("text/plain");
+ resp.getWriter().write(Integer.toString(branchId));
+ }
+ }
+}

Back to the top