X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=server%2Fruntime%2Forg.argeo.server.jackrabbit%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fserver%2Fjackrabbit%2FJackrabbitContainer.java;h=ef96b3595d153ba10aaa877704c5277074ceb9de;hb=73121781a9ee5c08891beaf4ab714cd728e586b2;hp=f6ae9357e201457a6eb8f439088b807f078f2b1b;hpb=a7c020ac67bc460cf65cf1fd18bc267f795f6c50;p=lgpl%2Fargeo-commons.git diff --git a/server/runtime/org.argeo.server.jackrabbit/src/main/java/org/argeo/server/jackrabbit/JackrabbitContainer.java b/server/runtime/org.argeo.server.jackrabbit/src/main/java/org/argeo/server/jackrabbit/JackrabbitContainer.java index f6ae9357e..ef96b3595 100644 --- a/server/runtime/org.argeo.server.jackrabbit/src/main/java/org/argeo/server/jackrabbit/JackrabbitContainer.java +++ b/server/runtime/org.argeo.server.jackrabbit/src/main/java/org/argeo/server/jackrabbit/JackrabbitContainer.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Mathieu Baudier + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.argeo.server.jackrabbit; import java.io.File; @@ -9,6 +25,7 @@ import javax.jcr.NoSuchWorkspaceException; import javax.jcr.Repository; import javax.jcr.RepositoryException; import javax.jcr.Session; +import javax.jcr.Value; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -21,6 +38,10 @@ import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; +/** + * Wrapper around a Jackrabbit repository which allows to configure it in Spring + * and expose it as a {@link Repository}. + */ public class JackrabbitContainer implements InitializingBean, DisposableBean, Repository { private Log log = LogFactory.getLog(JackrabbitContainer.class); @@ -41,8 +62,8 @@ public class JackrabbitContainer implements InitializingBean, DisposableBean, RepositoryConfig config; InputStream in = configuration.getInputStream(); try { - config = RepositoryConfig.create(in, homeDirectory - .getCanonicalPath()); + config = RepositoryConfig.create(in, + homeDirectory.getCanonicalPath()); } catch (Exception e) { throw new RuntimeException("Cannot read configuration", e); } finally { @@ -106,6 +127,22 @@ public class JackrabbitContainer implements InitializingBean, DisposableBean, return repository.login(workspaceName); } + public boolean isStandardDescriptor(String key) { + return repository.isStandardDescriptor(key); + } + + public boolean isSingleValueDescriptor(String key) { + return repository.isSingleValueDescriptor(key); + } + + public Value getDescriptorValue(String key) { + return repository.getDescriptorValue(key); + } + + public Value[] getDescriptorValues(String key) { + return repository.getDescriptorValues(key); + } + // BEANS METHODS public void setHomeDirectory(File homeDirectory) { this.homeDirectory = homeDirectory;