This project is read-only.

Multiple Workspace Example(s)

Feb 4, 2009 at 4:01 PM
Do you have any examples or documentation for how to set-up multiple workspaces?  Is it possible to have the following URL's:

http://www.mysite.com/blogs/bob
http://www.mysite.com/blogs/joe
http://www.mysite.com/blogs/pete

or does it need to be DNS based (eg. http://bob.blogs.mysite.com, http://joe.blogs.mysite.com, etc.)?

Any help would be appreciated.
Thanks,
Bob
Feb 5, 2009 at 6:09 PM
BlogSvc was designed to support both scenarios, Multi-Folder and Multi-Subdomain.

Multi-Folder:
http://www.mysite.com/{workspace}/{collection}

Multi-Subdomain
http://{workspace}.mysite.com/{collection}

However, the subdomain support needs to be re-implimented and tested since the latest routing refactor (version 0.9).  Also, I have not thouroughly tested the mult-folder scenario.  I'll add this to the testing for the next release 0.9.  If you interested in helping test, let me know.

Also, subdomains are pain to get right since IIS (even IIS7) has poor support.  Most hosting providers will force your subdomains into their own virtual directory which then forces you to run multiple instances.
Feb 5, 2009 at 6:19 PM
I have no problems helping test - but the piece I am missing at the moment is how to create a new workspace in the Service.config file.  I haven't been able to figure out where the connection between the workspace element and the actual routing takes place - I had assumed it was in the <atom:id> tag, but my early tests have been unsuccesful (at least with build 30926).

We would like to avoid sub-domain configuration so as to take dns issues out of the mix (as well as for some other reasons).

Also, as an FYI, I believe the version of StructureMap.dll in your Dependencies folder is the wrong version - replacing it with the latest StructureMap.dll file allows the solution to build. 

Bob
Feb 6, 2009 at 3:36 PM
Thanks Bob for that piece of information - I couldn't get it to build either. I'll update the StructureMap.dll.

- Oisin

p.s. Jarrett et al, I think your thinking of renaming BlogSvc to AtomServer is absolutely spot-on.
Feb 7, 2009 at 4:18 AM
I believe the StrutureMap.dll should now be the correct version.

@oisin, great, I'll look at making the name change official with version 0.9.  I'm hoping 0.9 will be ready within the next 10 days.
Feb 8, 2009 at 8:11 PM
Edited Feb 8, 2009 at 8:15 PM
I just finished testing mult-folder workspaces.  There were a few tweaks required to get it working. I created a test workspace with an additional blog collection.  You can see it at: http://atomserver.net/test/blog.xhtml

All of the links are automatically updated with the extra workspace path when setting the service type to "MultiFolder".  

See below for an example service.config (note www is the default workspace name):

<service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" 
         xmlns:svc="http://blogsvc.net/2008/Service" xmlns:file="http://blogsvc.net/2008/File" 
         xml:base="http://atomserver.net/" svc:wizard="false" svc:type="multiFolder">
  <svc:admin>
    <atom:name>Admin</atom:name>
    <atom:email>admin@example.com</atom:email>
    <atom:uri>http://localhost:1333/</atom:uri>
  </svc:admin>
  <workspace svc:name="test" svc:theme="hibiscus" svc:openIdOn="true">
    <atom:title>test.example.com</atom:title>
    <atom:subtitle>The life and times of a blogger.</atom:subtitle>
    <collection href="test/blog.atom" svc:default="true"
     svc:atomPubServicet="AtomServer.Services.BlogAtomPubService, AtomServer.Services"
     svc:annotateService="AtomServer.Services.BlogAnnotateService, AtomServer.Services"
     svc:routeService="AtomServer.Services.BlogRouteService, AtomServer.Services">
      <atom:title>My Super Test Blog</atom:title>
      <atom:id>tag:test.example.com,2008:blog</atom:id>
    </collection>
  </workspace>
  <workspace svc:default="true" svc:theme="default" svc:openIdOn="true">
    <atom:title>example.com</atom:title>
    <atom:subtitle>The life and times of a blogger.</atom:subtitle>
    <collection href="www/blog.atom" svc:default="true"
     svc:atomPubService="AtomServer.Services.BlogAtomPubService, AtomServer.Services" 
     svc:annotateService="AtomServer.Services.BlogAnnotateService, AtomServer.Services"
     svc:routeService="AtomServer.Services.BlogRouteService, AtomServer.Services">
      <!-- BlogSvc supports many of the same fields for a collection as specified for 
a feed.  These fields will automatically get inherited by the feed. -->
      <atom:title>My Super Blog</atom:title>
      <atom:id>tag:example.com,2008:blog</atom:id>
Feb 8, 2009 at 9:07 PM
Looks great Jarrett! How are the Collections modifications coming along?
Feb 9, 2009 at 6:33 AM
I believe it is finished (at least for version 0.9).  It supports plugins of the following types:

        //plugin all the types into the object factory
        x.Scan((scanner) =>
        {
          scanner.AssembliesFromPath(Server.MapPath("~/bin/"));
          scanner.AddAllTypesOf<ILogService>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IController>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IRouteService>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IUserRepository>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IAppServiceRepository>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IAtomEntryRepository>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IMediaRepository>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IAppCategoriesRepository>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IAuthorizeService>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IAtomPubService>().NameBy((t) => t.Name);
          scanner.AddAllTypesOf<IAnnotateService>().NameBy((t) => t.Name);
         });

There is special support for plugins of type IAtomPubService, IAnnotateService, and IRouteService for the collection plugins.  I'm on to testing for release 0.9 now.