Fred,Thanks again for all your great input.I'd like to help figure out exactly what can be done to help you priorto the upcoming release with the built-in deployment stuff.As you said, the CIFS projection of the AVM lets you deploy content usingpretty much anything you want (personally, I like to use rsync over ssh).If you just want to deploy some files from one place to another, what isthe problem you're encountering? When I rsync from Alfresco's CIFS projection to a remote file system, it works quite well – even for large sites. The first version of our built-in deployment will be will be able totake advantage of history information (and deal with meta info nicely),but there are *lots* of bells & whistles we plan to add later. I want tobe certain that the "core" features in our first release meet your needs,so if you can elaborate here, it would be very helpful.I would like to somehow move the functionality of the [deployment]
ant script into Alfresco. Perhaps a custom action of some sort?
Built-in deployment has been under very active development & willbe available quite soon (weeks, not months).The multiple virtual sites, via sandboxes, is very powerful,
but it appears that I can't use that without adopting virtualization
and alfresco as the delivery engine?
The virtualization server is virtualizing the contents of the AVM itself.The major components of Alfresco are:- DM repository (used for document management)
- AVM repository (used for WCM currently, but may take over completely)
- Alfresco webapp (the GUI for creating & manipulating content)
- The virtualization server (creates a virtual view of *your* webapp/website)
The virtualization server is a modified version of Tomcat that knows howto use interpret the area-izing information embedded within a URL( *.www–sandbox.*:8180/…), and fetch data via AVMRemote. It alsodoes some fancy footwork with classloaders to allow many users to havewhat appears to be a separate version of your webapp in the "staging"area, and yet still share the jar files they have in common, when possible(this allows the system to scale).Whether you fetch data via the CIFS projection of the AVM repository,or if you use AVMRemote (like the virtualization server does via itsbuilt-in JNDI binding), you're still accessing the AVM. Both end up usingAVMRemote behind the scenes to fetch the data being presented.Incidentally, the virualization server does not require the CIFS projectionto work for webapps that don't make use of the servlet method getRealPath(). However, if a webapp *does* call getRealPath(),then so long as you've mounted CIFS where you've said you willwithin $VIRTUAL_TOMCAT_HOME/conf/alfresco-virtserver.properties,then the JNDI names will coincide with the file system names; thuseven AVM-unaware code will work too. Put differently, the fact that the virtualization server requires the AVMis inherent in the fact that the core feature of the virtualization serveris to display the contents *of* the AVM. On the other hand, the factthat the AVM is bound to the same process as the Alfresco webappis just an artifact of its current implementation. Some day, the AVM may be in a different process (and/or on a different host) than the one running the Alfresco webapp.(Though I do remember one note somewhere about virtualization working
with any "well behaved" java technology).
There are some limits to what can be virtualized; for example, if youhave a singleton of any sort (not just a java singleton), then it will beshared by all virtual webapps based off of the project's staging webapp.For example, suppose your webapp writes to a database table.If users Alice and Bob are are viewing their "separate" virtualizedinstances of the webapp within their own sandboxes, and Alice doessomething that makes this webapp modify the 'moo' table, then Bobwill see the change Alice has made to the 'moo' table immediately.In other words, the virtualization server can virtualize files butcan't magically restructure arbitrary hard-coded programs.As described above, I can't use all of the cleverness of xforms without
the virtualization server, right? (I still don't understand that one!)
You can use the data generated by XForms, and the files derived fromthem (e.g.: templatized output files) by simply deploying them toa native file system. From there, any webserver will just be able toserve them up as ordinary files … because that's exactly what they'll be.But what I can do, it seems, is use xforms to capture XML, and, once
captured, use external techniques to process that XML in various ways.
Exactly.Again, a key enabler is the CIFS mount, which, from what I can
tell, works in 2.0 as well, with the benefit of presenting all of the
sandboxes. So once again, I can have the best of both worlds, without
adopting alfresco as the delivery engine.
With the stuff coming in 2.0.1, you won't even need CIFS for deployment.When you talk about the Alfresco "delivery engine", I think what youprobably mean is "repository". By the way, for the fun of it, you mightwant to try comparing the speed of a vanilla tomcat instance fetching data from a native file system to the virtualization server fetching datafrom the AVM. In most cases, there isn't a heck of a lot of difference.When doing a bunch of tests a while back, I was very pleasantly surprised.Of course, I might not want to use a setup like this for the splash pageof a super high volume website, but then if you slapped a cache in frontof it, it would probably be just fine for that as well. Food for thought.Another amusing experiment I did was set the docroot of an Apache 2.xinstance to be the /www/avm_webapps directory of the staging areaof a web project using the CIFS projection. This also worked much betterthan I'd anticipated. The CIFS projection of AVM contents is quite fast(much faster than the CIFS projection of the older DM repository's data).Some time soon, I'll take a crack at making a virtualized version ofApache 2.x, so we can have a full Apache/Tomcat stack (and maybe evendeal with PHP). My first priority is creating infrastructure for link checkingat submit/update time, but after that I think I'm going to have a look at this.But what I think I'm seeing is that as long as my production environment
is something other than alfresco, the virtualization server can NOT be
used to preview my site.
The virtualization server's job is to allow data within certain portions ofthe AVM repository to be interpreted as a set of virtual webapps. Suppose that you have a production environment that wishes to access some datafrom the native file system, and other data from the AVM. Nothingprevents you from doing this – it's not an "all or nothing" choice.There are at least three ways you could proceed: [1] Invoke AVMRemote APIs directly, where ever you wish.[2] Make portions of your site act as a reverse proxy to the virt server[3] Make portions of your site access AVM content via CIFSSo, somewhere in the content freemarker template, I have something like
${quote.todaysQuote}
The quote bean is in my world (struts2), and not in Alfresco's.
I can still use Alfresco to manage the template that contains
the above snippet, but there's no way the virtualization server is ever
going to be able to preview that page, right?
It sure could.As long as the webapp you are virtualizing contains the jar filereferenced by your function in its WEB-INF/lib dir, then thisbecomes logic internal to your webapp. Think of it this way:the virtualization server just provides a framework for automaticallyvirtualizing AVM content & serving it up (after all, it's just Tomcat witha bunch of classes replaced to handle AVMRemote calls, bootstrapping,webapp notifications, and some extra tap dancing to make it all scale).Thus, if you can write a webapp to do something, the virtualization server can (in most cases) just server it up for you. To do this,you've got to configure *your* webapp with the proper libraries….but then this is no different from what you'd expect from *any* webappwhether served via the virtualization server, or a "vanilla" Tomcat.What IS the virtualization server doing, anyway?
Suppose you have a web project named "mysite",and two users: Alice and Bob. Within Alice's sandbox, the "eyeball"icon will have URLs for Alice of the form:http://alice.mysite.www--sandbox.<virtualization-domain>:8180/…
The "eyeball" icon will create URLs for Bob like this:http://bob.mysite.www--sandbox.<virtualization-domain>:8180/…
Let's say your virtualization server is sitting on IP address 192.168.1.5,and that you're using the EchoDNS server at ip.alfrescodemo.net to deal with DNS wildcards. Therefore, *.192-168-1-5.ip.alfrescodemo.netwill be resolved as the IP address 192.168.1.5. Consequently, thefollowing URL will resolve to 192.168.1.5 (on port 8180): http://alice.mysite.www--sandbox.192-168-1-5.ip.alfrescodemo.net:8180/…
Note that the same is true of the following url for Bob:http://bob.mysite.www--sandbox.192-168-1-5.ip.alfrescodemo.net:8180/…
The wiki page entitled Configuring the Virtualization Server covers this in greater detail.In any event, using the area info embedded into the "virtual host name"the virtualization server is able to figure out the associated AVM repositoryand area-ize the request path accordingly when it makes calls to AVMRemote behind the scenes. There's a lot of other stuff going ontoo, like how it knows when to reload a webapp, how it maps betweenJNDI/webapp/CIFS/URL namespaces, and so on… but you get the gist(I hope). The virtual server logs give me the impression that there's some RMI
going on, which makes sense. So I'm guessing that the virtualization
server just decodes the URL and then requests the appropriate
documents from Alfresco. But there must be a fair amount of complexity
in there, right?
Interestingly, the amount of code involved is not that large, but in termsof how and why it is designed the way that it is.. yes, you're right. Many late nights went into thinking it all through, and making it actuallywork. I'm glad you're enjoying it & finding it useful. Cheers, -Jon