org.opoo.press
接口 Base

所有已知子接口:
Page, Post
所有已知实现类:
AbstractBase, CategoryGenerator.CategoryPage, Draft, PageImpl, PostImpl, TagGenerator.TagPage

public interface Base

The base interface for Post and Page class.

作者:
Alex Lin

方法摘要
 Object get(String name)
          Get meta data.
 String getContent()
          Return the post or page content.
 Date getDate()
          The date format in the source file is 'yyyy-MM-dd HH:mm' or 'yyyy-MM-dd HH:mm:ss'.
 String getDateFormatted()
          The output date format of the date.
 String getLayout()
          The layout of source file.
 String getPath()
          The origin file path of the source file, not source directory prefix.
 String getPermalink()
          The permalink style.
 Source getSource()
          The file source.
 Date getUpdated()
          The updated date format in the source file is 'yyyy-MM-dd HH:mm' or 'yyyy-MM-dd HH:mm:ss'.
 String getUpdatedFormatted()
          The output date format of the updated date.
 String getUrl()
          Return the URL.
 void set(String name, Object value)
          Set meta data.
 

方法详细信息

getSource

Source getSource()
The file source.

返回:
source

getContent

String getContent()
Return the post or page content. Content might be changed by Converter in generate processing.

返回:
the content text of post or page

getUrl

String getUrl()
Return the URL. It's part of output URL, start with a '/', relative to destination directory, without site root prefix.

e.g.: '/index.html', '/categories/', '/about/'

If the site url is 'http://press.opoo.org', the site root is '/docs', and this page/post url is '/chapter01/', then the completely URL is 'http://press.opoo.org/docs/chapter01/'.

返回:
the page or post main URL
另请参见:
Site.getRoot()

getPath

String getPath()
The origin file path of the source file, not source directory prefix. Such as '/about/index.markdown'.

返回:
the origin file path

getLayout

String getLayout()
The layout of source file. All build in layout are 'default', 'post', 'page' and 'nil'.

'nil' means null, not apply any template.

Every layout(except 'nil') has a template defined in templates directory. the template file name is '_<layout>.ftl', can extend OpooPress layout using this mechanism.

返回:
the layout of source file

getPermalink

String getPermalink()
The permalink style.

返回:
permalink

getDate

Date getDate()
The date format in the source file is 'yyyy-MM-dd HH:mm' or 'yyyy-MM-dd HH:mm:ss'.

返回:
date

getUpdated

Date getUpdated()
The updated date format in the source file is 'yyyy-MM-dd HH:mm' or 'yyyy-MM-dd HH:mm:ss'.

返回:
the updated date

getDateFormatted

String getDateFormatted()
The output date format of the date.

返回:
date format string
另请参见:
getDate()

getUpdatedFormatted

String getUpdatedFormatted()
The output date format of the updated date.

返回:
updated date format string
另请参见:
getUpdated()

get

Object get(String name)
Get meta data.

参数:
name -
返回:
value

set

void set(String name,
         Object value)
Set meta data.

参数:
name -
value -
另请参见:
get(String)


Copyright © 2013-2014 Opoo.org. All Rights Reserved.