WikiServiceImpl implements WikiService { @Override public WikiPageInfo createWikiPage(String siteShortName, String title, String content) { NodeRef container = getSiteWikiContainer(siteShortName, true); String name = buildName(title); Map<QName, Serializable> props = new HashMap<QName, Serializable>(); props.put(ContentModel.PROP_NAME, name); props.put(ContentModel.PROP_TITLE, title); NodeRef nodeRef = nodeService.createNode( container, ContentModel.ASSOC_CONTAINS, QName.createQName(name), ContentModel.TYPE_CONTENT, props ).getChildRef(); ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true); writer.setEncoding("UTF-8"); writer.putContent(content); return buildPage(nodeRef, container, name, content); }  void setNodeDAO(NodeDAO nodeDAO); void setNodeService(NodeService nodeService); void setSiteService(SiteService siteService); void setContentService(ContentService contentService); void setTaggingService(TaggingService taggingService); void setFileFolderService(FileFolderService fileFolderService); void setTransactionService(TransactionService transactionService); void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry); @Override WikiPageInfo getWikiPage(String siteShortName, String pageName); @Override WikiPageInfo createWikiPage(String siteShortName, String title,
          String content); @Override WikiPageInfo updateWikiPage(WikiPageInfo page); @Override void deleteWikiPage(WikiPageInfo page); @Override PagingResults<WikiPageInfo> listWikiPages(String siteShortName, PagingRequest paging); @Override PagingResults<WikiPageInfo> listWikiPages(String siteShortName, String user,
          PagingRequest paging); @Override PagingResults<WikiPageInfo> listWikiPagesByCreated(String siteShortName, 
          Date from, Date to, PagingRequest paging); @Override PagingResults<WikiPageInfo> listWikiPagesByModified(String siteShortName, 
          Date from, Date to, PagingRequest paging); PagingResults<WikiPageInfo> listWikiPages(String siteShortName, String username, 
          Date createdFrom, Date createdTo, Date modifiedFrom, Date modifiedTo, PagingRequest paging); static final String WIKI_COMPONENT; }
@Test public void newContainerSetup() throws Exception { final String TEST_SITE_NAME = "WikiTestNewTestSite"; TRANSACTION_HELPER.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { if(SITE_SERVICE.getSite(TEST_SITE_NAME) != null) { SITE_SERVICE.deleteSite(TEST_SITE_NAME); } SITE_SERVICE.createSite( TEST_SITE_PREFIX, TEST_SITE_NAME, "Test", "Test", SiteVisibility.PUBLIC); assertFalse(SITE_SERVICE.hasContainer(TEST_SITE_NAME, WikiServiceImpl.WIKI_COMPONENT)); WIKI_SERVICE.createWikiPage( TEST_SITE_NAME, "Title", "TextTextText"); assertTrue(SITE_SERVICE.hasContainer(TEST_SITE_NAME, WikiServiceImpl.WIKI_COMPONENT)); NodeRef container = SITE_SERVICE.getContainer(TEST_SITE_NAME, WikiServiceImpl.WIKI_COMPONENT); assertTrue(TAGGING_SERVICE.isTagScope(container)); SITE_SERVICE.deleteSite(TEST_SITE_NAME); return null; } }); }