org.gcube.application.reporting
Class ReportsModeler

java.lang.Object
  extended by org.gcube.application.reporting.ReportsModeler
All Implemented Interfaces:
Modeler

public final class ReportsModeler
extends Object
implements Modeler

Author:
massi

Field Summary
static String DEFAULT_NAME
           
static int TEMPLATE_HEIGHT
           
static int TEMPLATE_WIDTH
          Styling attr, not used anymore but needed for backward compatibility
 
Constructor Summary
ReportsModeler(String id, String name, String author, Date dateCreated, Date lastEdit, String lastEditorId)
           
 
Method Summary
 boolean addAttributeComponent(String attrName, ArrayList<org.gcube.portlets.d4sreporting.common.shared.Attribute> values, boolean allowMultiselection)
          Add a attribute component to the model instance, allow to specify if is editable or not
 boolean addHeading(int level)
          add an empty fillable heading
 boolean addHeading(int level, String content)
          add an heading with a non editable content
 boolean addHeading(int level, String content, boolean isReadonly)
          
 boolean addInstruction(String content)
          add an instruction
 boolean addMedia()
          add the possibility to enter text, table or images in the report
 boolean addReference(ReferenceReportType refType, List<DBTableRow> list)
          add the references
 boolean addTextInput()
          add an empty fillable text input
 boolean addTextInput(String content)
          add a text input with some pre entered text
 boolean addTextInput(String content, boolean isReadonly)
          add text input
 boolean addTitle()
          add an empty fillable title
 boolean addTitle(String content, boolean isReadonly)
          
 org.gcube.portlets.d4sreporting.common.shared.Model getReportInstance()
           
 int nextSection()
          add a section, every add will point to this new section
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_WIDTH

public static final int TEMPLATE_WIDTH
Styling attr, not used anymore but needed for backward compatibility

See Also:
Constant Field Values

TEMPLATE_HEIGHT

public static final int TEMPLATE_HEIGHT
See Also:
Constant Field Values

DEFAULT_NAME

public static final String DEFAULT_NAME
See Also:
Constant Field Values
Constructor Detail

ReportsModeler

public ReportsModeler(String id,
                      String name,
                      String author,
                      Date dateCreated,
                      Date lastEdit,
                      String lastEditorId)
Parameters:
a - the report unique idenntifier
name - the report name
author - the author
dateCreated -
lastEdit -
lastEditorId - last editor username
Method Detail

addTitle

public boolean addTitle()
add an empty fillable title

Specified by:
addTitle in interface Modeler
Returns:
true if the operation is performed with success, false otherwise

addTitle

public boolean addTitle(String content,
                        boolean isReadonly)

Specified by:
addTitle in interface Modeler
Parameters:
content - the content you want to show in the title
isReadonly - tells wether the user can edit the content ot not
Returns:
true if the operation is performed with success, false otherwise

addHeading

public boolean addHeading(int level)
add an empty fillable heading

Specified by:
addHeading in interface Modeler
Parameters:
level - of the heading
Returns:
true if the operation is performed with success, false otherwise

addHeading

public boolean addHeading(int level,
                          String content)
add an heading with a non editable content

Specified by:
addHeading in interface Modeler
Parameters:
level - of the heading
content - the content you want to show in the heading
Returns:
true if the operation is performed with success, false otherwise

addHeading

public boolean addHeading(int level,
                          String content,
                          boolean isReadonly)

Specified by:
addHeading in interface Modeler
Parameters:
level - of the heading
content - the content you want to show in the heading
isReadonly - tells wether the user can edit the content ot not
Returns:
true if the operation is performed with success, false otherwise

addTextInput

public boolean addTextInput()
add an empty fillable text input

Specified by:
addTextInput in interface Modeler
Returns:
true if the operation is performed with success, false otherwise

addTextInput

public boolean addTextInput(String content)
add a text input with some pre entered text

Specified by:
addTextInput in interface Modeler
Parameters:
content - the content you want to show in the textbox
Returns:
true if the operation is performed with success, false otherwise

addTextInput

public boolean addTextInput(String content,
                            boolean isReadonly)
add text input

Specified by:
addTextInput in interface Modeler
Parameters:
content - the content you want to show in the textbox
isReadonly - tells wether the user can edit the content ot not
Returns:
true if the operation is performed with success, false otherwise

addInstruction

public boolean addInstruction(String content)
add an instruction

Specified by:
addInstruction in interface Modeler
Parameters:
content - the content you want to show in the instruction
Returns:
true if the operation is performed with success, false otherwise

addReference

public boolean addReference(ReferenceReportType refType,
                            List<DBTableRow> list)
add the references

Specified by:
addReference in interface Modeler
Parameters:
refType - the reference type
Returns:
true if the operation is performed with success, false otherwise

addAttributeComponent

public boolean addAttributeComponent(String attrName,
                                     ArrayList<org.gcube.portlets.d4sreporting.common.shared.Attribute> values,
                                     boolean allowMultiselection)
Add a attribute component to the model instance, allow to specify if is editable or not

Specified by:
addAttributeComponent in interface Modeler

addMedia

public boolean addMedia()
add the possibility to enter text, table or images in the report

Specified by:
addMedia in interface Modeler
Returns:

nextSection

public int nextSection()
add a section, every add will point to this new section

Specified by:
nextSection in interface Modeler
Returns:
the index of the new section

getReportInstance

public org.gcube.portlets.d4sreporting.common.shared.Model getReportInstance()
                                                                      throws Exception
Throws:
Exception


Copyright © 2013. All Rights Reserved.