Posts Tagged ‘render:logdep’


Many a times, at the time of creating a CSElement or a Template, you might have seen a tag render:logdep which Content Server automatically includes for you.

We will now see what is the significance of that tag.

Firstly before learning about this tag, and its significance, make sure that you read about the Compositional Dependency.

Compositional dependency is the dependency between the asset and the page in which it is being rendered. These dependencies are automatically logged when we use certain tags like asset:load, assetset tags, etc.

But, when we don’t those tags in our code, then how will the compositional dependency be logged?

If we don’t use such tags which log automatically dependencies, then it is our duty to log the compositional dependency.

Examples of such scenarios:

Scenario 1:

In my code, I have a template called SampleTemplate. From that SampleTemplate, I’m going to call a CSElement named SampleElement, to render some things. In such case, I will call the render:callelement as follows.

// SampleTemplate code goes here
….
<render:callelement name=MySite/Common/SampleElement/>
…..
// SampleTemplate code goes here

In the above scenario, how will the compositional dependency between the CSElement asset and the page that it renders will be executed? It won’t be logged, as we haven’t used any asset:load tags, etc.

Scenario 2:

We are loading an asset using asset:load, and then without loading its children assets, we are getting the children’s info using asset:children. Under such circumstances, the compositional dependency is not logged between these assets and the page that is rendering these assets.

In both the above scenarios, its our responsibility to log the dependency.

Under such circumstances, the render:logdep tag is useful to log the COMPOSITIONAL DEPENDENCIES between the assets and the page that renders the asset.

If it is a CSElement , its syntax would be <render:logdep cid=”Variables.eid” c=”CSElement”/>

If it is a Template, its syntax would be <render:logdep cid=”Variables.tid” c=”Template”/>

Advertisements

Dependencies:

We have two types of dependencies in Fatwire / Oracle WebCenter Sites:

1.Approval Dependency :  This is the dependency that is logged when an asset is approved for publish. When you approve your asset for publishing, the Approval dependency is logged. This dependency is between the asset that is being approved and its dependent (child) assets. This dependency will verify whether the asset that is being approved can be published to the target machine or not. If there are dependent assets, that need to be approved, then this asset cannot be published.

The Approval dependency is logged when the asset is approved for publish.

2. Compositional Dependency : This can be called as Page Composition Dependencies. As the name itself specifies, it is the dependency between the asset and the  pages / pagelets that are rendering this asset. This dependency determines whether the page needs to be regenerated, in case when assets are modified.

The CS logs compositional dependencies when it renders the pages.  On the other hand, the CacheManager checks the dependency log, whether to regenerate any pages, whose content has been outdated.

How Approval dependencies are logged?

The dependencies are logged based on the type of publishing methodology.

Export To Disk :  If the publishing methodology is Export to Disk, the dependencies are calculated basing on the tags that are present in the code of the template that renders the asset.

Mirror To Server : If the publishing methodology is Mirror to Server, the dependencies are calculate basing on the Family Relationships (for Flex Assets )  / Associations (for Basic Assets) between the assets. Both these type of relationships create approval dependencies.

Types of Approval Dependencies:

The Approval dependency type for CSElements and SiteEntry assets, embedded links and pagelets cant be changed. The approval dependency type for the flex family asset types also can’t be changed. The approval dependency of basic asset types can be modified. We set the type of approval dependency for their associated assets when you configure the associations.

Approval dependency can be of three types:

  1. Exists: If this dependency is selected, then the dependent assets (child asset) must just exist on the target machine, and the version number of the child asset doesn’t matter, as long as the child asset is approved and published to the same machine. This means that the asset that is approved (parent asset) can be published even if the child assets changes (in version, content, etc) between source and target machines.
  2. Exact: If this dependency is selected, then the dependent asset must be of the same and exact version on the target machine. The parent asset can’t be published, if the versions of parent and child assets on the source machine do not match the versions of parent and child assets on the target machine.
  3. None: If this dependency is selected, then the approved asset can be published to the target machine, without bothering about the version / state of the dependent assets.
How Compositional Dependencies are logged?

Compositional dependencies are recorded in different ways. There are several tags that log compositional dependencies.

When Content Server executes an asset:load tag, it automatically logs a compositional dependency for the asset that is loaded, and the page that is going to be rendered

Similarly, assetset:setasset, assetset:setsearchedassets, assetset:setlistedassets tags render compositional dependency. When an asset from the assetset is rendered, the compositional dependency is logged.

When these tags are executed, Content Server logs a dependency between the rendered page and the asset by writing this information in the SystemItemCache table.


IMPORTANT TAGS IN FATWIRE (Continuation):

In this article, we are going to discuss the TAGS  IN FATWIRE THAT LOG DEPENDENCIES The following are the tags that log dependencies.

The render:logdep Tag:

This is the most common tag, that every Fatwire programmer knows. This tag is used in situations, in which your code can obtain an asset’s data without actually loading the asset.In such a case, be sure to log the compositional dependency yourself with the render:logdep tag. According to the Developer’s guide, “Use the RENDER.LOGDEP tag if your template uses tags that obtain an asset’s data without loading the asset, such as ASSET.CHILDREN.”

At the beginning of the element for each CSElement asset, you include the following line of code:
<render:logdep cid=”Variables.eid” c=”CSElement”/>

At the beginning of the element for a Template asset, the render.logdep statement would be as follows:
<render:logdep cid=”Variables.tid” c=”template”/>

When you try to create a Template or a CSElement, Content Server automatically includes an appropriate render:logdep statement in the code.

The following is the syntax for logdep:

JSP Syntax:

<render:logdep asset=”asset name” cid=”asset id” c=”asset type”/>

XML Syntax:

<RENDER.LOGDEP ASSET=”asset name” CID=”asset id” C=”asset type”/>

The render:unknowndeps Tag:

Use the <render:unknowndeps/> tag when there are dependent assets but that there is no way to predict the identities of those assets because they came from a query or change frequently. You use this tag to cover those coding situations in which you truly cannot determine what the dependent assets might be.

When a compositional dependency is set to “unknown,” it means the page must be regenerated during each Export to Disk publishing session and updated in the page caches after each Mirror to Server publishing session, whether it needs it or not. This tag causes the page or pagelet to be regenerated at every publish because the dependencies cannot be determined. This means that you should use this tag sparingly.

This tag logs a compositional dependency of “unknown” for the rendered page.

The following is the syntax for logdep:

JSP Syntax:

<render:unknowndeps/>

XML Syntax:

<RENDER.UNKNOWNDEPS/>

You must use this tag carefully because the more pages that must be regenerated, the longer it takes to publish your site.