com.jurismarches.vradi.services.managers
Class FormTypeManager

java.lang.Object
  extended by com.jurismarches.vradi.services.managers.FormTypeManager

public class FormTypeManager
extends Object

Class containing the metods to manage the form types : - creation, update, retrieving - cache filling

Version:
$Revision: 1464 $ $Date: 2010-09-21 14:19:05 +0200 (mar., 21 sept. 2010) $
Author:
schorlet

Field Summary
static String TYPE_TEMPLATE
           
protected  org.nuiton.wikitty.WikittyProxy wikittyProxy
           
 
Constructor Summary
FormTypeManager(org.nuiton.wikitty.WikittyProxy wikittyProxy)
           
 
Method Summary
 org.nuiton.wikitty.WikittyExtension createFormType(String formTypeName)
          Create new form type.
 Map<String,String> getAssociatedFields(String extensionName, String templateName)
          Get association between template fields and extension fields.
 org.nuiton.wikitty.WikittyExtension getFormType(String name)
          Retrieves the form type whose name is the parameter 'name'
 Map<String,org.nuiton.wikitty.FieldType> getFormTypeFields(String name)
          Retrieves the fields of the form type whose name is the parameter 'name'
 String getFormTypeTemplateName(org.nuiton.wikitty.WikittyExtension extension)
           
 File getTemplate(String extensionName, String templateName)
           
 Collection<String> getTemplateFilenames(org.nuiton.wikitty.WikittyExtension extension)
          Get the template file names associated with the specified extension.
 File[] getTemplates(org.nuiton.wikitty.WikittyExtension extension)
          Deprecated. 
 boolean isFormTypeExists(String formTypeName)
          Check if a form type name already exists.
 void setAssociatedFields(String extensionName, String templateName, Map<String,String> fieldMap)
          Save association between template fields and user selected fields into external xml field next to template.
 org.nuiton.wikitty.WikittyExtension updateFormType(String name, Map<String,org.nuiton.wikitty.FieldType> fields, String requires, Map<String,String> tagValues)
          Updates the form type whose name is 'name'
 org.nuiton.wikitty.WikittyExtension updateFormType(org.nuiton.wikitty.WikittyExtension extension, String templateName)
          Update the form type given in parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_TEMPLATE

public static final String TYPE_TEMPLATE
See Also:
Constant Field Values

wikittyProxy

protected org.nuiton.wikitty.WikittyProxy wikittyProxy
Constructor Detail

FormTypeManager

public FormTypeManager(org.nuiton.wikitty.WikittyProxy wikittyProxy)
Method Detail

getFormType

public org.nuiton.wikitty.WikittyExtension getFormType(String name)
                                                throws VradiException
Retrieves the form type whose name is the parameter 'name'

Parameters:
name - the name of the form type we want to retrieve
Returns:
the form type whose name is the parameter
Throws:
VradiException

getFormTypeFields

public Map<String,org.nuiton.wikitty.FieldType> getFormTypeFields(String name)
                                                           throws VradiException
Retrieves the fields of the form type whose name is the parameter 'name'

Parameters:
name - the name of the form type we want to retrieve the fields
Returns:
a map containing the field names and their type
Throws:
VradiException

updateFormType

public org.nuiton.wikitty.WikittyExtension updateFormType(String name,
                                                          Map<String,org.nuiton.wikitty.FieldType> fields,
                                                          String requires,
                                                          Map<String,String> tagValues)
                                                   throws VradiException
Updates the form type whose name is 'name'

Parameters:
name - the name of the form type to update
fields - the new fields of the form type
requires - the new requires of the form type
tagValues - the new tag values of the form type
Returns:
the form type up to date
Throws:
VradiException

updateFormType

public org.nuiton.wikitty.WikittyExtension updateFormType(org.nuiton.wikitty.WikittyExtension extension,
                                                          String templateName)
                                                   throws VradiException
Update the form type given in parameter

Parameters:
extension - the form type to update
Returns:
the form type up to date
Throws:
VradiException

getTemplate

public File getTemplate(String extensionName,
                        String templateName)
Parameters:
extensionName -
templateName -
Returns:

getTemplates

@Deprecated
public File[] getTemplates(org.nuiton.wikitty.WikittyExtension extension)
Deprecated. 

Lists the template files associated with the specified extension

Parameters:
extension -
Returns:

getTemplateFilenames

public Collection<String> getTemplateFilenames(org.nuiton.wikitty.WikittyExtension extension)
Get the template file names associated with the specified extension.

Parameters:
extension - extension
Returns:
extension's template file names

getAssociatedFields

public Map<String,String> getAssociatedFields(String extensionName,
                                              String templateName)
                                       throws VradiException
Get association between template fields and extension fields.

Parameters:
extensionName -
templateName -
Returns:
association map or null is there is no association yet
Throws:
VradiException

setAssociatedFields

public void setAssociatedFields(String extensionName,
                                String templateName,
                                Map<String,String> fieldMap)
                         throws VradiException
Save association between template fields and user selected fields into external xml field next to template. Xml file is created a first call.

Parameters:
extensionName -
templateName -
fieldMap -
Throws:
VradiException

isFormTypeExists

public boolean isFormTypeExists(String formTypeName)
                         throws VradiException
Check if a form type name already exists.

Parameters:
formTypeName - form type name
Returns:
new created wikitty extension
Throws:
VradiException - if name is not valid

createFormType

public org.nuiton.wikitty.WikittyExtension createFormType(String formTypeName)
                                                   throws VradiException
Create new form type.

Parameters:
formTypeName - form type name
Returns:
new created wikitty extension
Throws:
VradiException - if name is not valid

getFormTypeTemplateName

public String getFormTypeTemplateName(org.nuiton.wikitty.WikittyExtension extension)


Copyright © 2009-2010 JurisMarches. All Rights Reserved.