org.gcube.portlets.user.reportgenerator.client.model
Class TemplateModel

java.lang.Object
  extended by org.gcube.portlets.user.reportgenerator.client.model.TemplateModel

public class TemplateModel
extends Object

The TemplateModel class represents the current Template state, the model in the the MVC pattern

Author:
Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it

Field Summary
static String BIBLIO_SECTION
           
static String DEFAULT_NAME
          DEFAULT_NAME
static int OLD_TEMPLATE_WIDTH
          default w and h
static int TEMPLATE_WIDTH
           
static String USER_COMMENT
           
static String USER_COMMENT_HEIGHT
           
 
Constructor Summary
TemplateModel(Presenter presenter)
          Constructs a Default Template Model
 
Method Summary
 void addCitation(String citeKey, String citeText)
           
 void addCommentToComponent(com.google.gwt.user.client.ui.Widget component, String comment2Add, int visibleHeight)
          look for the model in the current page and edits its size
 boolean containsLargeTS()
           
 TemplateSection discardSection(int sectNo)
           
 int getColumnWidth()
           
 int getCurrentPage()
           
 String getExportedFileURL(ExportManifestationType type, String templateName)
           
 String getLastEditBy()
           
 int getMarginBottom()
           
 int getMarginLeft()
           
 int getMarginRight()
           
 int getMarginTop()
           
 List<org.gcube.portlets.d4sreporting.common.shared.Metadata> getMetadata()
          metadata .
 ReportServiceAsync getModelService()
           
 int getPageHeight()
           
 int getPageWidth()
           
 TemplateSection getSection(int pageNo)
           
 List<TemplateComponent> getSectionComponent(int pageNo)
           
 org.gcube.portlets.d4sreporting.common.shared.Model getSerializableModel()
           
 String getTemplateName()
           
 int getTotalPages()
           
 void importSectionInModel(org.gcube.portlets.d4sreporting.common.shared.Model toLoad, int sectionNoToimport, int beforeSection, boolean asLastSection)
          generally used when reading a model form disk
 void insertBiblioSection()
           
 void loadModel(org.gcube.portlets.d4sreporting.common.shared.Model toLoad, Presenter presenter)
          generally used when reaing a model form disk
 boolean removeCitation(String citeKey)
          remove a Citation from the model
 void removeComment(com.google.gwt.user.client.ui.Widget toRemove)
           
 void resizeModelComponent(com.google.gwt.user.client.ui.Widget toResize, int newWidth, int newHeight)
          look for the model in the current page and edits its size
 void saveReport(org.gcube.portlets.d4sreporting.common.shared.Model toSave)
           
 void saveReport(org.gcube.portlets.d4sreporting.common.shared.Model toSave, String folderid, String name)
           
 void setColumnWidth(int columnWidth)
           
 void setCurrentPage(int currentPage)
           
 void setLastEditBy(String lastEditBy)
           
 void setMarginBottom(int marginBottom)
           
 void setMarginLeft(int marginLeft)
           
 void setMarginRight(int marginRight)
           
 void setMarginTop(int marginTop)
           
 void setPageHeight(int pageHeight)
           
 void setPageWidth(int pageWidth)
           
 void setTemplateName(String templateName)
           
 void setTotalPages(int totalPages)
           
 void updateWorkflowDocument(org.gcube.portlets.d4sreporting.common.shared.Model toSave, boolean update)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OLD_TEMPLATE_WIDTH

public static final int OLD_TEMPLATE_WIDTH
default w and h

See Also:
Constant Field Values

TEMPLATE_WIDTH

public static final int TEMPLATE_WIDTH
See Also:
Constant Field Values

DEFAULT_NAME

public static final String DEFAULT_NAME
DEFAULT_NAME

See Also:
Constant Field Values

BIBLIO_SECTION

public static final String BIBLIO_SECTION
See Also:
Constant Field Values

USER_COMMENT

public static final String USER_COMMENT
See Also:
Constant Field Values

USER_COMMENT_HEIGHT

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

TemplateModel

public TemplateModel(Presenter presenter)
Constructs a Default Template Model

Parameters:
presenter - .
Method Detail

getSectionComponent

public List<TemplateComponent> getSectionComponent(int pageNo)
Parameters:
pageNo - .
Returns:
.

addCommentToComponent

public void addCommentToComponent(com.google.gwt.user.client.ui.Widget component,
                                  String comment2Add,
                                  int visibleHeight)
look for the model in the current page and edits its size

