`
yiyiboy2010
  • 浏览: 132192 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Jackrabbit学习笔记1

阅读更多

        最近软件测评中心有一个项目要做,Ext方面的人不够用,正好Ext我自学过一些,就去做了兼职,正好就聊起了他们那个项目,感觉还是蛮大的,主要是一个公司的内部系统,好像是什么平台管理的还有一个CRM还有其他的子系统,反正听他讲还是蛮复杂的,他们现在在做需求,正式编码要到12月份的样子,现在的时间我们正好去熟悉下jackrabbit。

        以前从来没有接触过jackrabbit这个项目,今天搞了好久,看了很多学习jackrabbit的博客,但是进展很小,最后无奈又回到官网上了,慢慢发现其实官网上面的介绍还是蛮好的。就把这个学习笔记记录了下来,以后如果有可能看的话,就再来看。

        好了废话少说,还是一步步讲步骤吧。首先需要下载jackrabbit相关的资源,去官网的话当然没有问题,可是实际操作的时候总是会发现有些文件下载失败,所以推荐去人人网下载:http://labs.renren.com/apache-mirror//jackrabbit/

        在这个链接下面选择一个下载,新版本的话可能会好一些,所以我下载的是2.2.9(2.3.0现在还不稳定)。

        下载完之后在MyEclipse下面新建一个Web项目,如下图所示:


        注意添加Maven的支持,并且这是官网推荐的,需要说明的是第一次加载该项目的时候可能会很慢,MyEclipse会去官网上面下载一些文件,这个我们不用去关心。

        然后就将上面下载的一个jackrabbit-standalone-2.2.9.jar文件拷贝到lib下面,然后引入该包,就可以使用jackrabbit的东西了。

        新建一个测试的类,如下图所示



代码如下:

 

package com.jackrabbit.demo;

import javax.jcr.Repository;
import javax.jcr.Session;

import org.apache.jackrabbit.core.TransientRepository;

/** * First hop example. Logs in to a content repository and prints a status
 * message.
 */
public class FirstHop {
	public static void main(String[] args) throws Exception {
		Repository repository = new TransientRepository();
		Session session = repository.login();
		try {
			String user = session.getUserID();
			String name = repository.getDescriptor(Repository.REP_NAME_DESC);
			System.out.println("Logged in as " + user + " to a " + name
					+ " repository.");
			System.out.println("登录仓库身份:"+user+",登录名为:"+name);
		} finally {
			session.logout();
		}
	}
}

 运行该程序,可见到结果:

 

Logged in as anonymous to a Jackrabbit repository.

登录仓库身份:anonymous,登录名为:Jackrabbit

这就表明我们成功使用jackrabbit实现了第一个程序!

然后继续:新建第二个测试类SecondHop.java,代码如下:

 

package com.jackrabbit.demo;

import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;

import org.apache.jackrabbit.core.TransientRepository;

public class SecondHop {
	public static void main(String[] args) throws Exception {
		Repository repository = new TransientRepository();
		Session session = repository.login(new SimpleCredentials("username",
				"password".toCharArray()));
		try {
			Node root = session.getRootNode();

			// Store content
			Node hello = root.addNode("hello");
			Node world = hello.addNode("world");
			world.setProperty("message", "Hello, World!");
			session.save();

			// Retrieve content
			Node node = root.getNode("hello/world");
			System.out.println(node.getPath());
			System.out.println(node.getProperty("message").getString());

			// Remove content
			root.getNode("hello").remove();
			session.save();
		} finally {
			session.logout();
		}
	}
}
 

运行结果为:

/hello/world

Hello, World!

新建第三个测试类:ThirdHop.java,代码如下:

 

package com.jackrabbit.demo;

import java.io.FileInputStream;

import javax.jcr.ImportUUIDBehavior;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import javax.jcr.Value;

import org.apache.jackrabbit.core.TransientRepository;

public class ThirdHop {
	public static void main(String[] args) throws Exception {
		Repository repository = new TransientRepository();
		Session session = repository.login(new SimpleCredentials("username",
				"password".toCharArray()));
		try {
			Node root = session.getRootNode();

			// Import the XML file unless already imported
			if (!root.hasNode("importxml")) {
				System.out.print("Importing xml... ");

				// Create an unstructured node under which to import the XML
				Node node = root.addNode("importxml", "nt:unstructured");

				// Import the file "test.xml" under the created node
				FileInputStream xml = new FileInputStream("test.xml");
				session.importXML(node.getPath(), xml,
						ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
				xml.close();
				session.save();
				System.out.println("done.");
			}

			// output the repository content
			dump(root);
		} finally {
			session.logout();
		}
	}

	/** Recursively outputs the contents of the given node. */
	private static void dump(Node node) throws RepositoryException {
		// First output the node path
		System.out.println(node.getPath());
		// Skip the virtual (and large!) jcr:system subtree
		if (node.getName().equals("jcr:system")) {
			return;
		}

		// Then output the properties
		PropertyIterator properties = node.getProperties();
		while (properties.hasNext()) {
			Property property = properties.nextProperty();
			if (property.getDefinition().isMultiple()) {
				// A multi-valued property, print all values
				Value[] values = property.getValues();
				for (int i = 0; i < values.length; i++) {
					System.out.println(property.getPath() + " = "
							+ values[i].getString());
				}
			} else {
				// A single-valued property
				System.out.println(property.getPath() + " = "
						+ property.getString());
			}
		}

		// Finally output all the child nodes recursively
		NodeIterator nodes = node.getNodes();
		while (nodes.hasNext()) {
			dump(nodes.nextNode());
		}
	}

}
 

同时新建一个test.xml文件:放在和src平行的目录下,内容如下:

 

<?xml version="1.0" encoding="UTF-8"?>
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
	xmlns:mathml="http://www.w3.org/1998/Math/MathML">
	<xhtml:head>
		<xhtml:title>Three Namespaces</xhtml:title>
	</xhtml:head>
	<xhtml:body>
		<xhtml:h1 align="center">An Ellipse and a Rectangle</xhtml:h1>
		<svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="12cm"
			height="10cm">
			<svg:ellipse rx="110" ry="130" />
			<svg:rect x="4cm" y="1cm" width="3cm" height="6cm" />
		</svg:svg>
		<xhtml:p>The equation for ellipses</xhtml:p>
		<mathml:math>
			<mathml:apply>
				<mathml:eq />
				<mathml:cn> 1 </mathml:cn>
				<mathml:apply>
					<mathml:plus />
					<mathml:apply>
						<mathml:divide />
						<mathml:apply>
							<mathml:power />
							<mathml:ci> x </mathml:ci>
							<mathml:cn> 2 </mathml:cn>
						</mathml:apply>
						<mathml:apply>
							<mathml:power />
							<mathml:ci> a </mathml:ci>
							<mathml:cn> 2 </mathml:cn>
						</mathml:apply>
					</mathml:apply>
					<mathml:apply>
						<mathml:divide />
						<mathml:apply>
							<mathml:power />
							<mathml:ci> y </mathml:ci>
							<mathml:cn> 2 </mathml:cn>
						</mathml:apply>
						<mathml:apply>
							<mathml:power />
							<mathml:ci> b </mathml:ci>
							<mathml:cn> 2 </mathml:cn>
						</mathml:apply>
					</mathml:apply>
				</mathml:apply>
			</mathml:apply>
		</mathml:math>
		<xhtml:hr />
		<xhtml:p>Last Modified January 10, 2002</xhtml:p>
	</xhtml:body>
</xhtml:html>

 然后运行该程序,结果如下:

 

Importing xml... done.
/
/jcr:primaryType = rep:root
/jcr:system
/importxml
/importxml/jcr:primaryType = nt:unstructured
/importxml/xhtml:html
/importxml/xhtml:html/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:head
/importxml/xhtml:html/xhtml:head/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:head/xhtml:title
/importxml/xhtml:html/xhtml:head/xhtml:title/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:head/xhtml:title/jcr:xmltext
/importxml/xhtml:html/xhtml:head/xhtml:title/jcr:xmltext/jcr:xmlcharacters = Three Namespaces
/importxml/xhtml:html/xhtml:head/xhtml:title/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body
/importxml/xhtml:html/xhtml:body/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/xhtml:h1
/importxml/xhtml:html/xhtml:body/xhtml:h1/align = center
/importxml/xhtml:html/xhtml:body/xhtml:h1/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/xhtml:h1/jcr:xmltext
/importxml/xhtml:html/xhtml:body/xhtml:h1/jcr:xmltext/jcr:xmlcharacters = An Ellipse and a Rectangle
/importxml/xhtml:html/xhtml:body/xhtml:h1/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/svg:svg
/importxml/xhtml:html/xhtml:body/svg:svg/width = 12cm
/importxml/xhtml:html/xhtml:body/svg:svg/height = 10cm
/importxml/xhtml:html/xhtml:body/svg:svg/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/svg:svg/svg:ellipse
/importxml/xhtml:html/xhtml:body/svg:svg/svg:ellipse/ry = 130
/importxml/xhtml:html/xhtml:body/svg:svg/svg:ellipse/rx = 110
/importxml/xhtml:html/xhtml:body/svg:svg/svg:ellipse/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/svg:svg/svg:rect
/importxml/xhtml:html/xhtml:body/svg:svg/svg:rect/x = 4cm
/importxml/xhtml:html/xhtml:body/svg:svg/svg:rect/y = 1cm
/importxml/xhtml:html/xhtml:body/svg:svg/svg:rect/width = 3cm
/importxml/xhtml:html/xhtml:body/svg:svg/svg:rect/height = 6cm
/importxml/xhtml:html/xhtml:body/svg:svg/svg:rect/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/xhtml:p
/importxml/xhtml:html/xhtml:body/xhtml:p/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/xhtml:p/jcr:xmltext
/importxml/xhtml:html/xhtml:body/xhtml:p/jcr:xmltext/jcr:xmlcharacters = The equation for ellipses
/importxml/xhtml:html/xhtml:body/xhtml:p/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math
/importxml/xhtml:html/xhtml:body/mathml:math/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:eq
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:eq/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:cn
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:cn/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:cn/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:cn/jcr:xmltext/jcr:xmlcharacters =  1 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:cn/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:plus
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:plus/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:divide
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:divide/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:power
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:power/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:ci
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:ci/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:ci/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:ci/jcr:xmltext/jcr:xmlcharacters =  x 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:ci/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:cn
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:cn/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:cn/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:cn/jcr:xmltext/jcr:xmlcharacters =  2 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply/mathml:cn/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:power
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:power/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:ci
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:ci/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:ci/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:ci/jcr:xmltext/jcr:xmlcharacters =  a 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:ci/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:cn
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:cn/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:cn/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:cn/jcr:xmltext/jcr:xmlcharacters =  2 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply/mathml:apply[2]/mathml:cn/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:divide
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:divide/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:power
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:power/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:ci
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:ci/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:ci/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:ci/jcr:xmltext/jcr:xmlcharacters =  y 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:ci/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:cn
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:cn/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:cn/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:cn/jcr:xmltext/jcr:xmlcharacters =  2 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply/mathml:cn/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:power
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:power/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:ci
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:ci/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:ci/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:ci/jcr:xmltext/jcr:xmlcharacters =  b 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:ci/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:cn
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:cn/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:cn/jcr:xmltext
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:cn/jcr:xmltext/jcr:xmlcharacters =  2 
/importxml/xhtml:html/xhtml:body/mathml:math/mathml:apply/mathml:apply/mathml:apply[2]/mathml:apply[2]/mathml:cn/jcr:xmltext/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/xhtml:hr
/importxml/xhtml:html/xhtml:body/xhtml:hr/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/xhtml:p[2]
/importxml/xhtml:html/xhtml:body/xhtml:p[2]/jcr:primaryType = nt:unstructured
/importxml/xhtml:html/xhtml:body/xhtml:p[2]/jcr:xmltext
/importxml/xhtml:html/xhtml:body/xhtml:p[2]/jcr:xmltext/jcr:xmlcharacters = Last Modified January 10, 2002
/importxml/xhtml:html/xhtml:body/xhtml:p[2]/jcr:xmltext/jcr:primaryType = nt:unstructured

 至此,jackrabbit的3个测试类已经完成,需要用到高级的东西时候就要参考其他的文件,这些内容以后学到了再写。


 

  • 大小: 74.8 KB
  • 大小: 71.7 KB
2
1
分享到:
评论

相关推荐

    JackRabbit 学习参考资料总汇

    1. JackRabbit安装与配置:需要引入一系列的JAR包,这些包包括核心的JackRabbit API库、JackRabbit核心实现、JCR标准接口库、以及支持库如日志处理(log4j和slf4j)、数据库连接(derby)、以及Lucene搜索引擎组件等...

    jackrabbit最全入门教程

    在入门教程中,你将学习如何安装和配置Jackrabbit,以及如何使用Java API(JCR API)进行基本操作,如创建、读取、更新和删除节点。这通常涉及以下步骤: 1. **环境准备**:安装Java运行环境,下载并解压Jackrabbit...

    jackrabbit

    ### Jackrabbit 在项目实施中的常见问题与解决方案 #### 一、Jackrabbit简介 Jackrabbit 是一个完全用 Java 编写的 JCR(Java Content Repository)实现,它可以作为一个独立的服务运行,也可以嵌入到更大的应用...

    Jackrabbit学习篇

    ### Jackrabbit核心包详解 #### 一、概述 在探讨Jackrabbit的核心包——`jackrabbit-core`之前,我们首先简要回顾一下Jackrabbit的基本概念及其重要性。Jackrabbit是一款开源的内容管理系统,支持Java内容库(JCR...

    jackrabbit-standalone-1.5.6.jar jackrabbit 开发包

    jackrabbit 1.5.6 jar

    Jackrabbit API

    通过阅读这些文档,开发者可以学习如何初始化Repository,创建和管理Session,操作Nodes和Properties,执行查询,以及如何利用Jackrabbit提供的其他高级特性。 在实际应用中,Apache Jackrabbit常被用作企业级内容...

    查看jackrabbit仓库的小工具

    标题中的“查看jackrabbit仓库的小工具”指的是一个用于观察和管理Apache Jackrabbit仓库的实用程序。Jackrabbit是Java Content Repository (JCR) API的一个开源实现,它提供了一个内容管理系统(CMS)的基础框架,...

    Jackrabbit入门实例

    Apache Jackrabbit是一个开源的、实现了Java Content ...总之,这个"Jackrabbit入门实例"是学习和探索JCR和Jackrabbit的好起点,它涵盖了基本的操作和概念,帮助你快速上手并深入了解这个强大的内容管理系统。

    jackrabbit-standalone

    jackrabbit-standalone-1.6.5.jar是webDav的支持jar包。

    jackrabbit教程

    在学习 Jackrabbit 时,了解其核心概念至关重要: 1. **Repository(存储库)**: 存储库是所有内容的容器,通过 JNDI(Java Naming and Directory Interface)进行访问。在示例代码中,使用 `TransientRepository` ...

    jackrabbit2.6

    1. **JCR(Java Content Repository)规范**:JCR 是一个由Java Community Process(JCP)制定的标准,定义了访问和管理内容仓库的API。它允许开发人员创建、修改和查询存储在内容仓库中的数据,这些数据可以是文档...

    深入浅出 jackrabbit 1

    《深入浅出 Jackrabbit 1》 Jackrabbit 是一个开源的、实现了 Java Content Repository (JCR) API 的内容管理系统,它允许程序通过统一的方式访问、存储和管理各种数据,包括文本、图像、视频等多媒体信息。这篇...

    Apache Jackrabbit入门

    1. 安装与依赖:引入jcr-2.0.jar到项目中,这是Jackrabbit的核心库。如果需要使用API进行操作,还需要添加相应的Jackrabbit模块,如jackrabbit-api和jackrabbit-client。 2. 创建Repository:首先,需要实例化...

    jackrabbit-webdav-2.3.2.src.zip

    通过深入理解和使用"jackrabbit-webdav-2.3.2.src.zip"中的源代码,开发者不仅可以学习WebDAV协议的工作原理,还能了解如何在Android环境中实现高效稳定的WebDAV客户端功能。此外,对于想要对Jackrabbit进行定制化...

    jackrabbit内容仓库的实例(两个工程)

    1. Jackrabbit核心概念: - JCR:JSR 170定义了内容存储的标准接口,使得应用程序可以透明地访问和操作不同类型的存储系统。 - Node:在JCR中,内容被组织成节点,类似于文件系统的文件和目录。 - Property:节点...

    jackrabbit-webdav-2.7.1.zip

    1. Apache Jackrabbit:它是JCR规范的实现,提供了一个内容存储库,可以用来存储各种类型的数据。 2. WebDAV:这是一种增强HTTP协议的协议,允许用户远程编辑和管理文件,Jackrabbit的WebDAV模块提供了与内容存储库...

    jackrabbit-api-1.5.0.jar

    jackrabbit-api-1.5.0.jar

    jackrabbit-jcr-commons-2.5.0.zip

    标签"开源项目"表明这个库是开放源码的,这意味着开发者可以查看其源代码,学习内部实现,甚至参与到项目的改进和扩展中。开源项目通常拥有活跃的社区支持,开发者可以从中获得帮助,或者贡献自己的代码来改善项目。...

    jackrabbit-core-1.5.5.jar

    jackrabbit-core-1.5.5.jar

Global site tag (gtag.js) - Google Analytics