Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52FD217873 for ; Mon, 6 Apr 2015 17:11:44 +0000 (UTC) Received: (qmail 26312 invoked by uid 500); 6 Apr 2015 17:11:44 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 26181 invoked by uid 500); 6 Apr 2015 17:11:44 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 24557 invoked by uid 99); 6 Apr 2015 17:11:43 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Apr 2015 17:11:42 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id E07D2AC0418 for ; Mon, 6 Apr 2015 17:11:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1671597 [15/23] - in /chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl: ./ css/ images/ images/logos/ xref-test/ xref-test/org/ xref-test/org/apache/ xref-test/org/apache/chemistry/ xr... Date: Mon, 06 Apr 2015 17:11:40 -0000 To: commits@chemistry.apache.org From: gabriele@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150406171142.E07D2AC0418@hades.apache.org> Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.html?rev=1671597&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.html Mon Apr 6 17:11:39 2015 @@ -0,0 +1,107 @@ + + + + +RelationshipImpl xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.client.runtime;
+20  
+21  import org.apache.chemistry.opencmis.client.api.CmisObject;
+22  import org.apache.chemistry.opencmis.client.api.ObjectId;
+23  import org.apache.chemistry.opencmis.client.api.ObjectType;
+24  import org.apache.chemistry.opencmis.client.api.OperationContext;
+25  import org.apache.chemistry.opencmis.client.api.Relationship;
+26  import org.apache.chemistry.opencmis.commons.PropertyIds;
+27  import org.apache.chemistry.opencmis.commons.data.ObjectData;
+28  
+29  public class RelationshipImpl extends AbstractCmisObject implements Relationship {
+30  
+31      private static final long serialVersionUID = 1L;
+32  
+33      /**
+34       * Constructor.
+35       */
+36      public RelationshipImpl(SessionImpl session, ObjectType objectType, ObjectData objectData, OperationContext context) {
+37          initialize(session, objectType, objectData, context);
+38      }
+39  
+40      public CmisObject getSource() {
+41          return getSource(getSession().getDefaultContext());
+42      }
+43  
+44      public CmisObject getSource(OperationContext context) {
+45          readLock();
+46          try {
+47              ObjectId sourceId = getSourceId();
+48              if (sourceId == null) {
+49                  return null;
+50              }
+51  
+52              return getSession().getObject(sourceId, context);
+53          } finally {
+54              readUnlock();
+55          }
+56      }
+57  
+58      public ObjectId getSourceId() {
+59          String sourceId = getPropertyValue(PropertyIds.SOURCE_ID);
+60          if ((sourceId == null) || (sourceId.length() == 0)) {
+61              return null;
+62          }
+63  
+64          return getSession().createObjectId(sourceId);
+65      }
+66  
+67      public CmisObject getTarget() {
+68          return getTarget(getSession().getDefaultContext());
+69      }
+70  
+71      public CmisObject getTarget(OperationContext context) {
+72          readLock();
+73          try {
+74              ObjectId targetId = getTargetId();
+75              if (targetId == null) {
+76                  return null;
+77              }
+78  
+79              return getSession().getObject(targetId, context);
+80          } finally {
+81              readUnlock();
+82          }
+83      }
+84  
+85      public ObjectId getTargetId() {
+86          String targetId = getPropertyValue(PropertyIds.TARGET_ID);
+87          if ((targetId == null) || (targetId.length() == 0)) {
+88              return null;
+89          }
+90  
+91          return getSession().createObjectId(targetId);
+92      }
+93  }
+
+
+ + Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.html?rev=1671597&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.html Mon Apr 6 17:11:39 2015 @@ -0,0 +1,136 @@ + + + + +RenditionImpl xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.client.runtime;
+20  
+21  import java.math.BigInteger;
+22  
+23  import org.apache.chemistry.opencmis.client.api.CmisObject;
+24  import org.apache.chemistry.opencmis.client.api.Document;
+25  import org.apache.chemistry.opencmis.client.api.OperationContext;
+26  import org.apache.chemistry.opencmis.client.api.Rendition;
+27  import org.apache.chemistry.opencmis.client.api.Session;
+28  import org.apache.chemistry.opencmis.client.bindings.spi.LinkAccess;
+29  import org.apache.chemistry.opencmis.commons.data.ContentStream;
+30  import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
+31  import org.apache.chemistry.opencmis.commons.impl.dataobjects.RenditionDataImpl;
+32  
+33  /**
+34   * Implementation of <code>Rendition</code>.
+35   */
+36  public class RenditionImpl extends RenditionDataImpl implements Rendition {
+37  
+38      private static final long serialVersionUID = 1L;
+39  
+40      private final Session session;
+41      private final String objectId;
+42  
+43      /**
+44       * Constructor.
+45       */
+46      public RenditionImpl(Session session, String objectId, String streamId, String renditionDocumentId, String kind,
+47              long length, String mimeType, String title, int height, int width) {
+48          super(streamId, mimeType, BigInteger.valueOf(length), kind, title, BigInteger.valueOf(width), BigInteger
+49                  .valueOf(height), renditionDocumentId);
+50          this.session = session;
+51          this.objectId = objectId;
+52      }
+53  
+54      public long getLength() {
+55          return getBigLength() == null ? -1 : getBigLength().longValue();
+56      }
+57  
+58      public long getHeight() {
+59          return getBigHeight() == null ? -1 : getBigHeight().longValue();
+60      }
+61  
+62      public long getWidth() {
+63          return getBigWidth() == null ? -1 : getBigWidth().longValue();
+64      }
+65  
+66      public Document getRenditionDocument() {
+67          return getRenditionDocument(session.getDefaultContext());
+68      }
+69  
+70      public Document getRenditionDocument(OperationContext context) {
+71          if (getRenditionDocumentId() == null) {
+72              return null;
+73          }
+74          CmisObject rendDoc = session.getObject(getRenditionDocumentId(), context);
+75          if (!(rendDoc instanceof Document)) {
+76              return null;
+77          }
+78  
+79          return (Document) rendDoc;
+80      }
+81  
+82      public ContentStream getContentStream() {
+83          if (objectId == null || getStreamId() == null) {
+84              return null;
+85          }
+86  
+87          ContentStream contentStream;
+88          try {
+89              contentStream = session.getBinding().getObjectService()
+90                      .getContentStream(session.getRepositoryInfo().getId(), objectId, getStreamId(), null, null, null);
+91          } catch (CmisConstraintException e) {
+92              // no content stream
+93              return null;
+94          }
+95  
+96          if (contentStream == null) {
+97              return null;
+98          }
+99  
+100         String filename = contentStream.getFileName();
+101         if (filename == null) {
+102             filename = getTitle();
+103         }
+104         BigInteger bigLength = contentStream.getBigLength();
+105         if (bigLength == null) {
+106             bigLength = getBigLength();
+107         }
+108         long length = bigLength == null ? -1 : bigLength.longValue();
+109 
+110         return session.getObjectFactory().createContentStream(filename, length, contentStream.getMimeType(),
+111                 contentStream.getStream());
+112     }
+113 
+114     public String getContentUrl() {
+115         if (session.getBinding().getObjectService() instanceof LinkAccess) {
+116             LinkAccess linkAccess = (LinkAccess) session.getBinding().getObjectService();
+117             return linkAccess.loadRenditionContentLink(session.getRepositoryInfo().getId(), objectId, getStreamId());
+118         }
+119 
+120         return null;
+121     }
+122 }
+
+
+ + Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.html?rev=1671597&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-client/chemistry-opencmis-client-impl/xref/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.html Mon Apr 6 17:11:39 2015 @@ -0,0 +1,159 @@ + + + + +SessionFactoryImpl xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.client.runtime;
+20  
+21  import java.io.Serializable;
+22  import java.util.ArrayList;
+23  import java.util.List;
+24  import java.util.Map;
+25  
+26  import org.apache.chemistry.opencmis.client.api.ObjectFactory;
+27  import org.apache.chemistry.opencmis.client.api.Repository;
+28  import org.apache.chemistry.opencmis.client.api.Session;
+29  import org.apache.chemistry.opencmis.client.api.SessionFactory;
+30  import org.apache.chemistry.opencmis.client.bindings.cache.TypeDefinitionCache;
+31  import org.apache.chemistry.opencmis.client.runtime.cache.Cache;
+32  import org.apache.chemistry.opencmis.client.runtime.repository.RepositoryImpl;
+33  import org.apache.chemistry.opencmis.commons.SessionParameter;
+34  import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+35  import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
+36  import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
+37  import org.apache.chemistry.opencmis.commons.spi.CmisBinding;
+38  
+39  /**
+40   * Default implementation of a session factory. Used by unit tests or
+41   * applications that depend directly on runtime implementation.
+42   * <p>
+43   * <code>
+44   * SessionFactory sf = new SessionFactoryImpl();<br>
+45   * Session s = sf.createSession(...);
+46   * </code>
+47   * <p>
+48   * Alternative factory lookup methods:
+49   * <p>
+50   * <p>
+51   * <code>
+52   * Context ctx = new DefaultContext();<br>
+53   * SessionFactory = ctx.lookup(jndi_key);
+54   * </code>
+55   */
+56  public class SessionFactoryImpl implements SessionFactory, Serializable {
+57  
+58      private static final long serialVersionUID = 1L;
+59  
+60      protected SessionFactoryImpl() {
+61      }
+62  
+63      public static SessionFactoryImpl newInstance() {
+64          return new SessionFactoryImpl();
+65      }
+66  
+67      public Session createSession(Map<String, String> parameters) {
+68          return createSession(parameters, null, null, null, null);
+69      }
+70  
+71      /**
+72       * @deprecated Use
+73       *             {@link #createSession(Map, ObjectFactory, AuthenticationProvider, Cache)}
+74       */
+75      @Deprecated
+76      public Session createSession(Map<String, String> parameters, ObjectFactory objectFactory,
+77              AuthenticationProvider authenticationProvider, Cache cache) {
+78          return createSession(parameters, objectFactory, authenticationProvider, cache, null);
+79      }
+80  
+81      /**
+82       * Creates a new session. The provided object factory, authentication
+83       * provider and cache instance override the values in the session parameters
+84       * if they are not <code>null</code>.
+85       * 
+86       * @param parameters
+87       *            a {@code Map} of name/value pairs with parameters for the
+88       *            session
+89       * @param objectFactory
+90       *            an object factory instance
+91       * @param authenticationProvider
+92       *            an authentication provider instance
+93       * @param cache
+94       *            a cache instance
+95       * @param typeDefCache
+96       *            a type definition cache instance
+97       * @return a {@link Session} connected to the CMIS repository
+98       * @throws CmisBaseException
+99       *             if the connection could not be established
+100      * 
+101      * @see SessionParameter
+102      */
+103     public Session createSession(Map<String, String> parameters, ObjectFactory objectFactory,
+104             AuthenticationProvider authenticationProvider, Cache cache, TypeDefinitionCache typeDefCache) {
+105         SessionImpl session = new SessionImpl(parameters, objectFactory, authenticationProvider, cache, typeDefCache);
+106         session.connect();
+107 
+108         return session;
+109     }
+110 
+111     public List<Repository> getRepositories(Map<String, String> parameters) {
+112         return getRepositories(parameters, null, null, null, null);
+113     }
+114 
+115     /**
+116      * @deprecated Use
+117      *             {@link #getRepositories(Map, ObjectFactory, AuthenticationProvider, Cache, TypeDefinitionCache)}
+118      */
+119     @Deprecated
+120     public List<Repository> getRepositories(Map<String, String> parameters, ObjectFactory objectFactory,
+121             AuthenticationProvider authenticationProvider, Cache cache) {
+122         return getRepositories(parameters, objectFactory, authenticationProvider, cache, null);
+123     }
+124 
+125     /**
+126      * Returns all repositories that are available at the endpoint. See
+127      * {@link #createSession(Map, ObjectFactory, AuthenticationProvider, Cache)}
+128      * for parameter details. The parameter
+129      * {@code SessionParameter.REPOSITORY_ID} should not be set.
+130      */
+131     public List<Repository> getRepositories(Map<String, String> parameters, ObjectFactory objectFactory,
+132             AuthenticationProvider authenticationProvider, Cache cache, TypeDefinitionCache typeDefCache) {
+133         CmisBinding binding = CmisBindingHelper.createBinding(parameters, authenticationProvider, typeDefCache);
+134 
+135         List<RepositoryInfo> repositoryInfos = binding.getRepositoryService().getRepositoryInfos(null);
+136 
+137         List<Repository> result = new ArrayList<Repository>();
+138         for (RepositoryInfo data : repositoryInfos) {
+139             result.add(new RepositoryImpl(data, parameters, this, objectFactory, binding.getAuthenticationProvider(),
+140                     cache, typeDefCache));
+141         }
+142 
+143         return result;
+144     }
+145 }
+
+
+ +