Parameters:
toResize - .
newWidth - .
newHeight - .

removeComment

public void removeComment(com.google.gwt.user.client.ui.Widget toRemove)

insertBiblioSection

public void insertBiblioSection()

addCitation

public void addCitation(String citeKey,
                        String citeText)
Parameters:
citeKey - -
citeText - -

removeCitation

public boolean removeCitation(String citeKey)
remove a Citation from the model

Parameters:
citeKey - .

getSection

public TemplateSection getSection(int pageNo)
Parameters:
pageNo - .
Returns:
.

loadModel

public void loadModel(org.gcube.portlets.d4sreporting.common.shared.Model toLoad,
                      Presenter presenter)
generally used when reaing a model form disk

Parameters:
toLoad - the SerializableModel instance to load in the model
presenter - .

importSectionInModel

public void importSectionInModel(org.gcube.portlets.d4sreporting.common.shared.Model toLoad,
                                 int sectionNoToimport,
                                 int beforeSection,
                                 boolean asLastSection)
generally used when reading a model form disk

Parameters:
toLoad - the SerializableModel instance where toget the section
sectionNoToimport - section to import 0 -> n-1
beforeSection - say where to import this section (before)
asLastSection - say to import this section as last section in the curren template / report

discardSection

public TemplateSection discardSection(int sectNo)
Parameters:
sectNo - the section to discard
Returns:
the removed element

getSerializableModel

public org.gcube.portlets.d4sreporting.common.shared.Model getSerializableModel()
Returns:
a serialized version od the model

saveReport

public void saveReport(org.gcube.portlets.d4sreporting.common.shared.Model toSave,
                       String folderid,
                       String name)
Parameters:
folderid - .
name - .

saveReport

public void saveReport(org.gcube.portlets.d4sreporting.common.shared.Model toSave)

resizeModelComponent

public void resizeModelComponent(com.google.gwt.user.client.ui.Widget toResize,
                                 int newWidth,
                                 int newHeight)
look for the model in the current page and edits its size

Parameters:
toResize - .
newWidth - .
newHeight - .

getExportedFileURL

public String getExportedFileURL(ExportManifestationType type,
                                 String templateName)
Parameters:
type - a
templateName - a return a URL which is lookable for on the web
Returns:
.

getCurrentPage

public int getCurrentPage()
Returns:
.

setCurrentPage

public void setCurrentPage(int currentPage)
Parameters:
currentPage - .

getMarginBottom

public int getMarginBottom()
Returns:
.

setMarginBottom

public void setMarginBottom(int marginBottom)
Parameters:
marginBottom - .

getMarginLeft

public int getMarginLeft()
Returns:
.

setMarginLeft

public void setMarginLeft(int marginLeft)
Parameters:
marginLeft - .

getMarginRight

public int getMarginRight()
Returns:
.

setMarginRight

public void setMarginRight(int marginRight)
Parameters:
marginRight - .

getMarginTop

public int getMarginTop()
Returns:
.

setMarginTop

public void setMarginTop(int marginTop)
Parameters:
marginTop - .

getPageHeight

public int getPageHeight()
Returns:
.

setPageHeight

public void setPageHeight(int pageHeight)
Parameters:
pageHeight - .

getPageWidth

public int getPageWidth()
Returns:
.

setPageWidth

public void setPageWidth(int pageWidth)
Parameters:
pageWidth - .

getTemplateName

public String getTemplateName()
Returns:
.

setTemplateName

public void setTemplateName(String templateName)
Parameters:
templateName - .

getTotalPages

public int getTotalPages()
Returns:
totalPages .

setTotalPages

public void setTotalPages(int totalPages)
Parameters:
totalPages - .

getColumnWidth

public int getColumnWidth()
Returns:
.

setColumnWidth

public void setColumnWidth(int columnWidth)
Parameters:
columnWidth - .

getModelService

public ReportServiceAsync getModelService()
Returns:
.

getMetadata

public List<org.gcube.portlets.d4sreporting.common.shared.Metadata> getMetadata()
metadata .

Returns:
.

getLastEditBy

public String getLastEditBy()
Returns:
.

setLastEditBy

public void setLastEditBy(String lastEditBy)
Parameters:
lastEditBy - .

containsLargeTS

public boolean containsLargeTS()
Returns:
.

updateWorkflowDocument

public void updateWorkflowDocument(org.gcube.portlets.d4sreporting.common.shared.Model toSave,
                                   boolean update)


Copyright © 2014. All Rights Reserved.