[ 93 ]Listing User Sandboxes On clicking on the web project, the sandbox view appears displaying the Staging and User Sandboxes.. By default, only the Staging Sandbox and the User Sandbo
Trang 1[ 92 ]
4 Click on Preview Website to view the website.
5 In the browser the website will appear as follows:
The code bundle for the corresponding files is available as a downloadable for this chapter
Download from Wow! eBook <www.wowebook.com>
Trang 2[ 93 ]
Listing User Sandboxes
On clicking on the web project, the sandbox view appears displaying the Staging and User Sandboxes Each User Sandbox contains the existing web project content
The sandbox labeled My Sandbox belongs to the currently logged in user (in this
case, the administrator) As the administrator, you have access to the sandboxes of all users associated with the web project
By default, only the Staging Sandbox and the User Sandbox display; however, you
can select the Show All Sandboxes option in this view to display all the sandboxes
available to you, as shown in the following screenshot:
Download from Wow! eBook <www.wowebook.com>
Trang 3[ 94 ]
Refresh your browser page to view all the User Sandboxes if the browser is not refreshed automatically
You cannot add the content directly to the Staging Sandbox Here is the process you need to follow in order to create the content
1 Create content in your User Sandbox either by uploading the files or using bulk import feature
2 Preview the content to ensure the accuracy
3 Optionally verify the broken links using the links checker
4 Submit the approved content to the Staging Sandbox
5 Deploy the content from Staging Sandbox to external servers using the filesystem deployer
Add content to the web project
There are multiple methods of adding and creating content for a web project In addition to creating web content within a project, you can also upload individual files from your computer or perform a bulk import of a ZIP file with web project contents as shown in the following screenshot:
When you install WCM, you will also get sample files to create web projects Refer to the file alfresco-sample-website.war, which is provided as a default example in the Alfresco bundle, from c:\alfresco\extras\wcm
Download from Wow! eBook <www.wowebook.com>
Trang 4[ 95 ]
To bulk import content of this file, select Bulk Import in the Create menu Use the
Browse button to locate and upload the alfresco-sample-website.war file Once
uploaded, click on OK to begin the import.
The war file, which you imported into the current directory (the ROOT webapp), appears in expanded form in your User Sandbox
If you don't have the sample war file, then add few sample files to your User
Sandbox from your local computer using the Add Content option In the Alfresco
WCM, a lock is automatically placed on content items created, imported, modified,
or deleted, in order to prevent editing clashes In our sandbox, notice that all of the items (not folders) currently display a padlock icon with a key ( ) This indicates that you own the lock and can perform actions on the content A lock owned by another user appears as a plain padlock ( ) You can position the mouse cursor over the icon to display a tooltip indicating the lock owner
Click on Preview Website in the sandbox header to see the website in its current state.
The preview window displays how the website or web application will look with the
submitted User Sandbox content Click on About us and then on News to display the empty Alfresco Press Releases page You will come back to this again later once
you have added some content
Close the preview and return to User Sandbox Click on Project Name in the
breadcrumb path to return to the sandbox view
Submit content to the Staging Sandbox
At this point, the web project is populated with content items, some imported
and some created, some submitted and some not You must now deal with the submission of the remaining items to staging
Download from Wow! eBook <www.wowebook.com>
Trang 5[ 96 ]
In the User Sandbox, expand the Modified Items list to display the imported content.
Click on Submit All and, on the Submit Items page, provide the information that
will display as the name and description of the corresponding snapshot in staging:
Label: Initial Import
Description: Sample Website
Download from Wow! eBook <www.wowebook.com>
Trang 6[ 97 ]
Click on OK The submission takes place in the background and each content item remains in the Modified Items list until its submission is complete.
Refresh the page as necessary until the Modified Items list is empty In the Staging Sandbox, expand the Recent Snapshots list to view the snapshot you have created as
shown in the following screenshot:
Filesystem projection
The AVM repository and its virtual stores are made available by projection
through CIFS
To mount the CIFS directory in Windows Server/XP, follow these steps:
1 Open up Windows Explorer
2 Under the Tools menu, Select Map Network Drive….
3 Select an available drive letter Example: Z:.
Download from Wow! eBook <www.wowebook.com>
Trang 7[ 98 ]
4 For Folder enter the CIFS server name Example:
\\<your_server_name>A\AVM
Windows will open the mapped drive and you should see something similar to the following that includes the current web projects:
AVM CIFS projection provides:
• Access to all available sandboxes (Read/Write)
• Access to all available layers (Preview)
• Access to all snapshots in read-only mode under top-level Versions Directory
• Access to all file metadata under top-level METADATA directory
• Mounting of AVM virtual store "docroots" to test servers
Download from Wow! eBook <www.wowebook.com>
Trang 8[ 99 ]
Bulk loading of content XML files and previously rendered files (HTML, XML, and RSS feeds) will not recreate mapping between source file -> rendering template -> output file This is also the case for bulk uploads into a web project
There is a Web Projects tool on the Alfresco Forge, but it is for Version 2.2 These tools provided import and export features, and re-association of renditions with content and templates, among others
Virtualization server
A Virtualization server is a customized version of Tomcat that treats each User Sandbox, Staging Sandbox, and workflow instance as a separate Tomcat web
application It understands an "overloaded" hostname format that allows it to map requests to specific sandboxes These "overloaded" hostnames use wildcard DNS entries to map all request to the same Alfresco Virtualization server
Configuring the virtual server for preview
The configuration files for the virtual server can be found in the <alfresco home>/ virtual-tomcat/conf directory To enable previews on a development machine, you need to modify the alfrescovirtserver.properties file to utilize the Alfresco wildcard DNS service The alfresco.virtserv.domain value needs to be updated
to replace 127-0-0-1 with the IP of the Alfresco local machine, substituting all "." with dashes:
# Alfresco's free/public wildcard domain service ("EchoDNS")
# returns resource records with a TTL of 1 day Therefore,
# the run-time overhead is quite minimal Once the machine
# has done a name lookup, it will cache the result for the
# next 24 hours (or until you reboot).
#
alfresco.virtserver.domain=127-0-0-1.ip.alfrescodemo.net
If the IP of the Alfresco machine is 192.168.1.25, update alfresco.virtserver domain to alfresco.virtserver.domain=192-168-1-25.ip.alfrescodemo.net Alfresco Virtual Server needs to be restarted at this point
Virtualization URL format
The general format for Alfresco virtual hyperlink is:
http://virtual-hostname.www sandbox.virtualization-domain:port/ request-path
Download from Wow! eBook <www.wowebook.com>
Trang 9[ 100 ]
where the virtual-hostname is defined as the DNS name when creating a web project, and the virtualization-domain is the wildcarded domain name entry that maps to the Alfresco Virtualization Server The default port for a virtualization server is 8180 Given that a web project was created with "test" as the DNS name, (*.virtualserver.unico.com is a DNS entry for Virtualization Server) and is installed on the default port, the following are true:
• http://unicom.www sandbox.virtualserver.unico.com:8180/ is the preview of the Unicom web project for the Staging Sandbox
• http://admin.unicom.www sandbox.virtualserver.unico.com:8180/
is the preview of the root of the Unicom web project for the admin user's sandbox
• http://jsmith.unicom.www sandbox.virtualserver.unico.com:8180/ index.html is the preview of the file /index.html of the web project in the jsmith user's sandbox There are variations of this for previewing new content before the initial persistence and previews for items within
a workflow
Virtualization server access to the User
Sandbox
The AVM repository and its virtual stores are mapped into the virtual Tomcat working directory:
$VIRTUAL_TOMCAT_HOME/work/Catalina/avm.alfresco.localhost/
This working directory will contain directories like the following, which are similar
to the naming CIFS convention for virtual stores:
TABLE[
$-1$mysite admin preview$ROOT/ $-1$silly admin preview$ROOT/
$-1$mysite admin$ROOT/ $-1$silly admin$ROOT/
$-1$mysite alice preview$ROOT/ $-1$silly alice preview$ROOT/
$-1$mysite alice$ROOT/ $-1$silly alice$ROOT/
$-1$mysite bob preview$ROOT/ $-1$silly preview$ROOT/
$-1$mysite bob$ROOT/ $-1$silly-$ROOT/
$-1$mysite preview$ROOT/ host-manager/
$-1$mysite$ROOT/ manager/
$42$mysite$ROOT/]
Download from Wow! eBook <www.wowebook.com>
Trang 10[ 101 ]
Virtual server configuration
Configure the virtual server to allow the previewing of content and review some
of the content in the CIGNEX web project in the user's sandbox Once you are
satisfied that the preview is working, submit the whole project to staging After the submission is complete, preview the website in the Staging Sandbox
1 Determine the current IP of the Alfresco machine using one of the following:
° Windows—open CMD prompt and run the ipconfig command
° Unix(s)—open terminal and run ipconfig -a
2 Open the virtserver.properties file found in the <alfresco home>/ virtual-tomcat/conf directory
c:\Alfresco\virtual-tomcat\conf\virtserver.properties
3 Modify the following line to use the IP found in step one, replacing
all "." with "-" :
alfresco.virtserver.domain=127-0-0-1.ip.alfrescodemo.net
For IP of 192.168.1.100 the line would be:
alfresco.virtserver.domain=192-168-1-100.ip.alfrescodemo.net
4 Save and exit the file
5 Start or restart the Virtual Server
6 Test previewing the file in the user's sandbox
Click on Submit All to send all files to the staging environment Test preview in the
Staging Sandbox Previewing in the User and Staging Sandboxes should work
Dynamic websites using WCM
A web project it not limited to just static files Web projects can include server-side scripting files including JSP, PHP, CF, or Python files In the end, these files would
be published to the appropriate application server or web server enabled to evaluate these files Specifically for Java, Alfresco supports the evaluation of JSPs and exploded WARs within a web project with support for preview of JSPs by the Virtual Server You could upload archived WARs, have Alfresco deploy them to a web application server for unpacking, and so on For Tomcat, it could place them in the
webapps directory
Download from Wow! eBook <www.wowebook.com>