.settings
.classpath
.project
+.idea/
String result = null;
// Compute the digest
- result = fileManager.computeDigest(blob); // REM - Warning: Why is this operation so slow?
+// result = fileManager.computeDigest(blob); // REM - Warning: Why is this operation so slow?
+ result = blob.getDigest();
return result;
}
import org.nuxeo.ecm.core.api.Blob;
import org.nuxeo.ecm.core.api.blobholder.BlobHolder;
import org.nuxeo.ecm.core.api.impl.blob.FileBlob;
-import org.nuxeo.ecm.core.api.impl.blob.StreamingBlob;
+//import org.nuxeo.ecm.core.api.impl.blob.StreamingBlob;
import org.nuxeo.ecm.core.convert.api.ConversionException;
import org.nuxeo.ecm.core.convert.cache.SimpleCachableBlobHolder;
import org.nuxeo.ecm.core.convert.extension.Converter;
import org.nuxeo.ecm.core.convert.extension.ConverterDescriptor;
-import org.nuxeo.ecm.core.storage.sql.coremodel.SQLBlob;
+//import org.nuxeo.ecm.core.storage.sql.coremodel.SQLBlob;
import org.nuxeo.ecm.platform.commandline.executor.api.CmdParameters;
import org.nuxeo.ecm.platform.commandline.executor.api.CommandAvailability;
import org.nuxeo.ecm.platform.commandline.executor.api.CommandLineExecutorService;
import org.nuxeo.ecm.platform.picture.core.im.IMImageUtils;
import org.nuxeo.runtime.api.Framework;
-import org.nuxeo.runtime.services.streaming.FileSource;
-import org.nuxeo.runtime.services.streaming.StreamSource;
+//import org.nuxeo.runtime.services.streaming.FileSource;
+//import org.nuxeo.runtime.services.streaming.StreamSource;
public class ThumbnailConverter extends IMImageUtils implements Converter {
private static final Log logger = LogFactory.getLog(ThumbnailConverter.class);
File inputFile = null;
if (blob instanceof FileBlob) {
inputFile = ((FileBlob) blob).getFile();
- } else if (blob instanceof SQLBlob) {
- StreamSource source = ((SQLBlob) blob).getBinary()
- .getStreamSource();
- inputFile = ((FileSource) source).getFile();
- } else if (blob instanceof StreamingBlob) {
- StreamingBlob streamingBlob = ((StreamingBlob) blob);
- if (!streamingBlob.isPersistent()) {
- streamingBlob.persist();
- }
- StreamSource source = streamingBlob.getStreamSource();
- inputFile = ((FileSource) source).getFile();
}
+// else if (blob instanceof SQLBlob) {
+// StreamSource source = ((SQLBlob) blob).getBinary()
+// .getStreamSource();
+// inputFile = ((FileSource) source).getFile();
+// } else if (blob instanceof StreamingBlob) {
+// StreamingBlob streamingBlob = ((StreamingBlob) blob);
+// if (!streamingBlob.isPersistent()) {
+// streamingBlob.persist();
+// }
+// StreamSource source = streamingBlob.getStreamSource();
+// inputFile = ((FileSource) source).getFile();
+// }
+
if (inputFile == null) {
+ logger.error("Blob from blob holder was null.");
return null; // Add a log message here
}
CmdParameters params = new CmdParameters();
--- /dev/null
+This folder contains the Nuxeo modules
+These modules are required to run the nuxeo framework
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.nuxeo.ecm.distribution</groupId>
+ <artifactId>nuxeo-distribution</artifactId>
+ <version>6.0</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>nuxeo-distribution-tomcat</artifactId>
+ <packaging>pom</packaging>
+ <name>Nuxeo Tomcat Build</name>
+ <description>Package Nuxeo with Tomcat</description>
+
+ <properties>
+ <!-- Use a Nuxeo lightened Tomcat -->
+ <tomcat.classifier>light</tomcat.classifier>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.nuxeo.runtime</groupId>
+ <artifactId>nuxeo-runtime-jtajca</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuxeo.runtime</groupId>
+ <artifactId>nuxeo-runtime-datasource</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuxeo.lib.runtime</groupId>
+ <artifactId>nuxeo-runtime-tomcat-adapter</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuxeo.ecm.core</groupId>
+ <artifactId>nuxeo-core-management-jtajca</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuxeo.ecm.platform</groupId>
+ <artifactId>nuxeo-platform-ws-sun-jaxws</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.elasticsearch</groupId>
+ <artifactId>elasticsearch</artifactId>
+ </dependency>
+ <!-- Marketplace packages embedded in Tomcat distribution -->
+ <dependency>
+ <groupId>org.nuxeo.ecm.distribution</groupId>
+ <artifactId>nuxeo-marketplace-dm</artifactId>
+ <type>zip</type>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>all</id>
+ <!-- profile for building all classifiers -->
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ </profile>
+ <profile>
+ <id>nuxeo-coreserver</id>
+ <!-- profile for building Tomcat with only Nuxeo CoreServer -->
+ <properties>
+ <product.name>coreserver</product.name>
+ </properties>
+ </profile>
+ <profile>
+ <id>nuxeo-cap</id>
+ <properties>
+ <product.name>cap</product.name>
+ </properties>
+ <!-- profile for building Tomcat with only Nuxeo CAP -->
+ </profile>
+ <profile>
+ <id>sdk</id>
+ <!-- profile for building SDK distributions (they are always built
+ when release profile is activated) -->
+ </profile>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.tattletale</groupId>
+ <artifactId>tattletale-maven</artifactId>
+ <configuration>
+ <source>${project.build.directory}/nuxeo-cap-${project.version}-tomcat/nxserver/lib
+ </source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuxeo.build</groupId>
+ <artifactId>ant-assembly-maven-plugin</artifactId>
+ <configuration>
+ <buildFiles>
+ <buildFile>${basedir}/src/main/assemble/assembly.xml
+ </buildFile>
+ </buildFiles>
+ </configuration>
+ <executions>
+ <execution>
+ <id>packaging</id>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.nuxeo.ecm.platform.query.api.PageProviderservice.replacers.defaultConfig">
+
+ <extension target="org.nuxeo.ecm.platform.query.api.PageProviderService" point="replacers">
+
+ <replacer withClass="org.nuxeo.elasticsearch.provider.ElasticSearchNxqlPageProvider"
+ enabled="${elasticsearch.enabled:=true}">
+ <provider>default_search</provider>
+ </replacer>
+
+ </extension>
+</component>
--- /dev/null
+<?xml version="1.0"?>
+
+<!--
+ This is the configuration the CollectionSpace services used when it was deployed on the JBoss AS. However,
+ it still works (and is required) in our Apache Tomcat deployment.
+
+ 12/8/2011 - We need to confirm with Nuxeo that this is correct configuration for their LoginComponent.
+ -->
+<component name="org.nuxeo.ecm.platform.login.LoginConfig"
+ version="1.0">
+ <documentation>
+ Login modules used on JBoss
+ @author Bogdan Stefanescu (bs@nuxeo.com)
+ </documentation>
+
+
+ <extension target="org.nuxeo.runtime.LoginComponent" point="domains">
+
+ <domain name="nuxeo-system-login">
+ <login-module code="org.nuxeo.runtime.api.login.SystemLoginModule"
+ flag="required" />
+ <login-module code="org.nuxeo.ecm.core.api.local.ClientLoginModule"
+ flag="required">
+ <option name="password-stacking">true</option>
+ <option name="multi-threaded">true</option>
+ </login-module>
+ </domain>
+
+
+ <domain name="nuxeo-webengine">
+ <login-module code="org.nuxeo.ecm.platform.login.NuxeoLoginModule"
+ flag="required">
+ <option name="principalClassName">org.nuxeo.ecm.platform.login.NuxeoPrincipal
+ </option>
+ <option name="useUserIdentificationInfoCB">true</option>
+ </login-module>
+ <!--login-module code="org.nuxeo.ecm.core.api.local.ClientLoginModule"
+ flag="required"> <option name="password-stacking">true</option> <option name="multi-threaded">true</option>
+ </login-module -->
+ </domain>
+
+ </extension>
+
+
+</component>
--- /dev/null
+NuxeoContainer.autoactivation=true
--- /dev/null
+# application instance config
+org.nuxeo.ecm.instance.host=localhost
+
+# enable/disable Elasticsearch
+elasticsearch.enabled=false
+
+# runtime remoting config
+org.nuxeo.runtime.server.locator=socket://0.0.0.0:62474/?datatype=nuxeo
+org.nuxeo.runtime.server.enabled=false
+org.nuxeo.runtime.server.host=${org.nuxeo.ecm.instance.host}
+
+# streaming config
+org.nuxeo.runtime.streaming.isServer=false
+org.nuxeo.runtime.streaming.serverLocator=socket://${org.nuxeo.ecm.instance.host}:62474/?datatype=nuxeo
+
+# runtime management config
+org.nuxeo.runtime.management.exist=false
+org.nuxeo.runtime.management.serverRmiPort=2100
+
+# needed for the JNDI auto configuration of clients
+# you need to change this if using JNDI through HTTP
+nuxeo-client-jndi.java.naming.provider.url=jnp://%s:%s
+nuxeo-client-jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+nuxeo-client-jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+
+# for email attachment, to decode the encoded(utf) filenames.
+mail.mime.decodefilename=true
+
+# LiveEdit configuration detection (client/server/both)
+org.nuxeo.ecm.platform.liveedit.config=client
+
+# Uncomment to activate Nuxeo Runtime REST API for Management
+# accessible via http://server:port/nuxeo/site/server/html on JBoss
+#org.nuxeo.runtime.rest.management=true
+
+# size limit to use the specific download servlet for big files (use SI or IEC prefix)
+#org.nuxeo.big.file.size.limit=5Mi
+
+###
+# Older settings that were used with CollectionSpace and Nuxeo v5.5
+###
+
+#org.nuxeo.ecm.instance.name=Nuxeo 5.5
+#org.nuxeo.ecm.instance.description=Nuxeo ECM server
+
+# product config
+#org.nuxeo.ecm.product.name=Nuxeo 5.5
+#org.nuxeo.ecm.product.version=5.5
+
+# which sample to run
+#org.nuxeo.ecm.sample.class=org.nuxeo.ecm.sample.streaming.StreamingExample
+
+# avoid initializing nuxeo relations at startup (for faster startup)
+#org.nuxeo.ecm.platform.relations.initOnStartup=false
+
+# context path of the application
+#org.nuxeo.ecm.contextPath=/nuxeo
+
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.nuxeo.runtime.datasource.testsci.contrib">
+
+ <extension target="org.nuxeo.runtime.datasource" point="datasources">
+ <datasource name="jdbc/testsci_domain" driverClassName="org.postgresql.Driver"
+ maxPoolSize="100" minPoolSize="5" blockingTimeoutMillis="10000"
+ url="jdbc:postgresql://localhost:5432/testsci_domain" validationQuery=""
+ username="nuxeo6" password="nuxeo6"
+ accessToUnderlyingConnectionAllowed="true" >
+ </datasource>
+ <link name="jdbc/repository_testsci_domain" global="jdbc/testsci_domain" type="javax.sql.DataSource" />
+
+ <!--
+ These links need to be moved into the context.xml file and become <Resource> instead of <link>
+ -->
+ <link name="jdbc/repository_default" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/repository_default" global="jdbc/default" type="javax.sql.DataSource"/>
+ <link name="jdbc/NuxeoDS" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/nxsqldirectory" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/nxrelations-default-jena" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/comment-relations" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/nxaudit-logs" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/nxjbpm" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/placeful_service_ds" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/nxwebwidgets" global="jdbc/default" type="javax.sql.DataSource" />
+ <link name="jdbc/nxuidsequencer" global="jdbc/default" type="javax.sql.DataSource" />
+
+ <!-- These properties are passed into the CSpace code that generates the final version
+ of this Nuxeo configuration file.
+ -->
+ <property name="ServerName">@DB_SERVER_HOSTNAME@</property>
+ <property name="JDBCOptions">@DB_JDBC_OPTIONS@</property>
+ <property name="PortNumber">@DB_PORT@</property>
+ <property name="User">@NUXEO_USER@</property>
+ <property name="Password">@NUXEO_PW@</property>
+ </extension>
+</component>
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.nuxeo.elasticsearch.defaultConfig">
+ <require>org.nuxeo.elasticsearch.ElasticSearchComponent</require>
+
+ <!--
+ <extension target="org.nuxeo.elasticsearch.ElasticSearchComponent"
+ point="elasticSearchLocal">
+ <elasticSearchLocal
+ clusterName="nuxeoCluster"
+ nodeName="nuxeoNode"
+ pathData="C:\dev\tools\apache-tomcat-7.0.57\nuxeo-server\data\elasticsearch"
+ pathLogs="C:\dev\tools\apache-tomcat-7.0.57\nuxeo-server\log\elasticsearch"
+ httpEnabled="true" />
+ </extension>
+ -->
+
+ <extension target="org.nuxeo.elasticsearch.ElasticSearchComponent"
+ point="elasticSearchRemote">
+ <elasticSearchRemote
+ clusterName="elasticsearch"
+ addressList="localhost:9300"
+ clientTransportSniff="false"
+ clientTransportIgnoreClusterName="false"
+ clientTransportPingTimeout="5s"
+ clientTransportNodesSamplerInterval="5s" />
+ </extension>
+
+ %elasticSearchIndex_extensions%
+
+ </component>
+
--- /dev/null
+ <extension target="org.nuxeo.elasticsearch.ElasticSearchComponent"
+ point="elasticSearchIndex">
+ <elasticSearchIndex name="index_name_placeholder" type="doc" repository="repository_name_placeholder">
+ <fetchFromSource>
+ <include>ecm:*</include>
+ <include>dc:*</include>
+ <exclude>ecm:binarytext</exclude>
+ </fetchFromSource>
+
+ <settings>
+{
+ "analysis" : {
+ "filter" : {
+ "en_stem_filter" : {
+ "name" : "minimal_english",
+ "type" : "stemmer"
+ },
+ "en_stop_filter" : {
+ "stopwords" : [
+ "_english_"
+ ],
+ "type" : "stop"
+ },
+ "fr_elision_filter" : {
+ "articles" : [
+ "c",
+ "l",
+ "m",
+ "t",
+ "qu",
+ "n",
+ "s",
+ "j"
+ ],
+ "type" : "elision"
+ },
+ "fr_stem_filter" : {
+ "name" : "minimal_french",
+ "type" : "stemmer"
+ },
+ "fr_stop_filter" : {
+ "stopwords" : [
+ "_french_"
+ ],
+ "type" : "stop"
+ }
+ },
+ "tokenizer" : {
+ "path_tokenizer" : {
+ "delimiter" : "/",
+ "type" : "path_hierarchy"
+ }
+ },
+ "analyzer" : {
+ "en_analyzer" : {
+ "alias" : "fulltext",
+ "filter" : [
+ "lowercase",
+ "en_stop_filter",
+ "en_stem_filter",
+ "asciifolding"
+ ],
+ "type" : "custom",
+ "tokenizer" : "standard"
+ },
+ "fr_analyzer" : {
+ "filter" : [
+ "lowercase",
+ "fr_stop_filter",
+ "fr_stem_filter",
+ "asciifolding",
+ "fr_elision_filter"
+ ],
+ "type" : "custom",
+ "tokenizer" : "standard"
+ },
+ "path_analyzer" : {
+ "type" : "custom",
+ "tokenizer" : "path_tokenizer"
+ },
+ "default" : {
+ "type" : "custom",
+ "tokenizer" : "keyword"
+ }
+ }
+ }
+}
+ </settings>
+ <mapping>
+{
+ "_size" : {
+ "enabled" : true
+ },
+ "_all" : {
+ "analyzer" : "fulltext"
+ },
+ "properties" : {
+ "dc:title" : {
+ "type" : "multi_field",
+ "fields" : {
+ "dc:title" : {
+ "index" : "not_analyzed",
+ "type" : "string"
+ },
+ "fulltext" : {
+ "boost": 2,
+ "type": "string",
+ "analyzer" : "fulltext"
+ }
+ }
+ },
+ "dc:description" : {
+ "type" : "multi_field",
+ "fields" : {
+ "dc:description" : {
+ "index" : "no",
+ "include_in_all" : "true",
+ "type" : "string"
+ },
+ "fulltext" : {
+ "boost": 1.5,
+ "type": "string",
+ "analyzer" : "fulltext"
+ }
+ }
+ },
+ "note:note" : {
+ "type" : "multi_field",
+ "fields" : {
+ "note:note" : {
+ "index" : "no",
+ "include_in_all" : "true",
+ "type" : "string"
+ },
+ "fulltext" : {
+ "type": "string",
+ "analyzer" : "fulltext"
+ }
+ }
+ },
+ "ecm:binarytext*" : {
+ "type" : "string",
+ "analyzer" : "fulltext"
+ },
+ "ecm:path" : {
+ "type" : "multi_field",
+ "fields" : {
+ "children" : {
+ "search_analyzer" : "keyword",
+ "index_analyzer" : "path_analyzer",
+ "type" : "string"
+ },
+ "ecm:path" : {
+ "index" : "not_analyzed",
+ "type" : "string"
+ }
+ }
+ },
+ "ecm:pos": {
+ "type": "integer"
+ },
+ "dc:created": {
+ "format": "dateOptionalTime",
+ "type": "date"
+ },
+ "dc:modified": {
+ "format": "dateOptionalTime",
+ "type": "date"
+ }
+ }
+}
+ </mapping>
+
+ </elasticSearchIndex>
+ </extension>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<!--
+ This is a prototype/template file for Nuxeo repository configuration files.
+ For each tenant that has their own repository specified in the CollectionSpace
+ tenant bindings file, we will create a corresponding Nuxeo repository config-
+ uration file. You won't have to change the value for most of these elements
+ and attributes because they will be set when CollectionSpace starts.
+
+ *** NOTE *** One value you may want to change is the 'binaryStore' path which is the location
+ that Nuxeo places binary files like images and PDF documents. Be sure to read the comment to
+ the right of the <binaryStore> element below.
+-->
+
+<!-- *** WARNING *** Don't manually change the values here unless you know exactly what you're doing. -->
+
+<!-- Values in the following elements are primarily added during execution -->
+<!-- of the 'ant deploy' command, within the Services source code tree. -->
+<!-- (Several values are also added during system startup, into repository-specific -->
+<!-- 'clones' of this prototype configuration file, as noted below.) -->
+<!-- See http://doc.nuxeo.com/display/ADMINDOC/VCS+Configuration for more config details -->
+<component name="config:default-repository">
+ <extension target="org.nuxeo.ecm.core.storage.sql.RepositoryService" point="repository">
+ <repository name="default" factory="org.nuxeo.ecm.core.storage.sql.ra.PoolingRepositoryFactory">
+ <pool minPoolSize="0" maxPoolSize="20" blockingTimeoutMillis="100" idleTimeoutMinutes="10"/>
+ <clustering enabled="false" delay="1000"/>
+ <binaryStore path=""/> <!-- Default value will be repository/database name. Can be partial or full system path. Partial path is relative to Nuxeo's data dir -->
+ <xa-datasource>@XA_DATASOURCE@</xa-datasource> <!-- The transactional datasource for Nuxeo -->
+ <noDDL>false</noDDL>
+ <sqlInitFile>vcsconfig.sql.txt</sqlInitFile> <!-- see https://doc.nuxeo.com/display/ADMINDOC/VCS+Configuration#VCSConfiguration-DatabaseCreationOption -->
+ <aclOptimizations enabled="true"/>
+ <pathOptimizations enabled="true"/>
+ <idType>varchar</idType>
+ <indexing>
+ <fulltext disabled="false" analyzer="english">
+ <index name="default">
+ <!-- all props implied -->
+ </index>
+ <index name="title">
+ <field>dc:title</field>
+ </index>
+ <index name="description">
+ <field>dc:description</field>
+ </index>
+ </fulltext>
+ </indexing>
+ <usersSeparator key="," />
+ <property name="ServerName">@DB_SERVER_HOSTNAME@</property>
+ <property name="DatabaseName"></property> <!-- The value of the database name element is inserted during system startup. -->
+ <property name="JDBCOptions">@DB_JDBC_OPTIONS@</property>
+ <property name="PortNumber">@DB_PORT@</property>
+ <property name="User">@NUXEO_USER@</property>
+ <property name="Password">@NUXEO_PW@</property>
+ </repository>
+ </extension>
+</component>
\ No newline at end of file
--- /dev/null
+nuxeo.s3storage.bucket=__bucketname__
+nuxeo.s3storage.awsid=__AWSAccessKeyId__
+nuxeo.s3storage.awssecret=__AWSSecretKey__
--- /dev/null
+#
+# A place to modify the Nuxeo database with SQL statements.
+# See https://doc.nuxeo.com/display/ADMINDOC/VCS+Configuration#VCSConfiguration-DatabaseCreationOption
+#
+
+#CATEGORY: afterTableCreation
+
+#
+# Add a unique constraint to the report 'name' column of the reports_common table.
+#
+LOG.INFO Adding a unique constraint to the report 'name' column of the reports_common table
+
+#TEST:
+SELECT constraint_name FROM information_schema.constraint_column_usage WHERE table_name = 'reports_common' AND constraint_name = 'reportname_unique';
+
+#IF: emptyResult
+ALTER TABLE reports_common add CONSTRAINT reportname_unique UNIQUE (name);
--- /dev/null
+org.nuxeo.app.bundles=bundles/*:plugins/*
--- /dev/null
+This folder contains static libraries used by nuxeo components
--- /dev/null
+This folder contains the external modules on top of the nuxeo platform
\ No newline at end of file
--- /dev/null
+org.nuxeo.launcher.libdirs=lib
domain.nuxeo=nuxeo-server
#nuxeo
-nuxeo.release=6.0-HF21
+nuxeo.release=7.0-HF16
nuxeo.ear=nuxeo.ear
nuxeo.system=bundles
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cspace.services.version>4.5-SNAPSHOT</cspace.services.version>
<cspace.services.client.version>4.5-SNAPSHOT</cspace.services.client.version>
- <nuxeo.general.release>6.0-HF21</nuxeo.general.release>
+ <nuxeo.general.release>7.10</nuxeo.general.release>
<nuxeo.shell.version>${nuxeo.general.release}</nuxeo.shell.version>
<nuxeo.platform.version>${nuxeo.general.release}</nuxeo.platform.version>
<nuxeo.core.version>${nuxeo.general.release}</nuxeo.core.version>
/target/
/target/
+/target/
<artifactId>nuxeo-platform-imaging-core</artifactId>
<version>${nuxeo.core.version}</version>
</dependency>
- <dependency>
- <groupId>org.nuxeo.ecm.platform</groupId>
- <artifactId>nuxeo-platform-imaging-preview</artifactId>
- <version>${nuxeo.core.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>jboss-seam-pdf</artifactId>
- <groupId>org.jboss.seam</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-seam-rss</artifactId>
- <groupId>org.jboss.seam</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-seam-excel</artifactId>
- <groupId>org.jboss.seam</groupId>
- </exclusion>
- <exclusion>
- <artifactId>nuxeo-platform-ui-web</artifactId>
- <groupId>org.nuxeo.ecm.platform</groupId>
- </exclusion>
- <exclusion>
- <artifactId>xercesImpl</artifactId>
- <groupId>xerces</groupId>
- </exclusion>
- <exclusion>
- <artifactId>servlet-api</artifactId>
- <groupId>javax.servlet</groupId>
- </exclusion>
- <exclusion>
- <artifactId>oauth-httpclient3</artifactId>
- <groupId>net.oauth.core</groupId>
- </exclusion>
- <exclusion>
- <artifactId>oauth-consumer</artifactId>
- <groupId>net.oauth.core</groupId>
- </exclusion>
- <exclusion>
- <artifactId>oauth-provider</artifactId>
- <groupId>net.oauth.core</groupId>
- </exclusion>
- <exclusion>
- <artifactId>oauth</artifactId>
- <groupId>net.oauth.core</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-seam-remoting</artifactId>
- <groupId>org.jboss.seam</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-seam-ui</artifactId>
- <groupId>org.jboss.seam</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-seam</artifactId>
- <groupId>org.jboss.seam</groupId>
- </exclusion>
- <exclusion>
- <artifactId>richfaces</artifactId>
- <groupId>org.richfaces</groupId>
- </exclusion>
- <exclusion>
- <artifactId>richfaces-a4j</artifactId>
- <groupId>org.richfaces</groupId>
- </exclusion>
- <exclusion>
- <artifactId>richfaces-core</artifactId>
- <groupId>org.richfaces</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jsf-api</artifactId>
- <groupId>com.sun.faces</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jsf-impl</artifactId>
- <groupId>com.sun.faces</groupId>
- </exclusion>
- <exclusion>
- <artifactId>el-api</artifactId>
- <groupId>javax.el</groupId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.nuxeo.ecm.platform</groupId>
<artifactId>nuxeo-platform-audit-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- nuxeo -->
- <dependency>
- <groupId>org.nuxeo.ecm.platform</groupId>
- <artifactId>nuxeo-platform-mimetype-api</artifactId>
- <version>${nuxeo.platform.version}</version>
- </dependency>
<dependency>
<groupId>org.nuxeo.ecm.platform</groupId>
<artifactId>nuxeo-platform-imaging-core</artifactId>
import javax.ws.rs.core.Response;
import org.collectionspace.services.client.AuthorityClient;
-import org.collectionspace.services.client.CollectionSpaceClient;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.common.ServiceMain;
import org.collectionspace.services.common.api.Tools;
import org.collectionspace.services.common.document.DocumentException;
//import org.dom4j.DocumentException;
-import org.eclipse.jetty.http.HttpStatus;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Response res = client.read(specifier.getURNValue());
try {
int statusCode = res.getStatus();
- if (statusCode == HttpStatus.OK_200) {
+ if (statusCode == org.apache.commons.httpclient.HttpStatus.SC_OK) {
result = new PoxPayloadIn((String)res.readEntity(responseType)); // Get the entire response!
} else {
String errMsg = String.format("Could not retrieve authority information for '%s' on remote server '%s'. Server returned status code %d",
try {
int statusCode = res.getStatus();
- if (statusCode == HttpStatus.OK_200) {
+ if (statusCode == org.apache.commons.httpclient.HttpStatus.SC_OK) {
result = new PoxPayloadIn((String)res.readEntity(responseType)); // Get the entire response.
} else {
String errMsg = String.format("Could not retrieve authority item information for '%s:%s' on remote server '%s'. Server returned status code %d",
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
+import org.apache.commons.httpclient.HttpStatus;
import org.collectionspace.services.client.AbstractCommonListUtils;
import org.collectionspace.services.client.AuthorityClient;
import org.collectionspace.services.client.PayloadInputPart;
import org.collectionspace.services.nuxeo.client.java.RepositoryClientImpl;
import org.collectionspace.services.nuxeo.util.NuxeoUtils;
import org.dom4j.Element;
-import org.eclipse.jetty.http.HttpStatus;
import org.nuxeo.ecm.core.api.ClientException;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.slf4j.Logger;
private void assertStatusCode(Response res, Specifier specifier, AuthorityClient client) throws Exception {
int statusCode = res.getStatus();
- if (statusCode != HttpStatus.OK_200) {
+ if (statusCode != HttpStatus.SC_OK) {
String errMsg = String.format("Could not retrieve authority information for '%s' on remote server '%s'. Server returned status code %d",
specifier.getURNValue(), client.getBaseURL(), statusCode);
throw new DocumentException(statusCode, errMsg);
<artifactId>nuxeo-runtime-launcher</artifactId>
<version>${nuxeo.platform.version}</version>
</dependency>
- <dependency>
- <groupId>org.nuxeo.ecm.platform</groupId>
- <artifactId>nuxeo-platform-mimetype-api</artifactId>
- <version>${nuxeo.platform.version}</version>
- </dependency>
- <dependency>
- <groupId>org.nuxeo.ecm.platform</groupId>
- <artifactId>nuxeo-platform-mimetype-core</artifactId>
- <version>${nuxeo.platform.version}</version>
- </dependency>
<dependency>
<groupId>org.nuxeo.ecm.platform</groupId>
<artifactId>nuxeo-platform-types-api</artifactId>
import org.jboss.resteasy.plugins.providers.multipart.InputPart;
//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.mortbay.log.Log;
import org.nuxeo.ecm.core.io.ExportConstants;
import org.nuxeo.common.collections.PrimitiveArrays;
import org.nuxeo.ecm.core.api.DocumentModel;
try {
result = type.decode(dateVal);
} catch (Exception e) { // Nuxeo may not be able to decode dates like "July 11, 2001", so we'll try to convert it to ISO 8601 first
- Log.debug(String.format(
+ logger.debug(String.format(
"Nuxeo could not decode date string '%s'. CSpace will try to convert it to an ISO 8601 timestamp for Nuxeo first.", dateVal), e);
}
// All other date or date/time values must first converted
import org.nuxeo.ecm.core.api.blobholder.BlobHolder;
import org.nuxeo.ecm.core.api.blobholder.DocumentBlobHolder;
import org.nuxeo.ecm.core.api.impl.blob.FileBlob;
-import org.nuxeo.ecm.core.api.impl.blob.InputStreamBlob;
import org.nuxeo.ecm.core.api.Blob;
import org.nuxeo.ecm.core.api.ClientException;
import org.nuxeo.ecm.core.api.DocumentModel;
DocumentRef nuxeoWspace = new IdRef(nuxeoWspaceId);
DocumentModel blobLocation = repoSession.getDocument(nuxeoWspace);
- Blob inputStreamBlob = new InputStreamBlob(inputStream);
+ Blob inputStreamBlob = new FileBlob(inputStream); // creates a temp file to hold the stream
DocumentModel documentModel = createDocumentFromBlob(
repoSession,
inputStreamBlob,
import java.sql.Statement;
import java.util.List;
-import javax.sql.DataSource;
-
import org.collectionspace.services.client.AuthorityClient;
import org.collectionspace.services.common.api.Tools;
import org.collectionspace.services.common.context.ServiceBindingUtils;
import org.collectionspace.services.config.service.InitHandler.Params.Property;
import org.collectionspace.services.config.service.ObjectPartType;
import org.collectionspace.services.config.service.ServiceBindingType;
-import org.mortbay.log.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
List<Field> fields,
List<Property> properties) throws Exception {
//todo: all post-init tasks for services, or delegate to services that override.
- int rows = 0;
- String sql = "";
if (logger.isInfoEnabled() && sbt != null) {
logger.info("Creating indicies, as needed, for designated fields in " + sbt.getName()
+ " for repository domain " + sbt.getRepositoryDomain().trim() + "...");
}
+ int rows = 0;
for (Field field : fields) {
String tableName = field.getTable();
String fieldName = field.getCol();
rows = addOneIndex(dataSourceName, repositoryName, cspaceInstanceId, tableName, fieldName);
}
}
+
+ if (logger.isDebugEnabled()) {
+ logger.debug(String.format("Rows indexed during repository initialization is %d.", rows));
+ }
+
//
// Add a uniqueness constraint on the short ID field of authority and authority item tables
//
result = true;
}
} catch (Exception e) {
- String errorMsg = e.getLocalizedMessage();
logger.error(String.format("Error when identifying whether constraint on column '%s' exists in table '%s': %s",
SHORT_ID, tableName, e != null ? e : "Unknown error."));
throw e; // rethrow it.
logger.error(String.format("*** ERROR *** Encountered problems when trying to create a uniqueness constraint on column '%s' of table '%s' in repository '%s'.",
SHORT_ID, tableName, repositoryName));
} else {
- Log.debug(String.format("Created a uniqueness constraint on column '%s' of table '%s' in repository '%s'.",
+ logger.debug(String.format("Created a uniqueness constraint on column '%s' of table '%s' in repository '%s'.",
SHORT_ID, tableName, repositoryName));
}
import org.collectionspace.services.nuxeo.client.java.CoreSessionInterface;
import org.collectionspace.services.nuxeo.util.ReindexFulltextRoot;
-import org.nuxeo.ecm.core.storage.StorageException;
+import org.nuxeo.ecm.core.api.NuxeoException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
this.coreSession = repoSession.getCoreSession();
}
- public String reindexFulltext(int batchSize, int batch, String query) throws StorageException {
+ public String reindexFulltext(int batchSize, int batch, String query) throws NuxeoException {
return super.reindexFulltext(batchSize, batch, query);
}
}
import org.collectionspace.services.lifecycle.TransitionList;
import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentException;
import org.collectionspace.services.nuxeo.client.java.CoreSessionInterface;
-
import org.dom4j.Document;
import org.dom4j.io.SAXReader;
-import org.mortbay.log.Log;
import org.nuxeo.ecm.core.NXCore;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.nuxeo.ecm.core.api.DocumentModelList;
import org.nuxeo.ecm.core.api.CoreSession;
import org.nuxeo.ecm.core.api.DocumentRef;
import org.nuxeo.ecm.core.api.IdRef;
+import org.nuxeo.ecm.core.api.NuxeoException;
import org.nuxeo.ecm.core.api.PathRef;
-import org.nuxeo.ecm.core.api.impl.blob.BlobWrapper;
import org.nuxeo.ecm.core.api.model.PropertyException;
import org.nuxeo.ecm.core.io.DocumentPipe;
import org.nuxeo.ecm.core.io.DocumentReader;
import org.nuxeo.ecm.core.io.impl.plugins.XMLDocumentWriter;
import org.nuxeo.ecm.core.lifecycle.LifeCycleService;
import org.nuxeo.ecm.core.schema.SchemaManager;
-import org.nuxeo.ecm.core.storage.StorageBlob;
-import org.nuxeo.ecm.core.storage.binary.Binary;
-import org.nuxeo.ecm.core.storage.sql.coremodel.SQLBlob;
import org.nuxeo.runtime.api.Framework;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
private static File getFileOfBlob(Blob blob) {
File result = null;
-
- if (blob instanceof BlobWrapper) {
- BlobWrapper blobWrapper = (BlobWrapper)blob;
- try {
- Field blobField;
- blobField = blobWrapper.getClass().getDeclaredField("blob");
- boolean accessibleState = blobField.isAccessible();
- if (accessibleState == false) {
- blobField.setAccessible(true);
- }
- blob = (StorageBlob)blobField.get(blobWrapper);
- blobField.setAccessible(accessibleState); // set it back to its original access state
- } catch (Exception e) {
- logger.error("blob field of BlobWrapper is not accessible.", e);
- }
- }
-
- if (blob instanceof StorageBlob) {
- StorageBlob sqlBlob = (StorageBlob)blob;
- Binary binary = sqlBlob.getBinary();
- try {
- Field fileField = binary.getClass().getDeclaredField("file");
- boolean accessibleState = fileField.isAccessible();
- if (accessibleState == false) {
- fileField.setAccessible(true);
- }
- result = (File)fileField.get(binary);
- fileField.setAccessible(accessibleState); // set it back to its original access state
- } catch (Exception e) {
- logger.error("Was not able to find the 'file' field", e);
- }
- }
+
+ result = blob.getFile();
return result;
}
Exception deleteException = null;
try {
java.nio.file.Files.delete(fileToDelete.toPath());
- Log.debug(String.format("Deleted file '%s'.", fileToDelete.getCanonicalPath()));
+ logger.debug(String.format("Deleted file '%s'.", fileToDelete.getCanonicalPath()));
} catch (IOException e) {
deleteException = e;
result = false;
returnVal = DocumentUtils.propertyValueAsString(value, docModel, xpath);
}
result = returnVal;
- } catch (ClientException ce) {
+ } catch (NuxeoException ce) {
String msg = "Unknown Nuxeo client exception.";
if (ce instanceof PropertyException) {
msg = String.format("Problem retrieving property for xpath { %s } with CSID = %s.", xpath, targetCSID);
import org.nuxeo.ecm.core.query.QueryFilter;
import org.nuxeo.ecm.core.query.sql.NXQL;
import org.nuxeo.ecm.core.storage.FulltextConfiguration;
-import org.nuxeo.ecm.core.storage.StorageException;
import org.nuxeo.ecm.core.storage.sql.Model;
import org.nuxeo.ecm.core.storage.sql.Node;
import org.nuxeo.ecm.core.storage.sql.Session;
}
@GET
- public String get(@QueryParam("batchSize") int batchSize, @QueryParam("batch") int batch) throws StorageException {
+ public String get(@QueryParam("batchSize") int batchSize, @QueryParam("batch") int batch) throws NuxeoException {
coreSession = SessionFactory.getSession(request);
return reindexFulltext(batchSize, batch, null);
}
* @return when done, ok + the total number of docs
* @throws StorageException
*/
- public String reindexFulltext(int batchSize, int batch, String query) throws StorageException {
+ public String reindexFulltext(int batchSize, int batch, String query) throws NuxeoException {
Principal principal = coreSession.getPrincipal();
if (!(principal instanceof NuxeoPrincipal)) {
return "unauthorized";
* This has to be called once the transaction has been started.
* @throws StorageException
*/
- protected void getLowLevelSession() throws StorageException {
+ protected void getLowLevelSession() throws NuxeoException {
try {
SQLSession s = (SQLSession) ((AbstractSession) coreSession).getSession();
Field f2 = SQLSession.class.getDeclaredField("session");
}
}
- protected List<ReindexInfo> getInfos(String query) throws StorageException {
+ protected List<ReindexInfo> getInfos(String query) throws NuxeoException {
getLowLevelSession();
List<ReindexInfo> infos = new ArrayList<ReindexInfo>();
IterableQueryResult it = session.queryAndFetch(query, NXQL.NXQL,
return infos;
}
- protected void doBatch(List<ReindexInfo> infos) throws StorageException {
+ protected void doBatch(List<ReindexInfo> infos) throws NuxeoException {
boolean tx;
boolean ok;
* things like versions which aren't usually modifiable, and it's also good
* to bypass all listeners.
*/
- protected void runSyncBatch(List<Serializable> ids, Set<String> asyncIds) throws StorageException {
+ protected void runSyncBatch(List<Serializable> ids, Set<String> asyncIds) throws NuxeoException {
getLowLevelSession();
session.getNodesByIds(ids); // batch fetch
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;
-
import org.nuxeo.common.utils.FileTreeIterator;
import org.nuxeo.common.utils.FileUtils;
import org.nuxeo.common.utils.Path;
-import org.nuxeo.ecm.core.api.impl.blob.StreamingBlob;
+import org.nuxeo.ecm.core.api.impl.blob.FileBlob;
import org.nuxeo.ecm.core.io.ExportConstants;
import org.nuxeo.ecm.core.io.ExportedDocument;
import org.nuxeo.ecm.core.io.impl.AbstractDocumentReader;
import org.nuxeo.ecm.core.io.impl.ExportedDocumentImpl;
-import org.nuxeo.runtime.services.streaming.FileSource;
import org.nuxeo.runtime.transaction.TransactionHelper;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
FileUtils.getFileNameNoExt(file.getName()),
loadXML(file));
} else { // presume a blob
- xdoc.putBlob(file.getName(), new StreamingBlob(
- new FileSource(file)));
+ xdoc.putBlob(file.getName(), new FileBlob(file));
}
}
}
/target/
+/target/
+/target/