Hi,
You can use the content:formContentMapperHandler tag. Here is a basic example of template.
For the API, please chek the java tag source.
Cheers,
Philippe.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="contentLib" prefix="content" %>
<%@ taglib uri="/WEB-INF/etc/struts/struts-bean" prefix="bean" %>
<%@ taglib uri="/WEB-INF/etc/struts/struts-logic" prefix="logic" %>
<%@ taglib uri="JahiaLib" prefix="jahia" %>
<jahia:i18n />
<content:declareContainerList name="testContainer" title="Content Container">
<content:declareContainer>
<content:declareField name="title" title="Title" type="SmallText" />
<content:declareField name="content" title="Content" type="BigText" />
</content:declareContainer>
</content:declareContainerList>
<title>Add container with form</title> </head> <body>
<h1>Add container with form</h1>
<content:containerList name="testContainer" id="testContainerList">
<content:formContentMapperHandler listName="testContainerList" submitMarker="submit" />
<logic:present parameter="submit">
<!-- this is required because we want to see the changes immediately
and also make sure we never post twice when the user does a page
reload. Also this should always be after the formContentMapperHandler tag
to make sure the processing was completed before redirecting.
-->
<script language="javascript">
window.location.href = '/jahia/Jahia/cache/offonce/lang/en/pid/2/op/edit/template/addContainerWithForm.jsp';
</script>
</logic:present>
<content:container id="testContainer">
<h2><content:textField name="title" defaultValue=""/></h2>
<content:bigTextField name="content" defaultValue=""/>
<br/>
</content:container>
<hr/>
<form action="/jahia/Jahia/cache/offonce/lang/en/pid/2/op/edit/template/addContainerWithForm.jsp" name="submitToContainerList" method="post">
<input type="text" name="title"><br/>
<textarea name="content"></textarea><br/>
<input type="submit" name="submit" value="Submit">
</form>
</content:containerList>
</body>
</html>
At 30.11.2004 17:11, you wrote:
Hello,
I would like to know what are the method to use to create a Container List , a
Container and some fields attached to the Container without the admin
interface.
I think I have to use some Methods like :
ServicesRegistry.getInstance().getJahiaFieldService().createJahiaField(...)
ServicesRegistry.getInstance().getJahiaContainersService().saveContainer(...)
and ServicesRegistry.getInstance().getJahiaContainersService ().saveContainerListInfo(...)
But I don't know in which order I have to use and if those three method are
enough to save the ContainerList, the Containers and the Fields into the Jahia
Database.
Moreover in the createJahiaField method there is no argument about the field
name. I am maybe not on the right way to do what I wanna do.
If someone could give me one example or the list of the rights method to use,
i would be very pleased.
Thanks
-------=[ pvollenweider at jahia dot com ]=--------- Jahia : A collaborative source CMS and Portal Server www.jahia.org Community and product web site www.jahia.com Commercial services company
