Layered folders

Large enterprises usually run global operations. In order to have effective services, sales and marketing, they usually have many regional websites. Most often the information in these websites is 80 percent common (global) and 20 percent different (local). However, enterprises end up replicating or duplicating the 80 percent of such common information in each and every regional website.

Let's consider a scenario where an enterprise is having two websites, one for USA-based customers and the other one for UK-based customers with the pages and files as shown in the following image:

Layered folders

In order to make the USA website contents of the /Images and /Products directories on the UK website, you would have two options:

  • Option 1 is to make a separate copy for the UK website. It means a specific file has two different copies. The issue with this approach is that if the USA website updates an image (say product1.jpg), then those updates are not applied on the UK website. You need to make sure you update those changes on the UK website as well. If the size of the website is large with hundreds and thousands of files and pages, then it will be very expensive to maintain two copies of the files.
  • Option 2 is to make a symbolic link of the USA website for UK. Now any updates done on the USA website are seen on the UK website as well. It is like an alias or a Unix-style symbolic link. The advantage of this approach is that there is only one copy of files to manage, which is easier. This issue with this approach is that if the UK website needs to make a few changes to a page (say product2.html), then it is not possible.

Alfresco WCM provides a strong feature called Transparent Folder where it is possible to have both option 1 and 2. You can have only one copy of the files to maintain globally and also have the flexibility to update a few of them locally.

For example, consider that the UK website uses Images and Products as two transparent folders from the USA website. It means that the USA website has the master copy (only one copy) and the UK website has symbolic links to those folders.

Now any updates done in the USA website will automatically be seen on the UK website. Say you updated product1.jpg on the USA website, then the changes are seen on the UK website.

If you make any modifications to the files on the UK website, then a separate copy of that file alone will be created on the UK website. For example, if you update product2.html on the UK website, then a separate copy is made for that file for the UK website. From this point onwards, there will be two separate copies of the product2.html file with different versions and content in these two websites.

Creating a transparent folder

Let's create a web project with a few folders and files.

  1. Create a web project called USA Web Site.
  2. Go to User Sandbox and create folders called Images and Products.
  3. In the Images folder, add two images (say product1.jpg and product2.jpg).
  4. In the Products folder, add two HTML pages (say product1.html and product2.html).
  5. Submit all of these files and folders to the Staging Sandbox.
  6. Browse the Staging Sandbox to view these folders and files.
    Creating a transparent folder

Now create another web project called UK Web Site. Do not create any folders or files in UK Web Site. Go to the Staging Sandbox of the UK Web Site and click on the Create Layered Folder link as shown in the following screenshot:

Creating a transparent folder

You can create a layered folder using a target folder from a target web project. Create the Images folder in the UK Web Site, using the Images target folder from the USA Web Site target web project as shown in the following screenshot:

Creating a transparent folder

Note

It is not mandatory to use the same name for the layered folder as the target folder name.

You can use any name for the folder in the UK Web Site. It is not mandatory to use "Images" as folder name in the UK Web Site. However, to maintain simplicity and to avoid naming conflicts, it is advised to use the same folder names.

Similarly, you can link to any number of web projects and folders. For example, you can use the "Images" folder from the USA Web Site and "Videos" folder from the Germany website and so on.

You will notice that a new folder called Images is created in the UK Web Site with the Type specified as Layered Folder as shown in the following screenshot. Click on the Images folder and notice two images. These were the images that were created in the USA Web Site and are automatically available to the UK Web Site due to layered folder.

Creating a transparent folder

Similarly, create a transparent folder for the "Products" folder. Now you will notice two transparent folders in UK Web Site.

Updating a source file

Updating the file in USA Web Site will automatically update the file in UK Web Site.

Browse to USA Web Site | User Sandbox | Images and update the product1.jpg file. Submit the changes to the Staging Sandbox. Notice the timestamp of the file and also the versions as shown in the following screenshot.

Updating a source file

Now browse to the UK Web Site and notice that the image is updated automatically including the versions as shown in the next screenshot. Basically, the image is not updated; we are seeing the same image information through the link.

Updating a source file

If a file is deleted in the source web project, the file will automatically be removed from the web projects where the parent folder is used as a layered folder.

Updating the destination file

If you make any modifications to the files in layered folder, then a separate copy of that file alone will be created. From that point onwards, they are considered as two different files.

Refer to the following screenshot. For example, if you update product1.jpg on the USA Web Site, then a separate copy is made in the UK Web Site. From this point onwards, there will be two separate copies of the product1.jpg file with different versions and content on these two websites.

Updating the destination file

Deleting files

If you delete a file from the source, then the file will automatically be deleted on all of the destinations. For example, if you delete a file product1.html in USA Web Site, then the file will automatically be removed from UK Web Site as well.

Deleting files

On the other hand, if you remove product2.html from UK Web Site, then it is considered as a separate copy and the original file in source location (USA Web Site) will not be deleted.

Adding new files

If you add a file in a source, then the file will automatically be added in all the destinations. For example, if you add a file product3.html in USA Web Site, then the file will automatically be added to UK Web Site.

Adding new files

On the other hand, if you add product4.html in UK Web Site, then it is considered as a new addition only in the UK Web Site.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset