Details
-
Bug
-
Resolution: Inactive
-
Major
-
WCM 5.0 SP3
-
None
-
Dev: Windows, JVM 1.5.0, Jahia 5.0.4, HSQLDB
Test: Unix, JVM 1.5, Jahia 5.0.4, Oracle 9i
-
import export single mandatory SINGLE_MANDATORY engine absolute container absoluteContainer absoluteContainerList
Description
We use an absoluteContainerList with SINGLE_MANDATORY attribute to store the siteSettings.
This containerList is called on each page.
- This runs perfectly on DEV env.
- We export the website (complete export via administration)
- Information: The absoluteContainerList stored on the homepage is the very last part of the export xml file
- We import the website (we don't navigate on the website until the end of the import)
- The absoluteContainerList is present (We check using API), but a blank container is created in position 1 and our values from the import are in position 2.
- html:actionMenu tag run for siteSettingsContainerList but none of both conainer display the actionMenu tag.
- content tags doesn't find any container in the containerList.
- if we remove the SINGLE_MANDATORY attribute, we see the "Add" option on the siteSettingsContainerList actionMenu tag and we can see in the engine that there is already the two container (one empty and one with our data).
Here is the declaration of the container:
<%@ page language="java" %>
<content:declareContainerList name="siteSettingsContainer" bundleKey='REFIN' titleKey='siteSettingsContainerTitle' containerListType="<%=JahiaContainerDefinition.SINGLE_TYPE%>">
<content:declareContainer>
<content:declareField name="webmasterEmail" type="SharedSmallText" bundleKey='REFIN' titleKey='webmasterEmail'/>
<content:declareField name="searchMaxResultPerPage" type="Integer" bundleKey='REFIN' titleKey='searchMaxResultPerPage'/>
<content:declareField name="searchMaxPageInIndex" type="Integer" bundleKey='REFIN' titleKey='searchMaxPageInIndex'/>
</content:declareContainer>
</content:declareContainerList>
And the usage:
<content:absoluteContainerList pageLevel="1" name="siteSettingsContainer" id="siteSettingsContainerList">
<content:container id="siteSettingsContainer">
<bean:define id="webmasterEmail" name="siteSettingsContainer" property='<%="field(webmasterEmail).value"%>'/>
<bean:define id="searchMaxResultPerPage" name="siteSettingsContainer" property='<%="field(searchMaxResultPerPage).value"%>'/>
<bean:define id="searchMaxPageInIndex" name="siteSettingsContainer" property='<%="field(searchMaxPageInIndex).value"%>'/>
</content:container>
</content:absoluteContainerList>
We can check the presence of both container in the containerList using the code:
try {
Enumeration ssContainers = null;
JahiaContainerList ssContainerList = jData.containers().getAbsoluteContainerList("siteSettingsContainer", jData.getProcessingContext().getSite().getHomePage().getID());
if(ssContainerList != null) {
ssContainers = ssContainerList.getContainers();
out.println("FULLSIZE: " + ssContainerList.getFullSize());
boolean dataFound = false;
while(ssContainers.hasMoreElements() && !dataFound) {
try {
JahiaContainer ssContainer = (JahiaContainer)ssContainers.nextElement();
if(ssContainer.getField("webmasterEmail") != null && ssContainer.getField("webmasterEmail").getValue() != null && !"".equals(ssContainer.getField("webmasterEmail").getValue()))
else
{ out.println("PAS TROUVE"); }} catch(Exception e)
{ e.printStackTrace(); } }
out.println("FIN");
}
} catch(Exception e)
Possible problem:
-Jahia seems to execute an http request on a page when he finish the import on it. Does it finish the import of the homepage before calling any page ?
-Bug in the import process
-Bug in the actionMenu / content tags.