Click here to Skip to main content
Click here to Skip to main content
Articles » Database » NoSQL » General » Downloads
 
Add your own
alternative version
Go to top

RavenDB - An Introduction

, , 28 Apr 2010
An introduction to RavenDB - a new open source .NET document database using .NET 4.0 and VS 2010
Raven_DB.zip
RavenDB
.gitignore
ayende-open-source.snk
build
default.ps1
psake.ps1
psake_ext.ps1
Raven.Client.Tests
Document
Properties
Shard
Transactions
Raven.Client
Client
Document
Properties
Shard
ShardStrategy
ShardAccess
ShardResolution
ShardSelection
Util
Raven.Database
Data
Defaults
Exceptions
Extensions
Indexing
Json
Linq
PrivateExtensions
Properties
Storage
Tasks
Raven.FileStorage
Properties
Raven.Importer
Properties
Raven.Sample.ShardClient
Properties
Raven.Sample.SimpleClient
Properties
Raven.Scenarios
Properties
Scenarios
AddDocument_AddIndex_QueryIndexForDoc.saz
AfterTooManyErrorsDocumentIndexingForTheIndexWillBeDisabled.saz
AfterTooManyErrorsIndexWillBeDisabled.saz
BatchAndGetDocuments.saz
BatchQueryById.saz
BrowseIndex.saz
CanGenerateIdentityValues.saz
CanGetMetadataWhenLookingAtAllDocs.saz
CanGetMetadataWhenLookingAtAnIndex.saz
CannotDeleteStaticWithoutAccruateETag.saz
CanPutAndDeleteDocumentWithETag.saz
CanUseCollectionNamesInIndexes.saz
DeleteStatic.saz
DeletingDocumentThatDoesNotExistsAlwaysWorks.saz
DeletingWithBadETagWillFail.saz
IndexingErrorsWillShowUpInTheStats.saz
IndexingFunctionWithMultipleResultsPerSourceDocument.saz
PatchDocument.saz
PutAndGetAttachment.saz
PutAndGetDocument.saz
PutAndGetDocumentWithMetadataViaHeaders.saz
PutAndGetIndex.saz
PuttingDocumentUsingTransaction.saz
QueryMapReduceIndex.saz
QueryUsingIndex.saz
RecordHeadersForStatics.saz
SelectFieldsFromIndex.saz
TryingToUpdateAttachmentWithBadETagWillFail.saz
TryingToUpdateDocumentWithBadETagWillFail.saz
TryingToUpdateDocumentWithNonGuidETagWillFail.saz
UpdateAttachemtnUsingETag.saz
UpdatingDocsWillUpdateMapReduceResult.saz
WhenDeletingDocsWillUpdateMapReduceIndex.saz
WillDeleteDocumentFromIndex.saz
WillSupport304.saz
WillSupport304ForAttachments.saz
Raven.Server
Defaults
default.json
PowerShellProvider
Properties
Responders
WebUI
css
smoothness
images
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
favicon.ico
images
ajax-loader.gif
bgR.png
c1_i1.png
c2_i2.png
c2_i3.png
c2_i4.png
c2_i5.png
c2_i6.png
c3_i7.png
footer_bg.png
footerContainerBgR.png
header_bg.png
jsonEditor
doc.gif
docNode.gif
docNodeLast.gif
docNodeLastFirst.gif
folder.gif
folderNode.gif
folderNodeFirst.gif
folderNodeLast.gif
folderNodeLastFirst.gif
folderNodeOpen.gif
folderNodeOpenFirst.gif
folderNodeOpenLast.gif
folderNodeOpenLastFirst.gif
folderOpen.gif
vertLine.gif
logo.png
midBox1.png
midBox2Arrow.png
sideBarArrow.png
sideBarListBoxBottom.png
sideBarListBoxTop.png
submit.png
topNavSep.png
js
jstree
themes
default
dot_for_ie.gif
icons.png
throbber.gif
icons
txt.png
rdb.jsonEditor
JSONTemplates
Raven.Tests
Indexes
Linq
Patching
Properties
Storage
Transactions
Views
Raven.Tryouts
Properties
RavenDB.suo
Release
SharedLibs
Esent.Interop.dll
Esent.Interop.pdb
ICSharpCode.NRefactory.dll
ICSharpCode.SharpZipLib.dll
log4net.dll
Lucene.Net.dll
Lucene.Net.pdb
Newtonsoft.Json.dll
Rhino.Mocks.dll
SgmlReaderDll.dll
SgmlReaderDll.pdb
System.Management.Automation.dll
xunit.dll
xunit.extensions.dll
Tools
ILMerge.exe
xUnit
xunit.console.exe
xunit.dll
xunit.extensions.dll
xunit.gui.exe
xunit.installer.exe
XUnit.NAntTasks.dll
xunit.runner.msbuild.dll
xunit.runner.resharper.dll
xunit.runner.tdnet.dll
xunit.runner.utility.dll
zip.exe
Utilities
Binaries
ILMerge.exe
Newtonsoft.Json.dll
Raven.DefaultDatabase.Creator.exe
Raven.DefaultDatabase.Creator.pdb
Raven.Merger.exe
Raven.Merger.pdb
SgmlReaderDll.dll
SgmlReaderDll.pdb
Raven.DefaultDatabase.Creator
Properties
Raven.Merger
Properties
/*
* jQuery pager plugin
* Version 1.0 (12/22/2008)
* @requires jQuery v1.2.6 or later
*
* Example at: http://jonpauldavies.github.com/JQuery/Pager/PagerDemo.html
*
* Copyright (c) 2008-2009 Jon Paul Davies
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* 
* Read the related blog post and contact the author at http://www.j-dee.com/2008/12/22/jquery-pager-plugin/
*
* This version is far from perfect and doesn't manage it's own state, therefore contributions are more than welcome!
*
* Usage: .pager({ pagenumber: 1, pagecount: 15, buttonClickCallback: PagerClickTest });
*
* Where pagenumber is the visible page number
*       pagecount is the total number of pages to display
*       buttonClickCallback is the method to fire when a pager button is clicked.
*
* buttonClickCallback signiture is PagerClickTest = function(pageclickednumber) 
* Where pageclickednumber is the number of the page clicked in the control.
*
* The included Pager.CSS file is a dependancy but can obviously tweaked to your wishes
* Tested in IE6 IE7 Firefox & Safari. Any browser strangeness, please report.
*/
(function($) {

    $.fn.pager = function(options) {

        var opts = $.extend({}, $.fn.pager.defaults, options);

        return this.each(function() {

        // empty out the destination element and then render out the pager with the supplied options
            $(this).empty().append(renderpager(parseInt(options.pagenumber), parseInt(options.pagecount), options.buttonClickCallback));
            
            // specify correct cursor activity
            $('.pages li').mouseover(function() { document.body.style.cursor = "pointer"; }).mouseout(function() { document.body.style.cursor = "auto"; });
        });
    };

    // render and return the pager with the supplied options
    function renderpager(pagenumber, pagecount, buttonClickCallback) {

        // setup $pager to hold render
        var $pager = $('<ul class="pages"></ul>');

        // add in the previous and next buttons
        $pager.append(renderButton('first', pagenumber, pagecount, buttonClickCallback)).append(renderButton('prev', pagenumber, pagecount, buttonClickCallback));

        // pager currently only handles 10 viewable pages ( could be easily parameterized, maybe in next version ) so handle edge cases
        var startPoint = 1;
        var endPoint = 9;

        if (pagenumber > 4) {
            startPoint = pagenumber - 4;
            endPoint = pagenumber + 4;
        }

        if (endPoint > pagecount) {
            startPoint = pagecount - 8;
            endPoint = pagecount;
        }

        if (startPoint < 1) {
            startPoint = 1;
        }

        // loop thru visible pages and render buttons
        for (var page = startPoint; page <= endPoint; page++) {

            var currentButton = $('<li class="page-number">' + (page) + '</li>');

            page == pagenumber ? currentButton.addClass('pgCurrent') : currentButton.click(function() { buttonClickCallback(this.firstChild.data); });
            currentButton.appendTo($pager);
        }

        // render in the next and last buttons before returning the whole rendered control back.
        $pager.append(renderButton('next', pagenumber, pagecount, buttonClickCallback)).append(renderButton('last', pagenumber, pagecount, buttonClickCallback));

        return $pager;
    }

    // renders and returns a 'specialized' button, ie 'next', 'previous' etc. rather than a page number button
    function renderButton(buttonLabel, pagenumber, pagecount, buttonClickCallback) {

        var $Button = $('<li class="pgNext">' + buttonLabel + '</li>');

        var destPage = 1;

        // work out destination page for required button type
        switch (buttonLabel) {
            case "first":
                destPage = 1;
                break;
            case "prev":
                destPage = pagenumber - 1;
                break;
            case "next":
                destPage = pagenumber + 1;
                break;
            case "last":
                destPage = pagecount;
                break;
        }

        // disable and 'grey' out buttons if not needed.
        if (buttonLabel == "first" || buttonLabel == "prev") {
            pagenumber <= 1 ? $Button.addClass('pgEmpty') : $Button.click(function() { buttonClickCallback(destPage); });
        }
        else {
            pagenumber >= pagecount ? $Button.addClass('pgEmpty') : $Button.click(function() { buttonClickCallback(destPage); });
        }

        return $Button;
    }

    // pager defaults. hardly worth bothering with in this case but used as placeholder for expansion in the next version
    $.fn.pager.defaults = {
        pagenumber: 1,
        pagecount: 1
    };

})(jQuery);





By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Authors

No Biography provided

Paul B.

United States United States
I've been a software developer since 1996 and have enjoyed C# since 2003. I have a Bachelor's degree in Computer Science and for some reason, a Master's degree in Business Administration. I currently do software development contracting/consulting.

You may also be interested in...

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 28 Apr 2010
Article Copyright 2010 by Ayende @ Rahien, Paul B.
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid