branch for relese 4.11.1
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/storagehub-model@167557 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3d777a7aa7
commit
2ed4a6644d
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>storagehub-model</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,6 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
|
@ -0,0 +1,12 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
|
@ -0,0 +1,4 @@
|
|||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
|
@ -0,0 +1 @@
|
|||
${gcube.license}
|
|
@ -0,0 +1,62 @@
|
|||
The gCube System - ${name}
|
||||
--------------------------------------------------
|
||||
|
||||
${description}
|
||||
|
||||
${gcube.description}
|
||||
|
||||
${gcube.funding}
|
||||
|
||||
|
||||
Version
|
||||
--------------------------------------------------
|
||||
|
||||
${version} (${buildDate})
|
||||
|
||||
Please see the file named "changelog.xml" in this directory for the release notes.
|
||||
|
||||
|
||||
Authors
|
||||
--------------------------------------------------
|
||||
|
||||
* Lucio Lelii (lucio.lelii-AT-isti.cnr.it), CNR, Italy
|
||||
|
||||
Maintainers
|
||||
--------------------------------------------------
|
||||
|
||||
* Lucio Lelii (lucio.lelii-AT-isti.cnr.it), CNR Pisa,
|
||||
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo".
|
||||
|
||||
Download information
|
||||
--------------------------------------------------
|
||||
|
||||
Source code is available from SVN:
|
||||
${scm.url}
|
||||
|
||||
Binaries can be downloaded from the gCube website:
|
||||
${gcube.website}
|
||||
|
||||
|
||||
Installation
|
||||
--------------------------------------------------
|
||||
|
||||
Installation documentation is available on-line in the gCube Wiki:
|
||||
${gcube.wikiRoot}
|
||||
|
||||
Documentation
|
||||
--------------------------------------------------
|
||||
|
||||
Documentation is available on-line in the gCube Wiki:
|
||||
${gcube.wikiRoot}
|
||||
|
||||
Support
|
||||
--------------------------------------------------
|
||||
|
||||
Bugs and support requests can be reported in the gCube issue tracking tool:
|
||||
${gcube.issueTracking}
|
||||
|
||||
|
||||
Licensing
|
||||
--------------------------------------------------
|
||||
|
||||
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.
|
|
@ -0,0 +1,5 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="storagehub-model-1.0.0" date="2018-05-15">
|
||||
<Change>First Release</Change>
|
||||
</Changeset>
|
||||
</ReleaseNotes>
|
|
@ -0,0 +1,31 @@
|
|||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||
<id>servicearchive</id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
</formats>
|
||||
<baseDirectory>/</baseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${distroDirectory}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<useDefaultExcludes>true</useDefaultExcludes>
|
||||
<includes>
|
||||
<include>README</include>
|
||||
<include>LICENSE</include>
|
||||
<include>changelog.xml</include>
|
||||
<include>profile.xml</include>
|
||||
</includes>
|
||||
<fileMode>755</fileMode>
|
||||
<filtered>true</filtered>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<files>
|
||||
<file>
|
||||
<source>target/${build.finalName}.jar</source>
|
||||
<outputDirectory>/${artifactId}</outputDirectory>
|
||||
</file>
|
||||
</files>
|
||||
</assembly>
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<ID />
|
||||
<Type>Service</Type>
|
||||
<Profile>
|
||||
<Description>${description}</Description>
|
||||
<Class>Common</Class>
|
||||
<Name>${artifactId}</Name>
|
||||
<Version>1.0.0</Version>
|
||||
<Packages>
|
||||
<Software>
|
||||
<Name>${artifactId}</Name>
|
||||
<Version>${version}</Version>
|
||||
<MavenCoordinates>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<version>${version}</version>
|
||||
</MavenCoordinates>
|
||||
<Files>
|
||||
<File>${build.finalName}.jar</File>
|
||||
</Files>
|
||||
</Software>
|
||||
</Packages>
|
||||
</Profile>
|
||||
</Resource>
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<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/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<version>1.0.0</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-model</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<name>storagehub-model</name>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>gcube-bom</artifactId>
|
||||
<version>LATEST</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.14.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.6.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.10</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<target>1.8</target>
|
||||
<source>1.8</source>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,6 @@
|
|||
package org.gcube.common.storagehub.model;
|
||||
|
||||
public enum ItemType {
|
||||
FOLDER,
|
||||
FILE;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.gcube.common.storagehub.model;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.MapAttribute;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class Metadata {
|
||||
|
||||
@MapAttribute(excludeStartWith="jcr:")
|
||||
Map<String, Object> value = new HashMap<String, Object>();
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package org.gcube.common.storagehub.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
|
||||
|
||||
@JsonAutoDetect(fieldVisibility=Visibility.ANY, getterVisibility=Visibility.NONE, isGetterVisibility=Visibility.NONE, setterVisibility=Visibility.NONE)
|
||||
public class Path {
|
||||
|
||||
protected List<String> paths = null;
|
||||
|
||||
private Path(){}
|
||||
|
||||
protected Path(String path){
|
||||
if (!(path==null || path.isEmpty()))
|
||||
paths = Arrays.asList(path.split("/")).stream().filter(s -> !s.isEmpty()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public String toPath(){
|
||||
if (paths ==null || paths.isEmpty()) return "/";
|
||||
else return "/"+paths.stream().collect(Collectors.joining("/"))+"/";
|
||||
}
|
||||
|
||||
|
||||
public String getLastDirName(){
|
||||
return paths.get(paths.size()-1);
|
||||
}
|
||||
|
||||
protected Path append(Path anotherPath){
|
||||
Path path = new Path();
|
||||
path.paths = new LinkedList<String>(this.paths);
|
||||
if (anotherPath.paths!=null)
|
||||
path.paths.addAll(anotherPath.paths);
|
||||
return path;
|
||||
}
|
||||
|
||||
protected Path append(String anotherPath){
|
||||
return this.append(new Path(anotherPath));
|
||||
}
|
||||
|
||||
protected Path remove(Path anotherPath){
|
||||
Path path = new Path();
|
||||
path.paths = new LinkedList<String>(this.paths);
|
||||
path.paths.removeAll(anotherPath.paths);
|
||||
return path;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package org.gcube.common.storagehub.model;
|
||||
|
||||
public class Paths {
|
||||
|
||||
public static Path getPath(String path){
|
||||
return new Path(path);
|
||||
}
|
||||
|
||||
public static Path append(Path path, Path anotherPath){
|
||||
return path.append(anotherPath);
|
||||
}
|
||||
|
||||
public static Path append(Path path, String anotherPath){
|
||||
return path.append(anotherPath);
|
||||
}
|
||||
|
||||
public static Path remove(Path path, Path anotherPath){
|
||||
return path.remove(anotherPath);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.common.storagehub.model.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface Attribute {
|
||||
|
||||
String value();
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package org.gcube.common.storagehub.model.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface AttributeRootNode {
|
||||
|
||||
String value();
|
||||
boolean isContentNode() default false;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.common.storagehub.model.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface ItemElement {
|
||||
|
||||
String type();
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package org.gcube.common.storagehub.model.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ListNodes {
|
||||
|
||||
String includeTypeStartWith() default "";
|
||||
String excludeTypeStartWith() default "";
|
||||
Class<?> listClass();
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.common.storagehub.model.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface MapAttribute {
|
||||
|
||||
String excludeStartWith() default "";
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package org.gcube.common.storagehub.model.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface MimeTypeHandler {
|
||||
|
||||
String[] value();
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package org.gcube.common.storagehub.model.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface NodeAttribute {
|
||||
|
||||
String value();
|
||||
boolean isReadOnly() default false;
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.common.storagehub.model.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface RootNode {
|
||||
|
||||
String[] value();
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package org.gcube.common.storagehub.model.expressions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
|
||||
public interface Expression<T> {
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.gcube.common.storagehub.model.expressions;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
public class GenericSearchableItem extends SearchableItem<Item>{
|
||||
|
||||
private static GenericSearchableItem item = new GenericSearchableItem();
|
||||
|
||||
public static GenericSearchableItem get() {
|
||||
return item;
|
||||
}
|
||||
|
||||
protected GenericSearchableItem() {
|
||||
super(Item.class,"nthl:workspaceItem");
|
||||
}
|
||||
|
||||
public final SearchableField<String> title = new SearchableField<String>(String.class, "jcr:title");
|
||||
|
||||
public final SearchableField<Calendar> lastModification = new SearchableField<Calendar>(Calendar.class, "jcr:lastModified");
|
||||
|
||||
public final SearchableField<Calendar> creationTime = new SearchableField<Calendar>(Calendar.class, "jcr:created");
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.gcube.common.storagehub.model.expressions;
|
||||
|
||||
public class OrderField {
|
||||
|
||||
public enum MODE{
|
||||
ASC, DESC
|
||||
}
|
||||
|
||||
private MODE mode;
|
||||
private SearchableField<?> field;
|
||||
|
||||
public OrderField(SearchableField<?> field, MODE mode) {
|
||||
this.mode = mode;
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public OrderField(SearchableField<?> field) {
|
||||
this.mode = MODE.ASC;
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public MODE getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public SearchableField<?> getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.gcube.common.storagehub.model.expressions;
|
||||
|
||||
public final class SearchableField<T> {
|
||||
|
||||
private Class<T> type;
|
||||
|
||||
private String name;
|
||||
|
||||
protected SearchableField() {}
|
||||
|
||||
protected SearchableField(Class<T> _class, String name) {
|
||||
this.type = _class;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[" + name +"]";
|
||||
}
|
||||
|
||||
public Class<T> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.gcube.common.storagehub.model.expressions;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
||||
|
||||
public class SearchableGenericFile extends SearchableItem<AbstractFileItem>{
|
||||
|
||||
private static SearchableGenericFile item = new SearchableGenericFile();
|
||||
|
||||
public static SearchableGenericFile get() {
|
||||
return item;
|
||||
}
|
||||
|
||||
protected SearchableGenericFile() {
|
||||
super(AbstractFileItem.class, "nthl:workspaceLeafItem");
|
||||
}
|
||||
|
||||
public final SearchableField<String> title = new SearchableField<String>(String.class, "jcr:title");
|
||||
|
||||
public final SearchableField<Calendar> lastModification = new SearchableField<Calendar>(Calendar.class, "jcr:lastModified");
|
||||
|
||||
public final SearchableField<Calendar> creationTime = new SearchableField<Calendar>(Calendar.class, "jcr:created");
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.common.storagehub.model.expressions;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
public class SearchableItem<T extends Item> {
|
||||
|
||||
private Class<T> type;
|
||||
private String nodeValue;
|
||||
|
||||
protected SearchableItem(Class<T> _class, String nodeValue){
|
||||
this.type = _class;
|
||||
this.nodeValue = nodeValue;
|
||||
}
|
||||
|
||||
public Class<T> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getNodeValue() {
|
||||
return nodeValue;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package org.gcube.common.storagehub.model.expressions.date;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.gcube.common.storagehub.model.expressions.Expression;
|
||||
import org.gcube.common.storagehub.model.expressions.SearchableField;
|
||||
|
||||
public class Before implements Expression<Boolean> {
|
||||
|
||||
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
|
||||
|
||||
private SearchableField<Calendar> searchableField;
|
||||
private Calendar value;
|
||||
|
||||
protected Before() {}
|
||||
|
||||
public Before(SearchableField<Calendar> searchableField, Calendar value) {
|
||||
super();
|
||||
this.searchableField = searchableField;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public SearchableField<Calendar> getSearchableField() {
|
||||
return searchableField;
|
||||
}
|
||||
|
||||
public Calendar getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Before [searchableField=" + searchableField + ", value=" + dateFormat.format(value.getTime()) + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package org.gcube.common.storagehub.model.expressions.logical;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.gcube.common.storagehub.model.expressions.Expression;
|
||||
|
||||
public class And implements Expression<Boolean>{
|
||||
|
||||
private List<Expression<Boolean>> expressions = new ArrayList<>();
|
||||
|
||||
protected And() {}
|
||||
|
||||
public And(Expression<Boolean> first , Expression<Boolean> second , Expression<Boolean> ... others ) {
|
||||
expressions = new ArrayList<>(2);
|
||||
expressions.add(first);
|
||||
expressions.add(second);
|
||||
if (others !=null && others.length>0)
|
||||
expressions.addAll(Arrays.asList(others));
|
||||
}
|
||||
|
||||
public List<Expression<Boolean>> getExpressions() {
|
||||
return expressions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "And [" + expressions.stream().map(Object::toString).collect(Collectors.joining(",")).toString() + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package org.gcube.common.storagehub.model.expressions.logical;
|
||||
|
||||
import org.gcube.common.storagehub.model.Path;
|
||||
import org.gcube.common.storagehub.model.expressions.Expression;
|
||||
|
||||
public class ISDescendant implements Expression<Boolean>{
|
||||
|
||||
private Path path;
|
||||
|
||||
protected ISDescendant() {}
|
||||
|
||||
public ISDescendant(Path path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public Path getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.gcube.common.storagehub.model.expressions.logical;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.gcube.common.storagehub.model.expressions.Expression;
|
||||
|
||||
public class Or implements Expression<Boolean>{
|
||||
|
||||
List<Expression<Boolean>> expressions = new ArrayList<>();
|
||||
|
||||
protected Or() {}
|
||||
|
||||
public Or(Expression<Boolean> first , Expression<Boolean> second , Expression<Boolean> ... others ) {
|
||||
expressions = Arrays.asList(first, second);
|
||||
if (others !=null && others.length>0)
|
||||
expressions.addAll(Arrays.asList(others));
|
||||
}
|
||||
|
||||
public List<Expression<Boolean>> getExpressions() {
|
||||
return expressions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Or [" + expressions.stream().map(Object::toString).collect(Collectors.joining(",")).toString() + "]";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package org.gcube.common.storagehub.model.expressions.text;
|
||||
|
||||
|
||||
import org.gcube.common.storagehub.model.expressions.Expression;
|
||||
import org.gcube.common.storagehub.model.expressions.SearchableField;
|
||||
|
||||
public class Contains implements Expression<Boolean> {
|
||||
|
||||
private SearchableField<String> searchableField;
|
||||
private String value;
|
||||
|
||||
protected Contains() {}
|
||||
|
||||
public Contains(SearchableField<String> searchableField, String value) {
|
||||
super();
|
||||
this.searchableField = searchableField;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public SearchableField<String> getSearchableField() {
|
||||
return searchableField;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Contains [searchableField=" + searchableField + ", value=" + value + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.nodes.Content;
|
||||
|
||||
public abstract class AbstractFileItem extends Item{
|
||||
|
||||
public abstract Content getContent();
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:workspaceItem")
|
||||
public class FolderItem extends Item {
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.Metadata;
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:gCubeItem")
|
||||
public class GCubeItem extends Item{
|
||||
|
||||
@Attribute("hl:scopes")
|
||||
String[] scopes;
|
||||
|
||||
@Attribute("hl:creator")
|
||||
String creator;
|
||||
|
||||
@Attribute("hl:itemType")
|
||||
String itemType;
|
||||
|
||||
@Attribute("hl:properties")
|
||||
String properties;
|
||||
|
||||
@Attribute("hl:isShared")
|
||||
boolean shared;
|
||||
|
||||
@NodeAttribute("hl:property")
|
||||
Metadata property;
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
import org.gcube.common.storagehub.model.items.nodes.Content;
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:externalFile")
|
||||
public class GenericFileItem extends AbstractFileItem{
|
||||
|
||||
|
||||
|
||||
@NodeAttribute(value ="jcr:content")
|
||||
Content content;
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
import org.gcube.common.storagehub.model.items.nodes.ImageContent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:externalImage")
|
||||
public class ImageFile extends AbstractFileItem{
|
||||
|
||||
@NodeAttribute(value="jcr:content")
|
||||
ImageContent content;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import org.gcube.common.storagehub.model.items.nodes.Accounting;
|
||||
import org.gcube.common.storagehub.model.types.ItemAction;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Item {
|
||||
|
||||
String id;
|
||||
|
||||
String name;
|
||||
|
||||
String path;
|
||||
|
||||
String parentId;
|
||||
|
||||
String parentPath;
|
||||
|
||||
String primaryType;
|
||||
|
||||
boolean trashed;
|
||||
|
||||
boolean shared;
|
||||
|
||||
boolean locked;
|
||||
|
||||
@Attribute("jcr:title")
|
||||
String title;
|
||||
|
||||
@Attribute("jcr:description")
|
||||
String description;
|
||||
|
||||
@Attribute("jcr:lastModifiedBy")
|
||||
String lastModifiedBy;
|
||||
|
||||
@Attribute("jcr:lastModified")
|
||||
Calendar lastModificationTime;
|
||||
|
||||
@Attribute("jcr:created")
|
||||
Calendar creationTime;
|
||||
|
||||
@Attribute("hl:portalLogin")
|
||||
String owner;
|
||||
|
||||
@Attribute("hl:lastAction")
|
||||
ItemAction lastAction;
|
||||
|
||||
@Attribute("hl:hidden")
|
||||
boolean hidden;
|
||||
|
||||
@NodeAttribute(value="hl:accounting", isReadOnly=true)
|
||||
Accounting accounting;
|
||||
|
||||
//List <AccountingDelegate> accounting;
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
import org.gcube.common.storagehub.model.items.nodes.PDFContent;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@RootNode({"nthl:externalPdf"})
|
||||
public class PDFFileItem extends AbstractFileItem {
|
||||
|
||||
@NodeAttribute(value="jcr:content")
|
||||
PDFContent content;
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.Metadata;
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:workspaceSharedItem")
|
||||
public class SharedFolder extends FolderItem {
|
||||
|
||||
@Attribute("hl:privilege")
|
||||
String privilege;
|
||||
|
||||
@Attribute("hl:isVreFolder")
|
||||
boolean vreFolder;
|
||||
|
||||
@Attribute("hl:displayName")
|
||||
String displayName;
|
||||
|
||||
@NodeAttribute("hl:users")
|
||||
Metadata users;
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
import org.gcube.common.storagehub.model.items.nodes.SmartFolderContent;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:workspaceSmartItem")
|
||||
public class SmartFolder {
|
||||
|
||||
@NodeAttribute("jcr:content")
|
||||
SmartFolderContent content;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:trashItem")
|
||||
public class TrashItem extends Item {
|
||||
|
||||
@Attribute("hl:name")
|
||||
String name;
|
||||
|
||||
@Attribute("hl:deletedBy")
|
||||
String deletedBy;
|
||||
|
||||
@Attribute("hl:originalParentId")
|
||||
String originalPArentId;
|
||||
|
||||
@Attribute("hl:deletedFrom")
|
||||
String deletedFrom;
|
||||
|
||||
@Attribute("hl:deletedTime")
|
||||
Calendar deletedTime;
|
||||
|
||||
@Attribute("hl:mimeType")
|
||||
String mimeType;
|
||||
|
||||
@Attribute("hl:length")
|
||||
String lenght;
|
||||
|
||||
@Attribute("hl:isFolder")
|
||||
Boolean folder;
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:workspaceVreItem")
|
||||
public class VreFolder extends SharedFolder {
|
||||
|
||||
|
||||
@Attribute("hl:groupId")
|
||||
String groupId;
|
||||
|
||||
@Attribute("hl:scope")
|
||||
String context;
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
import org.gcube.common.storagehub.model.annotations.ListNodes;
|
||||
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountEntry;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@AttributeRootNode("nthl:accountingSet")
|
||||
public class Accounting {
|
||||
|
||||
@ListNodes(includeTypeStartWith="nthl:accounting", listClass=AccountEntry.class)
|
||||
List<AccountEntry> entries = new ArrayList<AccountEntry>();
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode(value="nthl:file")
|
||||
public class Content {
|
||||
|
||||
@Attribute("hl:size")
|
||||
Long size;
|
||||
|
||||
@Attribute("jcr:data")
|
||||
String data;
|
||||
|
||||
@Attribute("hl:remotePath")
|
||||
String remotePath;
|
||||
|
||||
@Attribute("jcr:mimeType")
|
||||
String mimeType;
|
||||
|
||||
@Attribute("hl:storageId")
|
||||
String storageId;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode(value="nthl:image", isContentNode=true)
|
||||
public class ImageContent extends Content{
|
||||
|
||||
@Attribute("hl:width")
|
||||
Long width;
|
||||
|
||||
@Attribute("hl:height")
|
||||
Long height;
|
||||
|
||||
@Attribute("hl:thumbnailWidth")
|
||||
Long thumbnailWidth;
|
||||
|
||||
@Attribute("hl:thumbnailHeight")
|
||||
Long thumbnailHeight;
|
||||
|
||||
@Attribute("hl:thumbnailData")
|
||||
byte[] thumbnailData;
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode(value="nthl:pdf", isContentNode=true)
|
||||
public class PDFContent extends Content{
|
||||
|
||||
@Attribute("hl:numberOfPages")
|
||||
Long numberOfPages;
|
||||
|
||||
@Attribute("hl:version")
|
||||
String version;
|
||||
|
||||
@Attribute("hl:author")
|
||||
String author;
|
||||
|
||||
@Attribute("hl:title")
|
||||
String title;
|
||||
|
||||
@Attribute("hl:producer")
|
||||
String producer;
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:smartFolderContent")
|
||||
public class SmartFolderContent {
|
||||
|
||||
@Attribute("hl:query")
|
||||
String query;
|
||||
|
||||
@Attribute("hl:folderId")
|
||||
String folderId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntry")
|
||||
public class AccountEntry {
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.UNKNOWN;
|
||||
|
||||
@Attribute("hl:user")
|
||||
String user;
|
||||
|
||||
@Attribute("hl:date")
|
||||
Calendar date;
|
||||
|
||||
@Attribute("hl:version")
|
||||
String version;
|
||||
|
||||
@Attribute("jcr:primaryType")
|
||||
private String primaryType;
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryCreate")
|
||||
public class AccountEntryCreate extends AccountEntry{
|
||||
|
||||
@Attribute("hl:itemName")
|
||||
String itemName;
|
||||
|
||||
final AccountingEntryType type = AccountingEntryType.CREATE;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryDelete")
|
||||
public class AccountEntryDelete extends AccountEntry{
|
||||
|
||||
@Attribute("hl:itemName")
|
||||
String itemName;
|
||||
|
||||
@Attribute("hl:fromPath")
|
||||
String fromPath;
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.DELETE;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryDisabledPublicAccess")
|
||||
public class AccountEntryDisabledPublicAccess extends AccountEntry{
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.DISABLED_PUBLIC_ACCESS;
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryEnabledPublicAccess")
|
||||
public class AccountEntryEnabledPublicAccess extends AccountEntry{
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.ENABLED_PUBLIC_ACCESS;
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryPaste")
|
||||
public class AccountEntryPaste extends AccountEntry{
|
||||
|
||||
@Attribute("hl:fromPath")
|
||||
String fromPath;
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.PASTE;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryRead")
|
||||
public class AccountEntryRead extends AccountEntry{
|
||||
|
||||
@Attribute("hl:itemName")
|
||||
String itemName;
|
||||
|
||||
final AccountingEntryType type = AccountingEntryType.READ;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryRestore")
|
||||
public class AccountEntryRestore extends AccountEntry{
|
||||
|
||||
@Attribute("hl:itemName")
|
||||
String itemName;
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.RESTORE;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryShare")
|
||||
public class AccountEntryShare extends AccountEntry{
|
||||
|
||||
@Attribute("hl:itemName")
|
||||
String itemName;
|
||||
|
||||
@Attribute("hl:members")
|
||||
String[] members;
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.SHARE;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryUnshare")
|
||||
public class AccountEntryUnshare extends AccountEntry{
|
||||
|
||||
@Attribute("hl:itemName")
|
||||
String itemName;
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.UNSHARE;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingEntryUpdate")
|
||||
public class AccountEntryUpdate extends AccountEntry{
|
||||
|
||||
@Attribute("hl:itemName")
|
||||
String itemName;
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.UPDATE;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingFolderEntryAdd")
|
||||
public class AccountFolderEntryAdd extends AccountFolderEntryRemoval{
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.ADD;
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingFolderEntryCut")
|
||||
public class AccountFolderEntryCut extends AccountFolderEntryRemoval{
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.CUT;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingFolderEntryRemoval")
|
||||
public class AccountFolderEntryRemoval extends AccountEntry{
|
||||
|
||||
@Attribute("hl:itemName")
|
||||
String itemName;
|
||||
|
||||
@Attribute("hl:folderItemType")
|
||||
String folderItemType;
|
||||
|
||||
@Attribute("hl:itemType")
|
||||
String itmeType;
|
||||
|
||||
@Attribute("hl:mimeType")
|
||||
String mimeType;
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.REMOVAL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode("nthl:accountingFolderEntryRenaming")
|
||||
public class AccountFolderEntryRenaming {
|
||||
|
||||
@Attribute("hl:oldItemName")
|
||||
String oldItemName;
|
||||
|
||||
@Attribute("hl:newItemName")
|
||||
String newItemName;
|
||||
|
||||
AccountingEntryType type = AccountingEntryType.RENAMING;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes.accounting;
|
||||
|
||||
|
||||
public enum AccountingEntryType {
|
||||
|
||||
CREATE("nthl:accountingEntryCreate"),
|
||||
|
||||
READ("nthl:accountingEntryRead"),
|
||||
|
||||
ADD("nthl:accountingFolderEntryAdd"),
|
||||
|
||||
PASTE("nthl:accountingEntryPaste"),
|
||||
|
||||
CUT("nthl:accountingFolderEntryCut"),
|
||||
|
||||
UPDATE("nthl:accountingEntryUpdate"),
|
||||
|
||||
SHARE("nthl:accountingEntryShare"),
|
||||
|
||||
UNSHARE("nthl:accountingEntryUnshare"),
|
||||
|
||||
REMOVAL("nthl:accountingFolderEntryRemoval"),
|
||||
|
||||
RENAMING("nthl:accountingFolderEntryRenaming"),
|
||||
|
||||
DELETE("nthl:accountingEntryDelete"),
|
||||
|
||||
RESTORE("nthl:accountingEntryRestore"),
|
||||
|
||||
ENABLED_PUBLIC_ACCESS("nthl:accountingEntryEnabledPublicAccess"),
|
||||
|
||||
DISABLED_PUBLIC_ACCESS("nthl:accountingEntryDisabledPublicAccess"),
|
||||
|
||||
SET_ACL("nthl:accountingEntryAddACL"),
|
||||
|
||||
UNKNOWN("nthl:accountingEntry");
|
||||
|
||||
|
||||
private String nodeTypeDefinition;
|
||||
|
||||
AccountingEntryType(String value) {
|
||||
this.nodeTypeDefinition = value;
|
||||
}
|
||||
|
||||
public String getNodeTypeDefinition() {
|
||||
return nodeTypeDefinition;
|
||||
}
|
||||
|
||||
public static AccountingEntryType getEnum(String value) {
|
||||
for (AccountingEntryType entry : AccountingEntryType.values()) {
|
||||
if (entry.getNodeTypeDefinition().compareTo(value) == 0) {
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package org.gcube.common.storagehub.model.query;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.common.storagehub.model.expressions.GenericSearchableItem;
|
||||
import org.gcube.common.storagehub.model.expressions.SearchableGenericFile;
|
||||
import org.gcube.common.storagehub.model.expressions.SearchableItem;
|
||||
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
public class Queries {
|
||||
|
||||
private static Map<Class<?>,SearchableItem<?>> searchableRegistry = new HashMap<>();
|
||||
|
||||
static {
|
||||
searchableRegistry.put(Item.class, GenericSearchableItem.get());
|
||||
searchableRegistry.put(AbstractFileItem.class, SearchableGenericFile.get());
|
||||
|
||||
}
|
||||
|
||||
public static <T extends Item> Query<SearchableItem<?>> queryFor(Class<T> searchable) {
|
||||
return new Query<>(searchableRegistry.get(searchable));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package org.gcube.common.storagehub.model.query;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.common.storagehub.model.expressions.Expression;
|
||||
import org.gcube.common.storagehub.model.expressions.OrderField;
|
||||
import org.gcube.common.storagehub.model.expressions.SearchableItem;
|
||||
|
||||
public class Query<T extends SearchableItem<?>> {
|
||||
|
||||
private T searchableItem;
|
||||
|
||||
private Expression<Boolean> expression;
|
||||
|
||||
private int limit = -1;
|
||||
|
||||
private int offset =-1;
|
||||
|
||||
private List<OrderField> orderFields = null;
|
||||
|
||||
protected Query(T searchableItem) {
|
||||
this.searchableItem = searchableItem;
|
||||
}
|
||||
|
||||
public void setExpression(Expression<Boolean> expression) {
|
||||
this.expression= expression;
|
||||
}
|
||||
|
||||
public void setOrder(OrderField ... fields ) {
|
||||
if (fields!=null && fields.length>0)
|
||||
this.orderFields = Arrays.asList(fields);
|
||||
}
|
||||
|
||||
public void setLimit(int limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public void setOffset(int offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
public T getSearchableItem() {
|
||||
return searchableItem;
|
||||
}
|
||||
|
||||
public Expression<Boolean> getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public int getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public List<OrderField> getOrderFields() {
|
||||
return orderFields;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package org.gcube.common.storagehub.model.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ItemList {
|
||||
|
||||
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
|
||||
private List<? extends Item> itemlist;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package org.gcube.common.storagehub.model.service;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ItemWrapper<T extends Item> {
|
||||
|
||||
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
|
||||
private T item;
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
public enum ContentType {
|
||||
GENERAL {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:file";
|
||||
}
|
||||
},
|
||||
IMAGE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:image";
|
||||
}
|
||||
},
|
||||
PDF {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:pdf";
|
||||
}
|
||||
},
|
||||
TS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:timeSeriesItemContent";
|
||||
}
|
||||
},
|
||||
QUERY {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:queryItemContent";
|
||||
}
|
||||
},
|
||||
REPORT {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:reportItemContent";
|
||||
}
|
||||
},
|
||||
REPORT_TEMPLATE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:reportTemplateContent";
|
||||
}
|
||||
},
|
||||
METADATA{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:metadataItemContent";
|
||||
}
|
||||
},
|
||||
DOCUMENT{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:documentItemContent";
|
||||
}
|
||||
},
|
||||
SMART{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:smartFolderContent";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
/**
|
||||
* @author Federico De Faveri defaveri@isti.cnr.it
|
||||
*
|
||||
*/
|
||||
public enum FileItemType implements GenericItemType{
|
||||
|
||||
/**
|
||||
* External image.
|
||||
*/
|
||||
EXTERNAL_IMAGE,
|
||||
|
||||
/**
|
||||
* External file.
|
||||
*/
|
||||
EXTERNAL_FILE,
|
||||
|
||||
/**
|
||||
* External PDF file.
|
||||
*/
|
||||
EXTERNAL_PDF_FILE,
|
||||
|
||||
/**
|
||||
* External url.
|
||||
*/
|
||||
EXTERNAL_URL,
|
||||
|
||||
/**
|
||||
* Query.
|
||||
*/
|
||||
QUERY,
|
||||
|
||||
/**
|
||||
* Report template.
|
||||
*/
|
||||
REPORT_TEMPLATE,
|
||||
|
||||
/**
|
||||
* Report.
|
||||
*/
|
||||
REPORT,
|
||||
|
||||
/**
|
||||
* A time series.
|
||||
*/
|
||||
TIME_SERIES,
|
||||
|
||||
/**
|
||||
* Document.
|
||||
*/
|
||||
DOCUMENT,
|
||||
|
||||
/**
|
||||
* Image document.
|
||||
*/
|
||||
IMAGE_DOCUMENT,
|
||||
|
||||
/**
|
||||
* PDF document.
|
||||
*/
|
||||
PDF_DOCUMENT,
|
||||
|
||||
/**
|
||||
* Url document.
|
||||
*/
|
||||
URL_DOCUMENT,
|
||||
|
||||
/**
|
||||
* Metadata.
|
||||
*/
|
||||
METADATA,
|
||||
|
||||
/**
|
||||
* Trash item
|
||||
*/
|
||||
TRASH_ITEM,
|
||||
|
||||
/**
|
||||
* A gCube item.
|
||||
*/
|
||||
GCUBE_ITEM,
|
||||
|
||||
/**
|
||||
* Workflow report.
|
||||
*/
|
||||
WORKFLOW_REPORT;
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
public interface GenericItemType {
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
/**
|
||||
* @author Federico De Faveri defaveri@isti.cnr.it
|
||||
*
|
||||
*/
|
||||
public enum ItemAction {
|
||||
/**
|
||||
* The item has been created.
|
||||
*/
|
||||
CREATED,
|
||||
|
||||
/**
|
||||
* The item has been renamed.
|
||||
*/
|
||||
RENAMED,
|
||||
|
||||
/**
|
||||
* The item has been moved.
|
||||
*/
|
||||
MOVED,
|
||||
|
||||
/**
|
||||
* The item has been cloned.
|
||||
*/
|
||||
CLONED,
|
||||
|
||||
/**
|
||||
* The item has been updates.
|
||||
*/
|
||||
UPDATED;
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
|
||||
/**
|
||||
* @author gioia
|
||||
*
|
||||
*/
|
||||
public enum ItemType implements GenericItemType{
|
||||
|
||||
/**
|
||||
* A folder.
|
||||
*/
|
||||
FOLDER,
|
||||
|
||||
/**
|
||||
* A shared folder
|
||||
*/
|
||||
SHARED_FOLDER,
|
||||
|
||||
/**
|
||||
* A smart folder
|
||||
*/
|
||||
SMART_FOLDER,
|
||||
|
||||
/**
|
||||
* A folder item.
|
||||
*/
|
||||
FOLDER_ITEM,
|
||||
|
||||
/**
|
||||
* A trash folder.
|
||||
*/
|
||||
TRASH_FOLDER,
|
||||
|
||||
/**
|
||||
* A trash item.
|
||||
*/
|
||||
TRASH_ITEM;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
public class Namespace {
|
||||
|
||||
public static final String HL_NAMESPACE = "hl:";
|
||||
public static final String JCR_NAMESPACE = "jcr:";
|
||||
public static final String REP_NAMESPACE = "rep:";
|
||||
public static final String NT_NAMESPACE = "nt:";
|
||||
|
||||
}
|
|
@ -0,0 +1,683 @@
|
|||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
public enum NodeProperty {
|
||||
|
||||
//nthl:workspaceItem
|
||||
TITLE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "jcr:title";
|
||||
}
|
||||
},
|
||||
CREATED {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "jcr:created";
|
||||
}
|
||||
},
|
||||
LAST_MODIFIED {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "jcr:lastModified";
|
||||
}
|
||||
},
|
||||
LAST_ACTION {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:lastAction";
|
||||
}
|
||||
},
|
||||
|
||||
OWNER {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:owner";
|
||||
}
|
||||
},
|
||||
PORTAL_LOGIN {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:portalLogin";
|
||||
}
|
||||
},
|
||||
|
||||
LAST_MODIFIED_BY {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "jcr:lastModifiedBy";
|
||||
}
|
||||
},
|
||||
DESCRIPTION {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "jcr:description";
|
||||
}
|
||||
},
|
||||
USER_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:uuid";
|
||||
}
|
||||
},
|
||||
IS_PUBLIC {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:isPublic";
|
||||
}
|
||||
},
|
||||
|
||||
// //nthl:workspaceSharedItem
|
||||
|
||||
IS_VRE_FOLDER {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:isVreFolder";
|
||||
}
|
||||
},
|
||||
DISPLAY_NAME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:displayName";
|
||||
}
|
||||
},
|
||||
|
||||
USER {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:user";
|
||||
}
|
||||
},
|
||||
USERS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:users";
|
||||
}
|
||||
},
|
||||
MEMBERS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:members";
|
||||
}
|
||||
},
|
||||
|
||||
// file
|
||||
|
||||
CONTENT {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "jcr:content";
|
||||
}
|
||||
},
|
||||
FOLDER_ITEM_TYPE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:workspaceItemType";
|
||||
}
|
||||
},
|
||||
MIME_TYPE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "jcr:mimeType";
|
||||
}
|
||||
},
|
||||
DATA {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "jcr:data";
|
||||
}
|
||||
},
|
||||
SIZE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:size";
|
||||
}
|
||||
},
|
||||
REMOTE_STORAGE_PATH {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:remotePath";
|
||||
}
|
||||
},
|
||||
STORAGE_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:storageId";
|
||||
}
|
||||
},
|
||||
STORAGE_PATH {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:storagePath";
|
||||
}
|
||||
},
|
||||
|
||||
// image
|
||||
|
||||
IMAGE_WIDTH {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:width";
|
||||
}
|
||||
},
|
||||
IMAGE_HEIGHT {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:height";
|
||||
}
|
||||
},
|
||||
THUMBNAIL_DATA {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:thumbnailData";
|
||||
}
|
||||
},
|
||||
THUMBNAIL_WIDTH {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:thumbnailWidth";
|
||||
}
|
||||
},
|
||||
THUMBNAIL_HEIGHT {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:thumbnailHeight";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//pdf
|
||||
|
||||
AUTHOR {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:author";
|
||||
}
|
||||
},
|
||||
NUMBER_OF_PAGES {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:numberOfPages";
|
||||
}
|
||||
},
|
||||
VERSION {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:version";
|
||||
}
|
||||
},
|
||||
PDF_TITLE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:title";
|
||||
}
|
||||
},
|
||||
PRODUCER {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:producer";
|
||||
}
|
||||
},
|
||||
|
||||
// gcubeItem
|
||||
SCOPES {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:scopes";
|
||||
}
|
||||
},
|
||||
CREATOR {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:creator";
|
||||
}
|
||||
},
|
||||
ITEM_TYPE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:itemType";
|
||||
}
|
||||
},
|
||||
PROPERTIES {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:properties";
|
||||
}
|
||||
},
|
||||
PROPERTY {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:property";
|
||||
}
|
||||
},
|
||||
IS_SHARED {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:isShared";
|
||||
}
|
||||
},
|
||||
SHARED_ROOT_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:sharedRootId";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// trashItem
|
||||
DELETE_DATE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:deletedTime";
|
||||
}
|
||||
},
|
||||
DELETE_BY {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:deletedBy";
|
||||
}
|
||||
},
|
||||
ORIGINAL_PARENT_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:originalParentId";
|
||||
}
|
||||
},
|
||||
DELETED_FROM {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:deletedFrom";
|
||||
}
|
||||
},
|
||||
TRASH_ITEM_NAME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:name";
|
||||
}
|
||||
},
|
||||
TRASH_ITEM_MIME_TYPE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:mimeType";
|
||||
}
|
||||
},
|
||||
LENGTH {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:length";
|
||||
}
|
||||
},
|
||||
IS_FOLDER {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:isFolder";
|
||||
}
|
||||
},
|
||||
|
||||
// messages
|
||||
SUBJECT {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:subject";
|
||||
}
|
||||
},
|
||||
BODY {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:body";
|
||||
}
|
||||
},
|
||||
ATTACHMENTS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:attachments";
|
||||
}
|
||||
},
|
||||
ATTACHMENTS_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:attachId";
|
||||
}
|
||||
},
|
||||
ADDRESSES {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:addresses";
|
||||
}
|
||||
},
|
||||
SCOPE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:scope";
|
||||
}
|
||||
},
|
||||
READ {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:read";
|
||||
}
|
||||
},
|
||||
OPEN {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:open";
|
||||
}
|
||||
},
|
||||
NT_USER {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:user";
|
||||
}
|
||||
},
|
||||
|
||||
// timeseries
|
||||
|
||||
TIMESERIES_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:id";
|
||||
}
|
||||
},
|
||||
TIMESERIES_TITLE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:title";
|
||||
}
|
||||
},
|
||||
TIMESERIES_DESCRIPTION {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:description";
|
||||
}
|
||||
},
|
||||
TIMESERIES_CREATOR {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:creator";
|
||||
}
|
||||
},
|
||||
TIMESERIES_CREATED {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:created";
|
||||
}
|
||||
},
|
||||
TIMESERIES_PUBLISHER {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:publisher";
|
||||
}
|
||||
},
|
||||
TIMESERIES_SOURCE_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:sourceId";
|
||||
}
|
||||
},
|
||||
TIMESERIES_SOURCE_NAME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:sourceName";
|
||||
}
|
||||
},
|
||||
TIMESERIES_RIGHTS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:rights";
|
||||
}
|
||||
},
|
||||
TIMESERIES_DIMENSION {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:dimension";
|
||||
}
|
||||
},
|
||||
HEADER_LABELS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:headerLabels";
|
||||
}
|
||||
},
|
||||
|
||||
// query
|
||||
|
||||
QUERY {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:query";
|
||||
}
|
||||
},
|
||||
FOLDER_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:folderId";
|
||||
}
|
||||
},
|
||||
QUERY_TYPE {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:queryType";
|
||||
}
|
||||
},
|
||||
|
||||
//report template
|
||||
|
||||
RT_CREATED {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:created";
|
||||
}
|
||||
},
|
||||
LAST_EDIT {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:lastEdit";
|
||||
}
|
||||
},
|
||||
LAST_EDIT_BY {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:lastEditBy";
|
||||
}
|
||||
},
|
||||
NUMBER_OF_SECTION {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:numberOfSection";
|
||||
}
|
||||
},
|
||||
STATUS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:status";
|
||||
}
|
||||
},
|
||||
FAILURES {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:failures";
|
||||
}
|
||||
},
|
||||
TEMPLATE_NAME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:templateName";
|
||||
}
|
||||
},
|
||||
|
||||
//metadata
|
||||
|
||||
SCHEMA{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:schema";
|
||||
}
|
||||
},
|
||||
LANGUAGE{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:language";
|
||||
}
|
||||
},
|
||||
COLLECTION_NAME{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:collectionName";
|
||||
}
|
||||
},
|
||||
OID{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:oid";
|
||||
}
|
||||
},
|
||||
|
||||
NT_CONTENT{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:metadataItemContent";
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
//document
|
||||
|
||||
METADATA{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:metadata";
|
||||
}
|
||||
},
|
||||
ANNOTATIONS{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:annotations";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
ALTERNATIVES {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:alternatives";
|
||||
}
|
||||
},
|
||||
|
||||
PARENT_URI{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:parentUri";
|
||||
}
|
||||
},
|
||||
URI{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:uri";
|
||||
}
|
||||
},
|
||||
NAME{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:name";
|
||||
}
|
||||
},
|
||||
HL_MIME_TYPE{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:mimeType";
|
||||
}
|
||||
},
|
||||
|
||||
NT_ALTERNATIVE{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:documentAlternativeLink";
|
||||
}
|
||||
},
|
||||
NT_PART {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:documentPartLink";
|
||||
}
|
||||
},
|
||||
|
||||
PARTS{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:parts";
|
||||
}
|
||||
},
|
||||
|
||||
URL{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:url";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//accounting
|
||||
ACCOUNTING{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:accounting";
|
||||
}
|
||||
},
|
||||
NT_ACCOUNTING{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nthl:accountingSet";
|
||||
}
|
||||
},
|
||||
|
||||
//workflow
|
||||
WORKFLOW_ID{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:workflowId";
|
||||
}
|
||||
},
|
||||
WORKFLOW_DATA{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:workflowData";
|
||||
}
|
||||
},
|
||||
WORKFLOW_STATUS{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:workflowStatus";
|
||||
}
|
||||
},
|
||||
REFERENCE{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:reference";
|
||||
}
|
||||
},
|
||||
HIDDEN{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:hidden";
|
||||
}
|
||||
},
|
||||
GROUP_ID{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:groupId";
|
||||
}
|
||||
},
|
||||
IS_SYSTEM_FOLDER{
|
||||
@Override
|
||||
public String toString() {
|
||||
return "hl:IsSystemFolder";
|
||||
}
|
||||
};
|
||||
|
||||
public static NodeProperty fromValue(String value) {
|
||||
for(NodeProperty v : values())
|
||||
if(v.toString().equalsIgnoreCase(value)) return v;
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
public class PrimaryNodeType {
|
||||
|
||||
|
||||
public static final String NT_ROOT_ITEM_SENT = "nthl:rootItemSentRequest";
|
||||
public static final String NT_ITEM_SENT = "nthl:itemSentRequest";
|
||||
// public static final String NT_MESSAGE = "nthl:itemSentRequest";
|
||||
public static final String NT_WORKSPACE_ROOT = "rep:root";
|
||||
public static final String NT_WORKSPACE_FOLDER = "nthl:workspaceItem";
|
||||
public static final String NT_WORKSPACE_SHARED_FOLDER = "nthl:workspaceSharedItem";
|
||||
public static final String NT_WORKSPACE_VRE_FOLDER = "nthl:workspaceVreItem";
|
||||
public static final String NT_WORKSPACE_FOLDER_ITEM = "nthl:workspaceLeafItem";
|
||||
public static final String NT_WORKSPACE_FILE = "nthl:externalFile";
|
||||
public static final String NT_WORKSPACE_IMAGE = "nthl:externalImage";
|
||||
public static final String NT_WORKSPACE_PDF_FILE = "nthl:externalPdf";
|
||||
public static final String NT_WORKSPACE_URL = "nthl:externalUrl";
|
||||
public static final String NT_WORKSPACE_SMART_FOLDER = "nthl:workspaceSmartItem";
|
||||
public static final String NT_ROOT_FOLDER_BULK_CREATOR = "nthl:rootFolderBulkCreator";
|
||||
|
||||
public static final String NT_WORKSPACE_REPORT = "nthl:report";
|
||||
public static final String NT_WORKSPACE_REPORT_TEMPLATE = "nthl:reportTemplate";
|
||||
public static final String NT_WORKSPACE_WORKFLOW_REPORT = "nthl:workflowReport";
|
||||
public static final String NT_WORKSPACE_WORKFLOW_TEMPLATE = "nthl:workflowTemplate";
|
||||
public static final String NT_WORKSPACE_REFERENCE = "nthl:workspaceReference";
|
||||
|
||||
public static final String NT_ANNOTATION_ITEM = "nthl:gCubeAnnotation";
|
||||
public static final String NT_ANNOTATION_LINK_ITEM = "nthl:gCubeAnnotationLink";
|
||||
|
||||
public static final String NT_DOCUMENT_ITEM = "nthl:gCubeDocument";
|
||||
public static final String NT_DOCUMENT_LINK_ITEM = "nthl:gCubeDocumentLink";
|
||||
public static final String NT_IMAGE_DOCUMENT_ITEM = "nthl:gCubeImageDocument";
|
||||
public static final String NT_IMAGE_DOCUMENT_LINK_ITEM = "nthl:gCubeImageDocumentLink";
|
||||
public static final String NT_PDF_DOCUMENT_ITEM = "nthl:gCubePDFDocument";
|
||||
public static final String NT_PDF_DOCUMENT_LINK_ITEM = "nthl:gCubePDFDocumentLink";
|
||||
public static final String NT_URL_DOCUMENT_ITEM = "nthl:gCubeURLDocument";
|
||||
public static final String NT_METADATA_ITEM = "nthl:gCubeMetadata";
|
||||
public static final String NT_METADATA_LINK_ITEM = "nthl:gCubeMetadataLink";
|
||||
public static final String NT_AQUAMAPS_ITEM = "nthl:aquamapsItem";
|
||||
public static final String NT_GCUBE_ITEM = "nthl:gCubeItem";
|
||||
public static final String NT_TIMESERIES_ITEM = "nthl:timeSeriesItem";
|
||||
public static final String NT_QUERY = "nthl:query";
|
||||
public static final String NT_EXTERNAL_RESOURCE_LINK_ITEM = "nthl:externalResourceLink";
|
||||
public static final String NT_TABULAR_DATA_LINK = "nthl:tabularDataLink";
|
||||
public static final String NT_TRASH_ITEM = "nthl:trashItem";
|
||||
|
||||
public static final String NT_ROOT_MESSAGES = "nthl:rootItemSentRequest";
|
||||
public static final String NT_FOLDER = "nt:folder";
|
||||
public static final String NT_HOME = "nthl:home";
|
||||
|
||||
protected static final String ACCOUNTING = "hl:accounting";
|
||||
protected static final String NT_ACCOUNTING = "nthl:accountingSet";
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.common.storagehub.model.types;
|
||||
|
||||
|
||||
/**
|
||||
* @author gioia
|
||||
*
|
||||
*/
|
||||
public enum WorkspaceItemType implements GenericItemType{
|
||||
|
||||
/**
|
||||
* A folder.
|
||||
*/
|
||||
FOLDER,
|
||||
|
||||
/**
|
||||
* A shared folder
|
||||
*/
|
||||
SHARED_FOLDER,
|
||||
|
||||
/**
|
||||
* A smart folder
|
||||
*/
|
||||
SMART_FOLDER,
|
||||
|
||||
/**
|
||||
* A folder item.
|
||||
*/
|
||||
FOLDER_ITEM,
|
||||
|
||||
/**
|
||||
* A trash folder.
|
||||
*/
|
||||
TRASH_FOLDER,
|
||||
|
||||
/**
|
||||
* A trash item.
|
||||
*/
|
||||
TRASH_ITEM;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.gcube.storagehub.model.expressions;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.gcube.common.storagehub.model.expressions.Expression;
|
||||
import org.gcube.common.storagehub.model.expressions.GenericSearchableItem;
|
||||
import org.gcube.common.storagehub.model.expressions.date.Before;
|
||||
import org.gcube.common.storagehub.model.expressions.logical.And;
|
||||
import org.gcube.common.storagehub.model.expressions.text.Contains;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ExpressionsTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void contains() {
|
||||
Expression<Boolean> expr = new Contains(GenericSearchableItem.get().title, "Data");
|
||||
System.out.println( expr.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void and() {
|
||||
|
||||
Expression<Boolean> cont1 = new Contains(GenericSearchableItem.get().title, "Data");
|
||||
Expression<Boolean> before = new Before(GenericSearchableItem.get().creationTime, Calendar.getInstance());
|
||||
Expression<Boolean> andExpr = new And(cont1, before);
|
||||
System.out.println( andExpr.toString());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue