You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Justin Walgran <jw...@gmail.com> on 2008/11/28 19:24:48 UTC

Hosting a Cappuccino application from CouchDB

The Cappuccino web framework (http://cappuccino.org/) relies on a
library of javascript files in nested directories below a top-level
Frameworks directory. Is there a way I can serve this up from Couch?

- Justin Walgran

Re: Hosting a Cappuccino application from CouchDB

Posted by Justin Walgran <jw...@gmail.com>.
The holiday season gave me some time to get back to trying to make
CouchDB and Cappuccino play nice. Here are some repro steps:

1) Download the starter kit
http://download.cappuccino.org/CappuccinoStarter-0.6.zip
2) Unzip and cd into the NewApplication directory
3) Copy the entire Frameworks directory to
/usr/local/share/couchdb/www (this will make the framework files
available from http://localhost:5984/_utils/Frameworks)

4) Edit index-debug.html
  Replace 'OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks",
"SomethingElse"];'
     with 'OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks",
"http://localhost:5984/_utils/Frameworks"];'

  Replace '<script src = "Frameworks/Debug/Objective-J/Objective-J.js"
type = "text/javascript"></script>'
     with '<script src =
"http://localhost:5984/_utils/Frameworks/Debug/Objective-J/Objective-J.js"
type = "text/javascript"></script>'

  Replace '<img src =
"Frameworks/AppKit/Resources/CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"
style="left: -32px; position: relative;
top: -32px;" />'
     with '<img src =
"http://localhost:5984/_utils/Frameworks/AppKit/Resources/CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"
style="left: -32px; position: relative; top: -32px;" />'

5) Create a new CouchDB database called 'helloworld'
6) Create a new document called '_design/helloworld'
7) Upload all the files as attachments to the '_design/helloworld' document
      AppController.j
      index-debug.html (with edits)
      index.html
      Info.plist
      main.j

8) Browse to http://localhost:5984/helloworld/_design%2Fhelloworld/index-debug.html
in Firefox+Firebug

You will see an error in firebug on line 1090 of Objective-J.js,
however setting a breakpoint on this line does not reveal the issue.

I feel like I am very close to consummating this marriage. Is there
anything on the CouchDB side of things that could be causing this
failure?

-Justin Walgran


