Generated file names

Related Topics ...

Setting Factory Properties

On some application servers, there is a length limit on path names (including the file name) of 255 characters. The Factory generates JSP files and Method classes based on the model name and any profiles applied to the model. In most cases, the file name lengths are well under 255 characters. However, when you use the model as a portlet in nested portals, the generated file could exceed the file length limitation.

To prevent the generation of file names that are too long, Factory converts the profile names to a unique ID. We can determine the file length at which the Factory converts the profile name portion of a generated file name to an ID by setting the bowstreet.profiles.maxKeyLength property in the WEB-INF/config/cluster.properties file. The default value for this property is 60.

The maxKeyLength does not refer to the length of the whole file name, just the length of the profile name portion of it. As a result, set the maxKeyLength low enough to account for the portlet name, model name, and any other parts of the path to the generated file.

For example, the class generated for a model named datatablepage that is used as a portlet in a nested portal could have the following file name:

dataviewportlet_main_external_partners_premium_techsource_personalizationroot_techuser_pressreleases_datatabletablepage.java

Factory checks the length of the profile names embedded in the name and if it exceeds the value of the maxKeyLength property (in this case, 60), it will convert them to an ID. The following would be the result of the previous example:

dataviewportlet_160568228_datatabletablepage.java