Skip to content

Commit

Permalink
First version of working Azure DocumentDB studio. This client tool al…
Browse files Browse the repository at this point in the history
…lows you to perform CRUD operation on Azure DocumentDB.

It supports:
1. Browse DocumentDB resources and learn DocumentDB resource model.
2. Issue Insert, Replace, Delete, Read (CRUD) operations on every DocumentDB resource and resource feed.
3. Issue SQL/UDF query. Execute storedprocedure.
4. Inspect heads (quota, usage, RG charge) for every operation.

To start:
1. Add your account from File|Add account. You can provision and get your account endpoint and masterkey from https://portal.azure.com
2. You can navigate the DocumentDB resource model in the left side treeview panel.
3. Right click any resource feed or item for supported CRUD or query or stored procedure operation.
The tool requires .Net Framework 4.0 installed on your machine.

Signed-off-by: unknown <[email protected]>
  • Loading branch information
unknown authored and unknown committed Sep 6, 2014
1 parent bceecc8 commit 40f243a
Show file tree
Hide file tree
Showing 44 changed files with 5,332 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Nuget packages
packages/

# User-specific files
*.suo
*.user
*.sln.docstates

34 changes: 34 additions & 0 deletions DocumentDBStudio.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentDBStudio", "DocumentDBSudio\DocumentDBStudio.csproj", "{5EA467F3-F306-44CF-877B-7E593754F1B4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Debug|x64.ActiveCfg = Debug|x64
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Debug|x64.Build.0 = Debug|x64
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Debug|x86.ActiveCfg = Debug|x86
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Debug|x86.Build.0 = Debug|x86
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Release|Any CPU.Build.0 = Release|Any CPU
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Release|x64.ActiveCfg = Release|x64
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Release|x64.Build.0 = Release|x64
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Release|x86.ActiveCfg = Release|x86
{5EA467F3-F306-44CF-877B-7E593754F1B4}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions DocumentDBSudio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
[Oo]bj/
255 changes: 255 additions & 0 deletions DocumentDBSudio/DocumentDBStudio.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5EA467F3-F306-44CF-877B-7E593754F1B4}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Azure.DocumentDBStudio</RootNamespace>
<AssemblyName>DocumentDBStudio</AssemblyName>
<ApplicationIcon>
</ApplicationIcon>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>true</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.Documents.Client, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Azure.Documents.Client.0.9.0-preview\lib\net40\Microsoft.Azure.Documents.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="TreeNodes.cs" />
<Compile Include="SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<SubType>Designer</SubType>
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Helper.cs" />
<Compile Include="Settings.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Properties\DeleteHS.png" />
<Content Include="Properties\HomeHS.png" />
<Content Include="Properties\NavBack.png" />
<Content Include="Properties\NavForward.png" />
<Content Include="Properties\RefreshDocViewHS.png" />
<Content Include="Properties\ZoomHS.png" />
<EmbeddedResource Include="Resources\loading.gif" />
<Content Include="Resources\Attachment.png" />
<Content Include="Resources\Conflict.png" />
<Content Include="Resources\database.png" />
<Content Include="Resources\DocDB.png" />
<Content Include="Resources\Feed.png" />
<Content Include="Resources\Javascript.png" />
<Content Include="Resources\Permission.png" />
<EmbeddedResource Include="Resources\prettyJSON\backbone-min.js" />
<EmbeddedResource Include="Resources\prettyJSON\jquery-1.11.1.min.js" />
<EmbeddedResource Include="Resources\prettyJSON\pretty-json-min.js" />
<EmbeddedResource Include="Resources\prettyJSON\pretty-json.css" />
<EmbeddedResource Include="Resources\prettyJSON\PrettyPrintJSONTemplate.html" />
<EmbeddedResource Include="Resources\prettyJSON\underscore-min.js" />
<Content Include="Resources\SystemFeed.png" />
<Content Include="Resources\User.png" />
<EmbeddedResource Include="SettingsForm.resx">
<DependentUpon>SettingsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources\home.html" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
74 changes: 74 additions & 0 deletions DocumentDBSudio/Helper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//-----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using Microsoft.Azure.DocumentDBStudio.Properties;

namespace Microsoft.Azure.DocumentDBStudio
{
static class Constants
{
public readonly static string ProductVersion = "0.10";
public readonly static string ApplicationName = "Azure DocumentDB Studio";

/// <summary>
/// We can enable when there is emulator.
/// </summary>
public readonly static string LocalEmulatorEndpoint = "NotReleasedYet";
public readonly static string LocalEmulatorMasterkey = "NotReleasedYet";
}

/// <summary>
/// </summary>
class Helper
{
static internal string FormatTextAsHtml(string text, bool encodeWhitespace)
{
return FormatTextAsHtml(text, encodeWhitespace, true);
}

static internal string FormatTextAsHtml(string text, bool encodeWhitespace, bool includeBodyTags)
{
// There must be a BCL function that will do this correctly...
string html;
html = text.Replace("&", "&amp;");
html = html.Replace("<", "&lt;");
html = html.Replace(">", "&gt;");
html = html.Replace("\"", "&quot;");
html = html.Replace("\'", "&apos;");
if (encodeWhitespace)
{
html = html.Replace("\r\n", "<br>");
html = html.Replace("\n", "<br>");
html = html.Replace(" ", "&nbsp;");
}
else
{
html = "<pre id=preContent>" + html + "</pre>";
}

if (includeBodyTags)
{
StringBuilder sb = new StringBuilder();
sb.Append("<html><head><title>TextPrintJSON</title><style type=\"text/css\">");
sb.Append("body, pre, table { font-size: 9pt; }");
sb.Append("body, pre, table { font-family : Consolas, Courier New, monospace }");
sb.Append("td { vertical-align : top } ");
sb.Append("</style></head><body>");
sb.Append(html);
sb.Append("</body></html>");
html = sb.ToString();
}

return html;
}
}

}
Loading

0 comments on commit 40f243a

Please sign in to comment.