mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
ALF-9799 Avoid links and wiki container node wrapping, and handle the case of a listing before any writes (so the container has yet to be created)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29627 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,12 +24,11 @@ import java.util.Map;
|
||||
|
||||
import org.alfresco.query.PagingRequest;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.jscript.ScriptNode;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.activities.ActivityService;
|
||||
import org.alfresco.service.cmr.links.LinkInfo;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
import org.alfresco.service.cmr.site.SiteService;
|
||||
import org.alfresco.service.cmr.wiki.WikiPageInfo;
|
||||
@@ -64,8 +63,8 @@ public abstract class AbstractWikiWebScript extends DeclarativeWebScript
|
||||
protected NodeService nodeService;
|
||||
protected SiteService siteService;
|
||||
protected WikiService wikiService;
|
||||
protected PersonService personService;
|
||||
protected ActivityService activityService;
|
||||
protected ServiceRegistry serviceRegistry;
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -82,16 +81,16 @@ public abstract class AbstractWikiWebScript extends DeclarativeWebScript
|
||||
this.wikiService = wikiService;
|
||||
}
|
||||
|
||||
public void setPersonService(PersonService personService)
|
||||
{
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
public void setActivityService(ActivityService activityService)
|
||||
{
|
||||
this.activityService = activityService;
|
||||
}
|
||||
|
||||
public void setServiceRegistry(ServiceRegistry serviceRegistry)
|
||||
{
|
||||
this.serviceRegistry = serviceRegistry;
|
||||
}
|
||||
|
||||
|
||||
protected String getOrNull(JSONObject json, String key) throws JSONException
|
||||
{
|
||||
@@ -195,9 +194,9 @@ public abstract class AbstractWikiWebScript extends DeclarativeWebScript
|
||||
return "";
|
||||
}
|
||||
|
||||
// Script Node needed of the person
|
||||
NodeRef person = serviceRegistry.getPersonService().getPerson(username);
|
||||
return new ScriptNode(person, serviceRegistry);
|
||||
// Will turn into a Script Node needed of the person
|
||||
NodeRef person = personService.getPerson(username);
|
||||
return person;
|
||||
}
|
||||
|
||||
protected Map<String, Object> renderWikiPage(WikiPageInfo page)
|
||||
|
@@ -142,9 +142,18 @@ public class WikiPageListGet extends AbstractWikiWebScript
|
||||
}
|
||||
else
|
||||
{
|
||||
// Find the container (if it's been created yet)
|
||||
container = siteService.getContainer(
|
||||
site.getShortName(), WikiServiceImpl.WIKI_COMPONENT
|
||||
);
|
||||
|
||||
if(container == null)
|
||||
{
|
||||
// Brand new site, no write operations on links have happened
|
||||
// Fudge it for now with the site itself, the first write call
|
||||
// will have the container created
|
||||
container = site.getNodeRef();
|
||||
}
|
||||
}
|
||||
|
||||
// All done
|
||||
|
Reference in New Issue
Block a user