Skip to content

Commit

Permalink
v3.3.0
Browse files Browse the repository at this point in the history
- added WEB Studio interface
- logger keeps last 100 logs for recall
- bug fix HF storage file seek position overflow
  • Loading branch information
mgholam committed Apr 5, 2016
1 parent a78d165 commit f7f106b
Show file tree
Hide file tree
Showing 19 changed files with 480 additions and 407 deletions.
4 changes: 2 additions & 2 deletions BuildVersion.cs
@@ -1,6 +1,6 @@
using System.Reflection;
// build number = 178
// build number = 186
// build version = 3.3.0

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.3.0.178")]
[assembly: AssemblyFileVersion("3.3.0.186")]
3 changes: 2 additions & 1 deletion RaptorDB.Common/Properties/AssemblyInfo.cs
@@ -1,9 +1,10 @@
using System.Reflection;

using System.Security;

[assembly: AssemblyTitle("RaptorDB.Common")]
[assembly: AssemblyDescription("Common classes for RaptorDB client and server")]
[assembly: AssemblyProduct("RaptorDB.Common")]




1 change: 1 addition & 0 deletions RaptorDB.Common/View.cs
Expand Up @@ -25,6 +25,7 @@ public abstract class ViewBase
/// <summary>
/// Column definitions for the view storage
/// </summary>
[XmlIgnore]
public Type Schema { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion RaptorDB/AssemblyInfo.cs
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Security;

[assembly: AssemblyTitle("RaptorDB Document Store")]
[assembly: AssemblyDescription("NoSql, JSON based, Document store database with compiled .net map functions and automatic hybrid bitmap indexing and LINQ query filters (now with standalone Server mode, Backup and Active Restore, Transactions, Server side queries, MonoDroid support, HQ-Branch Replication)")]
[assembly: AssemblyProduct("RaptorDB Document Store")]


2 changes: 1 addition & 1 deletion RaptorDB/Global.cs
Expand Up @@ -111,7 +111,7 @@ public class Global
/// </summary>
public static short WebStudioPort = 91;
/// <summary>
/// Local machine access only Web Studio - no network access (deafult = true)
/// Local machine access only Web Studio - no network access (default = true)
/// </summary>
public static bool LocalOnlyWebStudio = true;
}
Expand Down
71 changes: 53 additions & 18 deletions RaptorDB/REST/RestServer.cs
Expand Up @@ -302,7 +302,7 @@ private void InitializeCommandHandler()
var h = _rdb.FullTextSearch(qry);
List<int> list = new List<int>();
_log.Debug("search = " + qry);
if (count > -1 && h.Length>0)
if (count > -1 && h.Length > 0)
{
int c = list.Count;
for (int i = start; i < start + count; i++)
Expand All @@ -312,9 +312,9 @@ private void InitializeCommandHandler()
{
Items = list,
Count = count,
TotalCount= h.Length
TotalCount = h.Length
};
var s = fastJSON.JSON.ToJSON(obj, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, UseEscapedUnicode = false, EnableAnonymousTypes=true });
var s = fastJSON.JSON.ToJSON(obj, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, UseEscapedUnicode = false, EnableAnonymousTypes = true });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
Expand All @@ -339,7 +339,7 @@ private void InitializeCommandHandler()
}
var h = _rdb.GetKVHF().GetKeysHF();
List<string> list = new List<string>();
if (count > -1 && h.Length>0)
if (count > -1 && h.Length > 0)
{
for (int i = start; i < start + count; i++)
list.Add(h[i]);
Expand All @@ -364,6 +364,47 @@ private void InitializeCommandHandler()
WriteResponse(ctx, 200, s);
});

_handler.Add("viewinfo", // takes : viewname
(ctx, qry, o) =>
{
if (qry == "")
{
WriteResponse(ctx, 404, "ViewInfo requires a viewname to be defined e.g. ?customerview");
}
else
{
var vi = GetViewInfo(qry);
if (vi == "")
WriteResponse(ctx, 500, "View not found.");
else {
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, vi);
}
}
});
}

internal string GetViewInfo(string name)
{
var v = _rdb.GetViews().Find(x => x.Name.ToLower() == name.ToLower());
if (v == null)
return "";

var p = new Dictionary<string, string>();

foreach (var pr in v.Schema.GetProperties())
p.Add(pr.Name, pr.PropertyType.ToString());

foreach (var pr in v.Schema.GetFields())
p.Add(pr.Name, pr.FieldType.ToString());

var obj = new
{
View = v,
Schema = p
};
var s = fastJSON.JSON.ToJSON(obj, new fastJSON.JSONParameters { UseFastGuid = false, UseEscapedUnicode = false, EnableAnonymousTypes = true });
return s;
}

private object GetInfo()
Expand Down Expand Up @@ -558,16 +599,10 @@ private void WriteResources()
string s = r.Replace(name, "");
if (s.StartsWith("WEB"))
{
s = s.Replace("WEB.", "");
string folder = "WEB\\";
if (s.StartsWith("images"))
{
s = s.Replace("images.", "");
folder += "images\\";
}
string p = folder.Replace("\\", "/") + s;
//_log.Debug(" adding : " + p);
_WebCache.Add(p, r);
var ext = Path.GetExtension(s);
s = s.Replace(ext, "").Replace(".", "/");
var p = s + ext;
_WebCache.Add(p.ToLower(), r);
//if (Global.useWEBresources == false && File.Exists(folder + s) == false)
//{
// using (MemoryStream ms = new MemoryStream())
Expand Down Expand Up @@ -661,7 +696,7 @@ private void ListenerCallback(IAsyncResult ar)
// else
// ProcessGET(_rdb, ctx, path, r);
//}
if (_WebCache.ContainsKey(webpath + path))// File.Exists(webpath + path)) // FIX : path here
if (_WebCache.ContainsKey((webpath + path).ToLower()))// File.Exists(webpath + path)) // FIX : path here
{
switch (Path.GetExtension(path).ToLower())
{
Expand All @@ -677,13 +712,13 @@ private void ListenerCallback(IAsyncResult ar)

}
_log.Debug("serving file : " + webpath + path);
WriteResponse(ctx, 200, ReadFromStream(_WebCache[webpath + path]), true);// File.ReadAllBytes(webpath + path), true);
WriteResponse(ctx, 200, ReadFromStream(_WebCache[(webpath + path).ToLower()]), true);// File.ReadAllBytes(webpath + path), true);
}
else if (path == "")
{
ctx.Response.ContentType = "text/html";
_log.Debug("serving file : " + webpath + "testpage.html");
WriteResponse(ctx, 200, ReadFromStream(_WebCache[webpath + "testpage.html"]), true);
_log.Debug("serving file : " + webpath + "app.html");
WriteResponse(ctx, 200, ReadFromStream(_WebCache[(webpath + "app.html").ToLower()]), true);
}
else
WriteResponse(ctx, 404, "route path not found : " + ctx.Request.Url.GetComponents(UriComponents.Path, UriFormat.Unescaped));
Expand Down

0 comments on commit f7f106b

Please sign in to comment.