org.mmbase.module.builders
Class DayMarkers

java.lang.Object
  |
  +--org.mmbase.module.core.MMTable
        |
        +--org.mmbase.module.core.MMObjectBuilder
              |
              +--org.mmbase.module.builders.DayMarkers

public class DayMarkers
extends MMObjectBuilder

Version:
$Id: DayMarkers.java,v 1.26.2.1 2003/03/13 15:23:26 michiel Exp $
Author:
Daniel Ockeloen,Rico Jansen

Field Summary
static java.lang.String FIELD_DAYCOUNT
           
 
Fields inherited from class org.mmbase.module.core.MMObjectBuilder
broadcastChanges, database, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, fields, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, REPLACE_CACHE, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual
 
Fields inherited from class org.mmbase.module.core.MMTable
mmb, tableName
 
Constructor Summary
DayMarkers()
           
 
Method Summary
 int getAge(MMObjectNode node)
          Returns the age, in days, of a node.
 java.util.Date getDate(MMObjectNode node)
          Returns the date of a daymarker
 int getDayCount()
          The current day count, that is, the time in days, of today.
 int getDayCountAge(int daysold)
          Given an age, this function returns a mark, _not a day count_.
 int getDayCountByObject(int number)
           
 java.lang.String getLocaleGUIIndicator(java.util.Locale locale, MMObjectNode node)
          Returns gui information for a specific node.
 int getMonthsByDayCount(int daycount)
           
 boolean init()
          Initializes this builder The property 'mmb' needs to be set for the builder before this method can be called.
 void probe()
          This gets called every hour to see if the day has past.
 java.lang.String replace(scanpage sp, java.util.StringTokenizer command)
          Scan.
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, commit, convertMMNode2SQL, count, create, createAlias, created, deleteNodeCache, drop, equals, equals, executeFunction, executeFunction, fieldLocalChanged, getAliasedNode, getAncestors, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getConfigFile, getDBByte, getDBKey, getDBState, getDBText, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEditFields, getField, getFieldNames, getFields, getFields, getFullTableName, getFunctionParameters, getGUIIndicator, getGUIIndicator, getHardNode, getHardNode, getHTML, getInitParameter, getInitParameters, getList, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNode, getNodes, getNodeType, getNumberFromName, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getQuery, getQuery, getQuery, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hashCode, hostname_function, insert, insert, insertDone, isExtensionOf, isNodeCached, isVirtual, nodeLocalChanged, nodeRemoteChanged, preCommit, preEdit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeTmpNode, safeCache, safeCommit, safeInsert, search, search, search, searchIn, searchIn, searchIn, searchList, searchList, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setDBLayout_xml, setDefaults, setDescription, setDescriptions, setInitParameter, setMaintainer, setMMBase, setParentBuilder, setPluralNames, setSearchAge, setSingularNames, setTableName, setValue, setValue, setVersion, setXMLPath, setXMLValues, signalNewObject, testValidData, toString, toString, toXML, updateFields, waitUntilNodeChanged, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIELD_DAYCOUNT

public static java.lang.String FIELD_DAYCOUNT
Constructor Detail

DayMarkers

public DayMarkers()
Method Detail

init

public boolean init()
Description copied from class: MMObjectBuilder
Initializes this builder The property 'mmb' needs to be set for the builder before this method can be called. The method retrieves data from the TypeDef builder, or adds data to that builder if the current builder is not yet registered.
Overrides:
init in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Returns:
true if init was completed, false if uncompleted.
See Also:
MMObjectBuilder.create()

probe

public void probe()
This gets called every hour to see if the day has past.

getAge

public int getAge(MMObjectNode node)
Returns the age, in days, of a node. So, this does the inverse of most methods in this class. It converts a node number (which is like a mark) to a day.
Overrides:
getAge in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node whose age to determine
Returns:
the age in days, or 0 if unknown (daymarks builder not present)

getDayCount

public int getDayCount()
The current day count, that is, the time in days, of today.

getDayCountAge

public int getDayCountAge(int daysold)
Given an age, this function returns a mark, _not a day count_.
Parameters:
daysold - a time in days ago.

replace

public java.lang.String replace(scanpage sp,
                                java.util.StringTokenizer command)
Scan. Knows the tokens, COUNT, COUNTAGE, COUNTMONTH, COUNTPREVMONTH, COUNTNEXTMONTH etc.
Overrides:
replace in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
sp - The scanpage (containing http and user info) that calls the function
tok - a list of strings that describe the (sub)command to execute
Returns:
the result value as a String

getDayCountByObject

public int getDayCountByObject(int number)

getMonthsByDayCount

public int getMonthsByDayCount(int daycount)

getDate

public java.util.Date getDate(MMObjectNode node)
Returns the date of a daymarker
Parameters:
node - The node of which the date is wanted
Returns:
a Date which is the date

getLocaleGUIIndicator

public java.lang.String getLocaleGUIIndicator(java.util.Locale locale,
                                              MMObjectNode node)
Returns gui information for a specific node. This value is retrieved by retrieving the field 'gui()' of the node (node.getStringValue("gui()") )
Overrides:
getLocaleGUIIndicator in class MMObjectBuilder
Parameters:
node - The node of which the gui information is wanted
Returns:
a String in which the current date is shown


MMBase build 1.6.5.20030923