From 84c1d5c1527183a4e2830deab5b177d880914f1c Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 22 Oct 2011 09:01:20 -0400 Subject: Documentation. Refactoring class names. Re-encapsulate settings. --- docs/01_setup.mkd | 1 + docs/02_rpc.mkd | 77 ++++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 57 insertions(+), 21 deletions(-) (limited to 'docs') diff --git a/docs/01_setup.mkd b/docs/01_setup.mkd index c7a8ff61..b2c5b2f8 100644 --- a/docs/01_setup.mkd +++ b/docs/01_setup.mkd @@ -134,6 +134,7 @@ All repository settings are stored within the repository `.git/config` file unde showReadme = false federationStrategy = FEDERATE_THIS isFederated = false + skipSizeCalculation = false federationSets = #### Repository Names diff --git a/docs/02_rpc.mkd b/docs/02_rpc.mkd index b01eb679..94739ca3 100644 --- a/docs/02_rpc.mkd +++ b/docs/02_rpc.mkd @@ -30,7 +30,8 @@ The Gitblit RPC mechanism, like the Gitblit JGit servlet, syndication/feed servl LIST_FEDERATION_RESULTS-admin-List<FederationModel> LIST_FEDERATION_PROPOSALS-admin-List<FederationProposal> LIST_FEDERATION_SETS-admin-List<FederationSet> -LIST_SETTINGS-admin-Map<String, SettingModel> +LIST_SETTINGS-admin-ServerSettings (see example below) +LIST_STATUS-admin-ServerStatus (see example below) ### RPC/HTTP Response Codes @@ -55,6 +56,8 @@ One obvious goal of a Gitblit RPC mechanism would be to have an EGit Feature tha This particular project should not be difficult as the only external dependency for `com.gitblit.utils.RpcUtils` is [google-gson](http://google-gson.googlecode.com) which is already a dependency of the EGit/GitHub Mylyn feature. +One proposal from the EGit team is to define a common JSON RPC method for enumeration of repositories which can be implemented by Git hosts. The EGit team would then implement the UI and the client-side enumeration code. This idea was raised as part of this [feature request for EGit](https://bugs.eclipse.org/bugs/show_bug.cgi?id=361251). + Currently this project is in the planning stage. ### Example: LIST_REPOSITORIES @@ -80,6 +83,7 @@ Currently this project is in the planning stage. "libraries" ], "isFederated": false, + "skipSizeCalculation": false, "size": "102 KB" }, "https://localhost/git/libraries/smack.git": { @@ -97,6 +101,7 @@ Currently this project is in the planning stage. "federationStrategy": "FEDERATE_THIS", "federationSets": [], "isFederated": false, + "skipSizeCalculation": false, "size": "4.8 MB" } } @@ -157,28 +162,58 @@ The original repository name is specified in the *name* url parameter. The new ### Example: LIST_SETTINGS **url**: https://localhost/rpc?req=LIST_SETTINGS -**response body**: Map<String, SettingModel> +**response body**: ServerSettings
 {
-  "web.siteName": {
-    "name": "web.siteName",
-    "currentValue": "",
-    "defaultValue": "",
-    "description": "Gitblit Web Settings\nIf blank Gitblit is displayed.",
-    "since": "0.5.0",
-    "caseSensitive": false,
-    "restartRequired": false,
-    "spaceDelimited": false
-  },
-  "web.summaryCommitCount": {
-    "name": "web.summaryCommitCount",
-    "currentValue": "16",
-    "defaultValue": "16",
-    "description": "The number of commits to display on the summary page\nValue must exceed 0 else default of 16 is used",
-    "since": "0.5.0",
-    "caseSensitive": false,
-    "restartRequired": false,
-    "spaceDelimited": false
+  "settings": {
+      "web.siteName": {
+        "name": "web.siteName",
+        "currentValue": "",
+        "defaultValue": "",
+        "description": "Gitblit Web Settings\nIf blank Gitblit is displayed.",
+        "since": "0.5.0",
+        "caseSensitive": false,
+        "restartRequired": false,
+        "spaceDelimited": false
+      },
+      "web.summaryCommitCount": {
+        "name": "web.summaryCommitCount",
+        "currentValue": "16",
+        "defaultValue": "16",
+        "description": "The number of commits to display on the summary page\nValue must exceed 0 else default of 16 is used",
+        "since": "0.5.0",
+        "caseSensitive": false,
+        "restartRequired": false,
+        "spaceDelimited": false
+      }
   }
 }
+
+ +### Example: LIST_STATUS +**url**: https://localhost/rpc?req=LIST_STATUS +**response body**: ServerStatus +
+{
+  "bootDate": "2011-10-22T12:13:00Z",
+  "systemProperties": {
+    "file.encoding": "Cp1252",
+    "java.home": "C:\\Program Files\\Java\\jdk1.6.0_26\\jre",
+    "java.io.tmpdir": "C:\\Users\\JAMESM~1\\AppData\\Local\\Temp\\",
+    "java.runtime.name": "Java(TM) SE Runtime Environment",
+    "java.runtime.version": "1.6.0_26-b03",
+    "java.vendor": "Sun Microsystems Inc.",
+    "java.version": "1.6.0_26",
+    "java.vm.info": "mixed mode",
+    "java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
+    "java.vm.vendor": "Sun Microsystems Inc.",
+    "java.vm.version": "20.1-b02",
+    "os.arch": "amd64",
+    "os.name": "Windows 7",
+    "os.version": "6.1"
+  },
+  "heapAllocated": 128057344,
+  "heapFree": 120399168,
+  "heapSize": 1899560960
+}
 
\ No newline at end of file -- cgit v1.2.3