jackrabbit学习笔记

1.给内容仓库增加新的结点:

 

Repository repository = new URLRemoteRepository(
					"http://localhost:8080/jackrabbit-webapp-1.5.4/rmi");
javax.jcr.Credentials creds = new SimpleCredentials("root", "root"
					.toCharArray());
Session session = repository.login(creds);

Workspace ws = session.getWorkspace();
Node rootNode = session.getRootNode();
			
//增加新的结点
TestJackrabbit tj = new TestJackrabbit();
BlogEntryDTO blogEntryDTO = tj.new BlogEntryDTO();
			
Node blogEntry = rootNode.addNode("blogEntry");
blogEntry.setProperty("title", blogEntryDTO.getTitle());
blogEntry.setProperty("blogContent", blogEntryDTO.getBlogContent());
blogEntry.setProperty("creationTime", blogEntryDTO
					.getCreationTime());
blogEntry.setProperty("userName", blogEntryDTO.getUserName());
session.save();
 

 

TODO:

实现文件的上传,显示,下载,修改

 

你可能感兴趣的:(学习笔记)