You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by Apache Wiki <wi...@apache.org> on 2006/03/29 23:16:23 UTC
[Jackrabbit Wiki] Update of "ExamplesPage" by RoyFielding
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.
The following page has been changed by RoyFielding:
http://wiki.apache.org/jackrabbit/ExamplesPage
The comment on the change is:
format and wording
------------------------------------------------------------------------------
- This page will be used to show solutions to common problems related to JSR 170 and Jackrabbit. These examples shouldn't necessarily be considered Best Practices - general error checking and exception handling have been omitted to keep the example code simple.
+ == Apache Jackrabbit Examples ==
- Please feel free to add your own samples (which are not explicitly covered in the JSR170 Spec or the main Jackrabbit site).
+ This page will be used to show solutions to common problems related to Apache Jackrabbit
+ and the JCR API. These examples shouldn't be considered Best Practices - general error checking
+ and exception handling have been omitted to keep the example code simple.
- ==============
+ Please feel free to add your own examples.
+ -----
+
+ === Importing a File ===
+
- '''Importing a File''' - also see: [http://svn.apache.org/repos/asf/incubator/jackrabbit/trunk/contrib/examples/src/java/org/apache/jackrabbit/examples/FSImport.java FSImport.java] for more complete filesystem examples.
+ Also see: [http://svn.apache.org/repos/asf/jackrabbit/trunk/contrib/examples/src/java/org/apache/jackrabbit/examples/FSImport.java FSImport.java] for more complete filesystem examples.
{{{
public Node importFile (Node folderNode, File file, String mimeType,
@@ -29, +35 @@
}}}
+ === Renaming a Node ===
-
- '''Renaming a Node'''
{{{
void rename(Node node, String newName) throws RepositoryException
{
@@ -41, +46 @@
+ === Register a Node Type ===
- '''Register a Node type''' - there are a few solutions in the works [http://svn.osafoundation.org/server/commons/trunk/jackrabbit/ Offline tool], [http://issues.apache.org/jira/browse/GRFT-23 Graffito Jira Issue]
+ There are a few solutions in the works. For example, see [http://svn.osafoundation.org/server/commons/trunk/jackrabbit/ OSAF offline tool], [http://issues.apache.org/jira/browse/GRFT-23 Graffito Jira Issue].
{{{
public void registerNodeType(NodeTypeDef nodeTypeDef, Session session) throws RepositoryException
@@ -59, +65 @@
}}}
+ === Versioning Basics ===
-
- '''Versioning basics'''
{{{
public void versioningBasics (Node parentNode, Session session) throws RepositoryException
{
@@ -93, +98 @@
}}}
- '''Creating a Workspace'''
+ === Creating a Workspace ===
+
{{{
((org.apache.jackrabbit.core.WorkspaceImpl)workspace).createWorkspace(name);
}}}
- '''Deleting a Workspace'''
+ === Deleting a Workspace ===
+
{{{
You have to manually remove the workspace.xml - there's no programmatic way yet.
}}}
- '''Shutting down the Repository'''
+ === Shutting Down the Repository ===
+
{{{
javax.jcr.Session session = ...;
((org.apache.jackrabbit.core.RepositoryImpl) session.getRepository()).shutdown();