On Fri, Nov 28, 2008 at 4:09 PM, Justin Walgran <jw...@gmail.com> wrote:
> That is incredibly helpful. Thank you.
>
> To take it a step further, I am very interested in Chris Anderson's
> work with distributing apps via CouchDB replication. Is there any way
> the LightsOut application could be incorporated as an attachment like
> Chris's Twitter application?
>
> - Justin Walgran
>
> On Fri, Nov 28, 2008 at 1:49 PM, Jan Lehnardt <ja...@apache.org> wrote:
>> I tired with the LightsOff demo.
>>
>> Two ways:
>>
>> 1) Put the LightsOff directory into $prefix/share/couchdb/www/
>>
>> LightsOff can be accessed at http://127.0.0.1:5984/_utils/LightsOff/
>> (trailing slash is significant).
>>
>> 2) Add this to your $prefix/etc/couchdb/local.ini file:
>>
>> [httpd_global_handlers]
>> LightsOff = {couch_httpd_misc_handlers, handle_utils_dir_req,
>> "/path/to/LightsOff"}
>>
>> (see default.ini for more examples ot http global handlers)
>>
>> LightsOff can be accessed at http://127.0.0.1:5984/LightsOff/ (trailing
>> slash is significant),
>>
>> Cheers
>> Jan
>> --
>>
>> On 28 Nov 2008, at 10:24, Justin Walgran wrote:
>>
>>> The Cappuccino web framework (http://cappuccino.org/) relies on a
>>> library of javascript files in nested directories below a top-level
>>> Frameworks directory. Is there a way I can serve this up from Couch?
>>>
>>> - Justin Walgran
>>>
>>
>>
>

Re: Hierarchic Atachments/App Deployments (was: Hosting a Cappuccino application from CouchDB)

Posted by Justin Walgran <jw...@gmail.com>.
Damien,  I tried adding forward slashes to the file names to simulate
a hierarchy as you suggested, but this did not process the invoices
any further I filed the following bug report:

https://issues.apache.org/jira/browse/COUCHDB-167

-Justin

On Fri, Nov 28, 2008 at 6:10 PM, Damien Katz <da...@apache.org> wrote:
> I think should be possible to attach the files using directory slashes right
> in the filename. If that doesn't work, file a bug.
>
> -Damien
>
>
> On Nov 28, 2008, at 5:37 PM, Antony Blakey wrote:
>
>>
>> On 29/11/2008, at 7:39 AM, Justin Walgran wrote:
>>
>>> That is incredibly helpful. Thank you.
>>>
>>> To take it a step further, I am very interested in Chris Anderson's
>>> work with distributing apps via CouchDB replication. Is there any way
>>> the LightsOut application could be incorporated as an attachment like
>>> Chris's Twitter application?
>>
>> Hierarchic attachments would be really useful I think. I could certainly
>> use them right now.
>>
>> Because they don't exist, I'm building a notification handler that listens
>> for documents with attributes that indicate that .zip attachments should be
>> unpacked. I use a separate DB for such documents (to filter the
>> notifications) and it will allow me to replicate existing static websites
>> over Couch.
>>
>> Delta replication of attachments would be useful (e.g.
>> XDelta/RSync/Unison) because then I could use either no-compression .zips,
>> or .tars, and get much improved replication performance (I do this now in a
>> different context).
>>
>> I'm working on replicating both Smalltalk packages/files and Ruby
>> gems/files via Couch with a handler that manages the deployment and
>> execution of such processes (driven by a definition document) for deploying
>> applications (that use Couch) via Couch. It's particularly useful for
>> Smalltalk because Smalltalk scalability is handled by running multiple
>> instances on the same box (ST implementations generally use green threads
>> with no native multithreading), which I can manage really easily using
>> Erlang.
>>
>> Antony Blakey
>> --------------------------
>> CTO, Linkuistics Pty Ltd
>> Ph: 0438 840 787
>>
>> You can't just ask customers what they want and then try to give that to
>> them. By the time you get it built, they'll want something new.
>> -- Steve Jobs
>>
>>
>>
>
>
>

Re: Hierarchic Atachments/App Deployments (was: Hosting a Cappuccino application from CouchDB)

Posted by Damien Katz <da...@apache.org>.
I think should be possible to attach the files using directory slashes  
right in the filename. If that doesn't work, file a bug.

-Damien


On Nov 28, 2008, at 5:37 PM, Antony Blakey wrote:

>
> On 29/11/2008, at 7:39 AM, Justin Walgran wrote:
>
>> That is incredibly helpful. Thank you.
>>
>> To take it a step further, I am very interested in Chris Anderson's
>> work with distributing apps via CouchDB replication. Is there any way
>> the LightsOut application could be incorporated as an attachment like
>> Chris's Twitter application?
>
> Hierarchic attachments would be really useful I think. I could  
> certainly use them right now.
>
> Because they don't exist, I'm building a notification handler that  
> listens for documents with attributes that indicate that .zip  
> attachments should be unpacked. I use a separate DB for such  
> documents (to filter the notifications) and it will allow me to  
> replicate existing static websites over Couch.
>
> Delta replication of attachments would be useful (e.g. XDelta/RSync/ 
> Unison) because then I could use either no-compression .zips,  
> or .tars, and get much improved replication performance (I do this  
> now in a different context).
>
> I'm working on replicating both Smalltalk packages/files and Ruby  
> gems/files via Couch with a handler that manages the deployment and  
> execution of such processes (driven by a definition document) for  
> deploying applications (that use Couch) via Couch. It's particularly  
> useful for Smalltalk because Smalltalk scalability is handled by  
> running multiple instances on the same box (ST implementations  
> generally use green threads with no native multithreading), which I  
> can manage really easily using Erlang.
>
> Antony Blakey
> --------------------------
> CTO, Linkuistics Pty Ltd
> Ph: 0438 840 787
>
> You can't just ask customers what they want and then try to give  
> that to them. By the time you get it built, they'll want something  
> new.
> -- Steve Jobs
>
>
>



Hierarchic Atachments/App Deployments (was: Hosting a Cappuccino application from CouchDB)

Posted by Antony Blakey <an...@gmail.com>.
On 29/11/2008, at 7:39 AM, Justin Walgran wrote:

> That is incredibly helpful. Thank you.
>
> To take it a step further, I am very interested in Chris Anderson's
> work with distributing apps via CouchDB replication. Is there any way
> the LightsOut application could be incorporated as an attachment like
> Chris's Twitter application?

Hierarchic attachments would be really useful I think. I could  
certainly use them right now.

Because they don't exist, I'm building a notification handler that  
listens for documents with attributes that indicate that .zip  
attachments should be unpacked. I use a separate DB for such documents  
(to filter the notifications) and it will allow me to replicate  
existing static websites over Couch.

Delta replication of attachments would be useful (e.g. XDelta/RSync/ 
Unison) because then I could use either no-compression .zips,  
or .tars, and get much improved replication performance (I do this now  
in a different context).

I'm working on replicating both Smalltalk packages/files and Ruby gems/ 
files via Couch with a handler that manages the deployment and  
execution of such processes (driven by a definition document) for  
deploying applications (that use Couch) via Couch. It's particularly  
useful for Smalltalk because Smalltalk scalability is handled by  
running multiple instances on the same box (ST implementations  
generally use green threads with no native multithreading), which I  
can manage really easily using Erlang.

Antony Blakey
--------------------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

You can't just ask customers what they want and then try to give that  
to them. By the time you get it built, they'll want something new.
   -- Steve Jobs




Re: Hosting a Cappuccino application from CouchDB

Posted by Justin Walgran <jw...@gmail.com>.
That is incredibly helpful. Thank you.

To take it a step further, I am very interested in Chris Anderson's
work with distributing apps via CouchDB replication. Is there any way
the LightsOut application could be incorporated as an attachment like
Chris's Twitter application?

- Justin Walgran

On Fri, Nov 28, 2008 at 1:49 PM, Jan Lehnardt <ja...@apache.org> wrote:
> I tired with the LightsOff demo.
>
> Two ways:
>
> 1) Put the LightsOff directory into $prefix/share/couchdb/www/
>
> LightsOff can be accessed at http://127.0.0.1:5984/_utils/LightsOff/
> (trailing slash is significant).
>
> 2) Add this to your $prefix/etc/couchdb/local.ini file:
>
> [httpd_global_handlers]
> LightsOff = {couch_httpd_misc_handlers, handle_utils_dir_req,
> "/path/to/LightsOff"}
>
> (see default.ini for more examples ot http global handlers)
>
> LightsOff can be accessed at http://127.0.0.1:5984/LightsOff/ (trailing
> slash is significant),
>
> Cheers
> Jan
> --
>
> On 28 Nov 2008, at 10:24, Justin Walgran wrote:
>
>> The Cappuccino web framework (http://cappuccino.org/) relies on a
>> library of javascript files in nested directories below a top-level
>> Frameworks directory. Is there a way I can serve this up from Couch?
>>
>> - Justin Walgran
>>
>
>

Re: Hosting a Cappuccino application from CouchDB

Posted by Jan Lehnardt <ja...@apache.org>.
I tired with the LightsOff demo.

Two ways:

1) Put the LightsOff directory into $prefix/share/couchdb/www/

LightsOff can be accessed at http://127.0.0.1:5984/_utils/LightsOff/  
(trailing slash is significant).

2) Add this to your $prefix/etc/couchdb/local.ini file:

[httpd_global_handlers]
LightsOff = {couch_httpd_misc_handlers, handle_utils_dir_req, "/path/ 
to/LightsOff"}

(see default.ini for more examples ot http global handlers)

LightsOff can be accessed at http://127.0.0.1:5984/LightsOff/  
(trailing slash is significant),

Cheers
Jan
--

On 28 Nov 2008, at 10:24, Justin Walgran wrote:

> The Cappuccino web framework (http://cappuccino.org/) relies on a
> library of javascript files in nested directories below a top-level
> Frameworks directory. Is there a way I can serve this up from Couch?
>
> - Justin Walgran
>