本文整理汇总了Java中com.atlassian.confluence.pages.AbstractPage类的典型用法代码示例。如果您正苦于以下问题:Java AbstractPage类的具体用法?Java AbstractPage怎么用?Java AbstractPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractPage类属于com.atlassian.confluence.pages包,在下文中一共展示了AbstractPage类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSpecification
import com.atlassian.confluence.pages.AbstractPage; //导入依赖的package包/类
private void updateSpecification(Event evt) throws GreenPepperServerException
{
PageUpdateEvent pageEvt = (PageUpdateEvent) evt;
AbstractPage oldPage = pageEvt.getOriginalPage();
Page newPage = pageEvt.getPage();
if(newPage != null && oldPage != null && !newPage.getTitle().equals(oldPage.getTitle()))
{
Specification oldSpecification = Specification.newInstance(oldPage.getTitle());
oldSpecification.setRepository(gp.getHomeRepository(newPage.getSpace().getKey()));
try
{
Specification newSpecification = Specification.newInstance(newPage.getTitle());
newSpecification.setRepository(gp.getHomeRepository(newPage.getSpace().getKey()));
gp.getGPServerService().updateSpecification(oldSpecification, newSpecification);
}
catch (GreenPepperServerException e)
{
gp.getGPServerService().removeSpecification(oldSpecification);
}
}
}
示例2: onLabelAddEvent
import com.atlassian.confluence.pages.AbstractPage; //导入依赖的package包/类
@EventListener
public void onLabelAddEvent(LabelAddEvent labelAddEvent) {
if (labelAddEvent.getLabelled() instanceof AbstractPage) {
Labelable labelled = labelAddEvent.getLabelled();
Namespace namespace = labelAddEvent.getLabel().getNamespace();
String visibility = namespace != null ? namespace.getVisibility() : "";
String prefix = namespace != null ? namespace.getPrefix() : "";
String source = labelled instanceof Page ? "page" : "blogpost";
metricCollector.labelAddCounter(visibility, prefix, source, ((AbstractPage) labelled).getSpaceKey());
}
}
示例3: onLabelRemoveEvent
import com.atlassian.confluence.pages.AbstractPage; //导入依赖的package包/类
@EventListener
public void onLabelRemoveEvent(LabelRemoveEvent labelRemoveEvent) {
if (labelRemoveEvent.getLabelled() instanceof AbstractPage) {
Labelable labelled = labelRemoveEvent.getLabelled();
Namespace namespace = labelRemoveEvent.getLabel().getNamespace();
String visibility = namespace != null ? namespace.getVisibility() : "";
String prefix = namespace != null ? namespace.getPrefix() : "";
String source = labelled instanceof Page ? "page" : "blogpost";
metricCollector.labelRemoveCounter(visibility, prefix, source, ((AbstractPage) labelled).getSpaceKey());
}
}
示例4: getImplementedPage
import com.atlassian.confluence.pages.AbstractPage; //导入依赖的package包/类
/**
* Retrieves the content of the specification at the implemented version.
*
* @param page a {@link com.atlassian.confluence.pages.Page} object.
* @return the content of the specification at the implemented version.
* @throws com.greenpepper.server.GreenPepperServerException if any.
*/
public AbstractPage getImplementedPage(Page page) throws GreenPepperServerException {
Integer version = getImplementedVersion(page);
if (version == null)
throw new GreenPepperServerException(NEVER_IMPLEMENTED, "Never Implemented");
return getPageManager().getPageByVersion(page, version);
}
示例5: getPageContent
import com.atlassian.confluence.pages.AbstractPage; //导入依赖的package包/类
public String getPageContent(Page currentPage, Boolean implementedVersion) throws LivingDocServerException {
AbstractPage page = currentPage;
if (implementedVersion) {
page = getImplementedPage(currentPage);
}
return page.getBodyAsString();
}
示例6: getImplementedPage
import com.atlassian.confluence.pages.AbstractPage; //导入依赖的package包/类
/**
* Retrieves the content of the specification at the implemented version.
*
* @param page
* @return the content of the specification at the implemented version.
* @throws LivingDocServerException
*/
public AbstractPage getImplementedPage(Page page) throws LivingDocServerException {
Integer version = getImplementedVersion(page);
if (version == null)
throw new LivingDocServerException(NEVER_IMPLEMENTED, "Never Implemented");
return getPageManager().getPageByVersion(page, version);
}
示例7: containsPageMacro
import com.atlassian.confluence.pages.AbstractPage; //导入依赖的package包/类
private boolean containsPageMacro(AbstractPage page) {
String content = page.getBodyAsString();
return StringUtils.contains(content, LivingDocPage.MACRO_KEY);
}
示例8: getPageContent
import com.atlassian.confluence.pages.AbstractPage; //导入依赖的package包/类
/**
* <p>getPageContent.</p>
*
* @param currentPage a {@link com.atlassian.confluence.pages.Page} object.
* @param implementedVersion a {@link java.lang.Boolean} object.
* @return a {@link java.lang.String} object.
* @throws com.greenpepper.server.GreenPepperServerException if any.
*/
public String getPageContent(Page currentPage, Boolean implementedVersion) throws GreenPepperServerException {
AbstractPage page = currentPage;
if (implementedVersion) {
page = getImplementedPage(currentPage);
}
return getBodyTypeAwareRenderer().render(page);
}