## com.imcode.imcms.dao
Class MetaDao

    java.lang.Object
      org.springframework.orm.hibernate3.HibernateAccessor
          org.springframework.orm.hibernate3.HibernateTemplate
              com.imcode.imcms.dao.MetaDao

All Implemented Interfaces:
  org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.orm.hibernate3.HibernateOperations

    public class MetaDao

extends org.springframework.orm.hibernate3.HibernateTemplate

Field Summary

Fields inherited from class org.springframework.orm.hibernate3.HibernateAccessor
`FLUSH_ALWAYS, FLUSH_AUTO, FLUSH_COMMIT, FLUSH_EAGER, FLUSH_NEVER, logger`

Constructor Summary
`MetaDao()`

Method Summary
`DocumentVersion` `createNextWorkingVersion(java.lang.Integer documentId, java.lang.Integer userId)` Creates next working version of a document.
`int` `deleteFileReferences(java.lang.Integer documentId)`
`java.util.List<DocumentVersion>` `getDocumentVersions(java.lang.Integer documentId)`
`java.util.Collection<FileReference>` `getFileReferences(java.lang.Integer documentId)`
`HtmlReference` `getHtmlReference(java.lang.Integer documentId)`
`java.util.Collection<Include>` `getIncludes(java.lang.Integer documentId)`
`Meta` `getMeta(java.lang.Integer id, DocumentVersionTag versionTag)` Returns meta for given document id and and version tag.
`Meta` `getMeta(java.lang.Integer id, java.lang.Integer version)` Returns meta with version data.
`Meta` `getPublishedMeta(java.lang.Integer documentId)` Returns published document Meta for given document id.
`TemplateNames` `getTemplateNames(java.lang.Integer documentId)`
`UrlReference` `getUrlReference(java.lang.Integer documentId)`
`Meta` `getWorkingMeta(java.lang.Integer documentId)` Returns working document Meta for given document id.
`void` `publishWorkingDocument(java.lang.Integer documentId)` Publishes working version of a document.
`FileReference` `saveFileReference(FileReference fileRef)`
`HtmlReference` `saveHtmlReference(HtmlReference reference)`
`void` `saveIncludes(java.lang.Integer documentId, java.util.Collection<Include> includes)`
`void` `saveMeta(Meta meta)`
`void` `saveTemplateNames(java.lang.Integer documentId, TemplateNames templateNames)`
`UrlReference` `saveUrlReference(UrlReference reference)`

Methods inherited from class org.springframework.orm.hibernate3.HibernateTemplate

`applyNamedParameterToQuery, bulkUpdate, bulkUpdate, bulkUpdate, checkWriteOperationAllowed, clear, closeIterator, contains, createSessionProxy, delete, delete, delete, delete, deleteAll, doExecute, enableFilter, evict, execute, execute, executeFind, executeWithNativeSession, executeWithNewSession, find, find, find, findByCriteria, findByCriteria, findByExample, findByExample, findByExample, findByExample, findByNamedParam, findByNamedParam, findByNamedQuery, findByNamedQuery, findByNamedQuery, findByNamedQueryAndNamedParam, findByNamedQueryAndNamedParam, findByNamedQueryAndValueBean, findByValueBean, flush, get, get, get, get, getFetchSize, getMaxResults, getQueryCacheRegion, getSession, initialize, isAllowCreate, isAlwaysUseNewSession, isCacheQueries, isCheckWriteOperations, isExposeNativeSession, iterate, iterate, iterate, load, load, load, load, load, loadAll, lock, lock, merge, merge, persist, persist, prepareCriteria, prepareQuery, refresh, refresh, replicate, replicate, save, save, saveOrUpdate, saveOrUpdate, saveOrUpdateAll, setAllowCreate, setAlwaysUseNewSession, setCacheQueries, setCheckWriteOperations, setExposeNativeSession, setFetchSize, setMaxResults, setQueryCacheRegion, update, update, update, update`

Methods inherited from class org.springframework.orm.hibernate3.HibernateAccessor

`afterPropertiesSet, applyFlushMode, convertHibernateAccessException, convertJdbcAccessException, convertJdbcAccessException, disableFilters, enableFilters, flushIfNecessary, getDefaultJdbcExceptionTranslator, getEntityInterceptor, getFilterNames, getFlushMode, getJdbcExceptionTranslator, getSessionFactory, setBeanFactory, setEntityInterceptor, setEntityInterceptorBeanName, setFilterName, setFilterNames, setFlushMode, setFlushModeName, setJdbcExceptionTranslator, setSessionFactory`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MetaDao

    public MetaDao()

Method Detail

### createNextWorkingVersion

    @Transactional
    public DocumentVersion createNextWorkingVersion(java.lang.Integer documentId,
                                                                  java.lang.Integer userId)

  Creates next working version of a document. If document has a working version tag it as cancelled.

  Returns:
    next document version.

### getMeta

    @Transactional
    public Meta getMeta(java.lang.Integer id,
                                      java.lang.Integer version)

  Returns meta with version data.

  Returns:
    Meta

### getMeta

    @Transactional
    public Meta getMeta(java.lang.Integer id,
                                      DocumentVersionTag versionTag)

  Returns meta for given document id and and version tag. Checks and adds if necessary missing i18n-ed parts to meta.

  Returns:
    Meta

### getPublishedMeta

    @Transactional
    public Meta getPublishedMeta(java.lang.Integer documentId)

  Returns published document Meta for given document id.

  Parameters:
    `documentId` - document id.
  Returns:
    published document meta.

### getWorkingMeta

    @Transactional
    public Meta getWorkingMeta(java.lang.Integer documentId)

  Returns working document Meta for given document id.

  Parameters:
    `documentId` - document id.
  Returns:
    published document meta.

### saveMeta

    @Transactional
    public void saveMeta(Meta meta)

### saveIncludes

    @Transactional
    public void saveIncludes(java.lang.Integer documentId,
                                           java.util.Collection<Include> includes)

### saveTemplateNames

    @Transactional
    public void saveTemplateNames(java.lang.Integer documentId,
                                                TemplateNames templateNames)

### getIncludes

    @Transactional
    public java.util.Collection<Include> getIncludes(java.lang.Integer documentId)

### getTemplateNames

    @Transactional
    public TemplateNames getTemplateNames(java.lang.Integer documentId)

### getFileReferences

    @Transactional
    public java.util.Collection<FileReference> getFileReferences(java.lang.Integer documentId)

### saveFileReference

    @Transactional
    public FileReference saveFileReference(FileReference fileRef)

### deleteFileReferences

    @Transactional
    public int deleteFileReferences(java.lang.Integer documentId)

### getHtmlReference

    @Transactional
    public HtmlReference getHtmlReference(java.lang.Integer documentId)

### saveHtmlReference

    @Transactional
    public HtmlReference saveHtmlReference(HtmlReference reference)

### getUrlReference

    @Transactional
    public UrlReference getUrlReference(java.lang.Integer documentId)

### saveUrlReference

    @Transactional
    public UrlReference saveUrlReference(UrlReference reference)

### publishWorkingDocument

    @Transactional
    public void publishWorkingDocument(java.lang.Integer documentId)

  Publishes working version of a document. Changes published version to archived and working version to published.

  Parameters:
    `documentId` - document id to publish. //TODO?: @param version, and select by version, not by tag ??? //TODO?: @param userId - user id ??? //TODO?: alter modification date ???

### getDocumentVersions

    @Transactional(propagation=SUPPORTS)
    public java.util.List<DocumentVersion> getDocumentVersions(java.lang.Integer documentId)