nl.cloudfarming.client.area.field
Class FieldAreaService

java.lang.Object
  extended by nl.cloudfarming.client.model.DataProviderImpl
      extended by nl.cloudfarming.client.model.CommonModelService
          extended by nl.cloudfarming.client.area.field.FieldAreaService
All Implemented Interfaces:
AreaService, BeanService, DataProvider, ModelService, org.openide.explorer.ExplorerManager.Provider, org.openide.util.Lookup.Provider

public final class FieldAreaService
extends CommonModelService
implements AreaService

Author:
Timon Veenstra

Constructor Summary
FieldAreaService()
           
 
Method Summary
 void createNewAbLine(AbLine abLine)
           
 void createNewField(Field field)
           
 void createNewHelpLine(HelpLine helpLine)
           
 void createNewPartField(PartField pf)
          Creates a new partField
 void createNewShapeFile(ShapeFile shapeFile)
           
 void createShapes(List<Bean> shapeBeans)
           
 boolean endField(Field field)
          Sets the endDate of the field to now.
 List<Field> findAllActiveFields()
          Find all the fields where the endDate is not filled
 List<Field> findAllCurrentFields()
           
 List<HelpLine> findAllHelpLines()
          Find all the fields where the endDate is not filled
 Field findFieldById(long id)
          Find a Field by ID
 List<ProductionUnit> findProductionUnitsByDate(Date date)
          Find production units by date
 ShapeFile findShapeFileByNameAndChecksum(String name, String checksum)
          Find a Field by specifying the filename and the checksum
protected  String getModuleName()
           
protected  void initExplorer()
           
 void removeField(Field field)
          Removes a field.
 void removeHelpLine(HelpLine line)
          Removes a line.
 void saveFieldChanges(Field field)
           
 void savePartFieldChanges(PartField partField)
           
 
Methods inherited from class nl.cloudfarming.client.model.CommonModelService
commit, findAllFieldPlans, findAllFields, findNumberOfPartFieldForFieldPlan, findPartFieldsByDate, flush, getEntityManager, merge, mergeAndPersistInTransaction, persistInTransaction, remove, save, startTransaction
 
Methods inherited from class nl.cloudfarming.client.model.DataProviderImpl
addBeanToSelection, addSaveCookie, findNodeForBean, getExplorerManager, getLookup, getUndoredoManager, removeBeanFromSelection, removeSaveCookie, setExplorerManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.cloudfarming.client.area.AreaService
findAllFields
 
Methods inherited from interface nl.cloudfarming.client.model.BeanService
save
 
Methods inherited from interface org.openide.explorer.ExplorerManager.Provider
getExplorerManager
 
Methods inherited from interface org.openide.util.Lookup.Provider
getLookup
 

Constructor Detail

FieldAreaService

public FieldAreaService()
Method Detail

getModuleName

protected String getModuleName()
Specified by:
getModuleName in class CommonModelService

findAllCurrentFields

public final List<Field> findAllCurrentFields()

createNewField

public final void createNewField(Field field)
Specified by:
createNewField in interface AreaService

createNewHelpLine

public void createNewHelpLine(HelpLine helpLine)
Specified by:
createNewHelpLine in interface AreaService

createNewAbLine

public void createNewAbLine(AbLine abLine)
Specified by:
createNewAbLine in interface AreaService

saveFieldChanges

public final void saveFieldChanges(Field field)
Specified by:
saveFieldChanges in interface AreaService

savePartFieldChanges

public final void savePartFieldChanges(PartField partField)

createNewShapeFile

public final void createNewShapeFile(ShapeFile shapeFile)
Specified by:
createNewShapeFile in interface AreaService

createNewPartField

public void createNewPartField(PartField pf)
Creates a new partField

Specified by:
createNewPartField in interface AreaService
Parameters:
pf - the partfield that should be created

findProductionUnitsByDate

public List<ProductionUnit> findProductionUnitsByDate(Date date)
Find production units by date

Specified by:
findProductionUnitsByDate in interface AreaService
Parameters:
date - The PU should be active on this date
Returns:
The list of PU's active on the specified Date

endField

public boolean endField(Field field)
Sets the endDate of the field to now.

Specified by:
endField in interface AreaService
Parameters:
field - the field that should be ended
Throws:
IllegalArgumentException - if the Provided field is not a persisted entity

initExplorer

protected void initExplorer()
Specified by:
initExplorer in class DataProviderImpl

findShapeFileByNameAndChecksum

public ShapeFile findShapeFileByNameAndChecksum(String name,
                                                String checksum)
Find a Field by specifying the filename and the checksum

Specified by:
findShapeFileByNameAndChecksum in interface AreaService
Parameters:
name - Filename
checksum - file checksum
Returns:

findFieldById

public Field findFieldById(long id)
Find a Field by ID

Specified by:
findFieldById in interface AreaService
Parameters:
id -
Returns:

findAllActiveFields

public List<Field> findAllActiveFields()
Find all the fields where the endDate is not filled

Specified by:
findAllActiveFields in interface AreaService
Returns:
all the active Fields

findAllHelpLines

public List<HelpLine> findAllHelpLines()
Find all the fields where the endDate is not filled

Specified by:
findAllHelpLines in interface AreaService
Returns:
all the active Fields

removeField

public void removeField(Field field)
Removes a field. If a field has partFields the field will not be removed. Instead the endDate of the field and all of its partFields will be filed.

Specified by:
removeField in interface AreaService
Parameters:
field - which will be removed

removeHelpLine

public void removeHelpLine(HelpLine line)
Removes a line. If a field has partFields the field will not be removed. Instead the endDate of the field and all of its partFields will be filed.

Specified by:
removeHelpLine in interface AreaService
Parameters:
field - which will be removed

createShapes

public void createShapes(List<Bean> shapeBeans)
Specified by:
createShapes in interface AreaService


Copyright © 2011. All Rights Reserved.