ALF-9157 stub out a new wiki service

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29526 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-08-03 14:44:48 +00:00
parent 98028807a9
commit 7f54672204
3 changed files with 345 additions and 0 deletions

View File

@@ -0,0 +1,160 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.wiki;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.wiki.WikiPageInfo;
/**
* An implementation of {@link WikiPageInfo}
*
* @author Nick Burch (based on existing webscript controllers in the REST API)
* @since 4.0
*/
public class WikiPageInfoImpl implements WikiPageInfo
{
private NodeRef nodeRef;
private NodeRef containerNodeRef;
private String systemName;
private String title;
private String contents;
private String creator;
private String modifier;
private Date createdAt;
private Date modifiedAt;
private List<String> tags = new ArrayList<String>();
/**
* Creates a new, empty WikiPageInfo
*/
public WikiPageInfoImpl()
{
}
/**
* Create a WikiPageInfo object from an existing node
*/
public WikiPageInfoImpl(NodeRef nodeRef, NodeRef containerNodeRef, String systemName)
{
this.nodeRef = nodeRef;
this.containerNodeRef = containerNodeRef;
this.systemName = systemName;
}
@Override
public NodeRef getContainerNodeRef()
{
return containerNodeRef;
}
@Override
public NodeRef getNodeRef()
{
return nodeRef;
}
@Override
public String getSystemName()
{
return systemName;
}
@Override
public String getTitle()
{
return title;
}
@Override
public String getContents()
{
return contents;
}
@Override
public String getCreator()
{
return creator;
}
@Override
public String getModifier()
{
return modifier;
}
@Override
public Date getCreatedAt()
{
return createdAt;
}
@Override
public Date getModifiedAt()
{
return modifiedAt;
}
@Override
public List<String> getTags()
{
return tags;
}
@Override
public void setTitle(String title)
{
this.title = title;
}
@Override
public void setContents(String contents)
{
this.contents = contents;
}
public void setCreator(String creator)
{
this.creator = creator;
}
public void setModifier(String modifier)
{
this.modifier = modifier;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public void setModifiedAt(Date modifiedAt)
{
this.modifiedAt = modifiedAt;
}
public void setTags(List<String> tags)
{
this.tags = tags;
}
}

View File

@@ -0,0 +1,94 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.service.cmr.wiki;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.alfresco.repo.security.permissions.PermissionCheckValue;
import org.alfresco.service.cmr.repository.NodeRef;
/**
* This class represents a Wiki Paeg in a site
*
* @author Nick Burch
* @since 4.0
*/
public interface WikiPageInfo extends Serializable, PermissionCheckValue {
/**
* @return the NodeRef of the underlying wiki page
*/
NodeRef getNodeRef();
/**
* @return the NodeRef of the site container this belongs to
*/
NodeRef getContainerNodeRef();
/**
* @return the name of the wiki page
*/
String getSystemName();
/**
* @return the Title of the wiki page
*/
String getTitle();
/**
* Sets the Title of the wiki page
*/
void setTitle(String title);
/**
* @return the HTML Content of the wiki page
*/
String getContents();
/**
* Sets the (HTML) Content of the wiki page
*/
void setContents(String contentHTML);
/**
* @return the creator of the wiki page
*/
String getCreator();
/**
* @return the modifier of the wiki page
*/
String getModifier();
/**
* @return the creation date and time
*/
Date getCreatedAt();
/**
* @return the modification date and time
*/
Date getModifiedAt();
/**
* @return the Tags associated with the wiki page
*/
List<String> getTags();
}

View File

@@ -0,0 +1,91 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.service.cmr.wiki;
import java.util.Date;
import org.alfresco.query.PagingRequest;
import org.alfresco.query.PagingResults;
import org.alfresco.service.NotAuditable;
/**
* The Wiki Page service.
*
* @author Nick Burch
* @since 4.0
*/
public interface WikiPageService {
/**
* Creates a new {@link WikiPageInfo} in the given site, with the
* specified contents
*
* @return The newly created {@link WikiPageInfo}
*/
@NotAuditable
WikiPageInfo createWikiPage(String siteShortName, String title,
String contents);
/**
* Updates an existing {@link WikiPageInfo} in the repository.
*
* @return The updated {@link WikiPageInfo}
*/
@NotAuditable
WikiPageInfo updateWikiPage(WikiPageInfo wikiPage);
/**
* Deletes an existing {@link WikiPageInfo} from the repository
*/
@NotAuditable
void deleteWikiPage(WikiPageInfo wikiPage);
/**
* Retrieves an existing {@link WikiPageInfo} from the repository
*/
@NotAuditable
WikiPageInfo getWikiPage(String siteShortName, String pageTitle);
/**
* Retrieves all {@link WikiPageInfo} instances in the repository
* for the given site.
*/
@NotAuditable
PagingResults<WikiPageInfo> listWikiPages(String siteShortName, PagingRequest paging);
/**
* Retrieves all {@link WikiPageInfo} instances in the repository
* for the given site and the specified user.
*/
@NotAuditable
PagingResults<WikiPageInfo> listWikiPages(String siteShortName, String user, PagingRequest paging);
/**
* Retrieves all {@link WikiPageInfo} instances in the repository
* for the given site, created in the specified date range
*/
@NotAuditable
PagingResults<WikiPageInfo> listWikiPagesByCreated(String siteShortName, Date from, Date to, PagingRequest paging);
/**
* Retrieves all {@link WikiPageInfo} instances in the repository
* for the given site, modified in the specified date range
*/
@NotAuditable
PagingResults<WikiPageInfo> listWikiPagesByModified(String siteShortName, Date from, Date to, PagingRequest paging);
}