Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB27411424 for ; Wed, 23 Jul 2014 19:24:22 +0000 (UTC) Received: (qmail 36174 invoked by uid 500); 23 Jul 2014 19:24:14 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 36091 invoked by uid 500); 23 Jul 2014 19:24:14 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 33841 invoked by uid 99); 23 Jul 2014 19:24:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2014 19:24:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4DA859B1C9E; Wed, 23 Jul 2014 19:24:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: deathbear@apache.org To: commits@couchdb.apache.org Date: Wed, 23 Jul 2014 19:25:12 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [63/64] [abbrv] fauxton commit: updated refs/heads/secondary-indexes to ef01e24 Setting Up Indexes addon Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/fe48dc97 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/fe48dc97 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/fe48dc97 Branch: refs/heads/secondary-indexes Commit: fe48dc97befb6032233d9c462296e94a4d8098d5 Parents: 893e988 Author: deathbearbrown Authored: Tue Jul 22 11:39:46 2014 -0400 Committer: deathbearbrown Committed: Wed Jul 23 15:02:01 2014 -0400 ---------------------------------------------------------------------- .gitignore | 1 + app/addons/indexes/base.js | 44 +++++++++++++++++++++++++++++ app/addons/indexes/index-components.js | 28 ++++++++++++++++++ app/addons/indexes/resources.js | 21 ++++++++++++++ app/addons/indexes/routes.js | 33 ++++++++++++++++++++++ app/addons/indexes/views.js | 21 ++++++++++++++ 6 files changed, 148 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fe48dc97/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 1baaaf1..4d2ca75 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ app/addons/* !app/addons/replication !app/addons/contribute !app/addons/auth +!app/addons/indexes !app/addons/exampleAuth !app/addons/permissions !app/addons/verifyinstall http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fe48dc97/app/addons/indexes/base.js ---------------------------------------------------------------------- diff --git a/app/addons/indexes/base.js b/app/addons/indexes/base.js new file mode 100644 index 0000000..a7107a1 --- /dev/null +++ b/app/addons/indexes/base.js @@ -0,0 +1,44 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + + +/* View Indexes */ +define([ + "app", + "api", + "addons/indexes/views", + "addons/indexes/routes" +], +function(app, FauxtonAPI, Views, Routes) { + Routes.initialize = function() { + + /* + Example of an extension: + An extension is just an event that may or may not have listener in another view. + In this case the listener is in the documents addon in the sidebar. + + If there are is a view that you want rendered in another route, this is the way to do it. + + Each Secondary index is going to trigger this event with the views it's passing. + The views will be rendered and have links to the routes defined in this addon. Then it's just business as usual. + + FauxtonAPI.registerExtension('sidebar:list', new Views.IndexMenu({})); + FauxtonAPI.registerExtension('sidebar:links',{ + title: "New View", + url: "new_view" + }); + + + */ + }; + return Routes; +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fe48dc97/app/addons/indexes/index-components.js ---------------------------------------------------------------------- diff --git a/app/addons/indexes/index-components.js b/app/addons/indexes/index-components.js new file mode 100644 index 0000000..ffb22a0 --- /dev/null +++ b/app/addons/indexes/index-components.js @@ -0,0 +1,28 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + + +/* + Index components includes any common, generic, and reusable code for creating secondary indexes + View functions, List functions, Show Functions, and Filter functions, as well as anything created by + couchdb affiliates. +*/ + +define([ + "app", + "api" +], + +function(app, FauxtonAPI) { + + +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fe48dc97/app/addons/indexes/resources.js ---------------------------------------------------------------------- diff --git a/app/addons/indexes/resources.js b/app/addons/indexes/resources.js new file mode 100644 index 0000000..667eaba --- /dev/null +++ b/app/addons/indexes/resources.js @@ -0,0 +1,21 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +define([ + "app", + "addons/fauxton/base", +], + +function (app, Fauxton) { + var Resources = {}; + + return Resources; +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fe48dc97/app/addons/indexes/routes.js ---------------------------------------------------------------------- diff --git a/app/addons/indexes/routes.js b/app/addons/indexes/routes.js new file mode 100644 index 0000000..4c7515d --- /dev/null +++ b/app/addons/indexes/routes.js @@ -0,0 +1,33 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +define([ + "app", + "api", + "addons/indexes/resources", + "addons/indexes/views" +], + +function (app, FauxtonAPI, Resources, Views) { + + var ViewIndexes = FauxtonAPI.RouteObject.extend({}); + + var FilterIndexes = FauxtonAPI.RouteObject.extend({}); + + var ShowIndexes = FauxtonAPI.RouteObject.extend({}); + + var ListIndexes = FauxtonAPI.RouteObject.extend({}); + + + Resources.RouteObjects = [ViewIndexes, FilterIndexes, ShowIndexes, ListIndexes]; + + return Resources; +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fe48dc97/app/addons/indexes/views.js ---------------------------------------------------------------------- diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js new file mode 100644 index 0000000..e8383cf --- /dev/null +++ b/app/addons/indexes/views.js @@ -0,0 +1,21 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +define([ + "app", + "api" +], + +function (app, FauxtonAPI) { + var Views = {}; + + return Views; +});