Fixed Documentation management
This commit is contained in:
parent
b1515d1c33
commit
deec4a584c
|
@ -17,7 +17,7 @@
|
||||||
<ruby-json-client disabled="true" />
|
<ruby-json-client disabled="true" />
|
||||||
<java-json-client disabled="true" />
|
<java-json-client disabled="true" />
|
||||||
<javascript-client disabled="true" />
|
<javascript-client disabled="true" />
|
||||||
<docs docsDir="${project.build.directory}" docsSubdir="docs" />
|
<docs docsDir="${project.build.directory}" docsSubdir="api-docs" />
|
||||||
<!-- REPLACE THE ${project.artifactId} WITH YOUR APPLICATION NAME. E.g. /gcat, /uri-resolver. if the ${project.artifactId} is not matching your APPLICATION Name /> -->
|
<!-- REPLACE THE ${project.artifactId} WITH YOUR APPLICATION NAME. E.g. /gcat, /uri-resolver. if the ${project.artifactId} is not matching your APPLICATION Name /> -->
|
||||||
<swagger basePath="/${project.artifactId}" />
|
<swagger basePath="/${project.artifactId}" />
|
||||||
<docs freemarkerTemplate="${project.basedir}/src/main/resources/META-INF/enunciate/d4science_docs.fmt">
|
<docs freemarkerTemplate="${project.basedir}/src/main/resources/META-INF/enunciate/d4science_docs.fmt">
|
||||||
|
|
|
@ -6,5 +6,6 @@
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<description>${project.description}</description>
|
<description>${project.description}</description>
|
||||||
<exclude>/srv/docs/*</exclude>
|
<exclude>/srv/docs/*</exclude>
|
||||||
|
<exclude>/srv/api-docs/*</exclude>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|
|
@ -174,26 +174,7 @@
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!-- Enunciate Maven plugin -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.webcohesion.enunciate</groupId>
|
|
||||||
<artifactId>enunciate-maven-plugin</artifactId>
|
|
||||||
<version>${enunciate.version}</version>
|
|
||||||
<configuration>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>assemble</id>
|
|
||||||
<goals>
|
|
||||||
<goal>assemble</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- SPHINX PLUGIN triggered at 'compile'-->
|
<!-- SPHINX PLUGIN triggered at 'compile'-->
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>kr.motd.maven</groupId>
|
<groupId>kr.motd.maven</groupId>
|
||||||
<artifactId>sphinx-maven-plugin</artifactId>
|
<artifactId>sphinx-maven-plugin</artifactId>
|
||||||
|
@ -214,6 +195,22 @@
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<!-- Enunciate Maven plugin -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.webcohesion.enunciate</groupId>
|
||||||
|
<artifactId>enunciate-maven-plugin</artifactId>
|
||||||
|
<version>${enunciate.version}</version>
|
||||||
|
<configuration>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>assemble</id>
|
||||||
|
<goals>
|
||||||
|
<goal>assemble</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<!-- Copy Enunciate Documentation from your-application/docs to your-application.war -->
|
<!-- Copy Enunciate Documentation from your-application/docs to your-application.war -->
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -240,35 +237,6 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
||||||
<!-- https://trustin.github.io/sphinx-maven-plugin/basic-usage.html#executing-within-normal-lifecycle-->
|
|
||||||
|
|
||||||
<!-- <reporting>-->
|
|
||||||
<!-- <plugins>-->
|
|
||||||
<!-- <plugin>-->
|
|
||||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
|
||||||
<!-- <artifactId>maven-project-info-reports-plugin</artifactId>-->
|
|
||||||
<!-- <version>2.9</version>-->
|
|
||||||
<!-- <reportSets>-->
|
|
||||||
<!-- <reportSet>-->
|
|
||||||
<!-- <reports />-->
|
|
||||||
<!-- </reportSet>-->
|
|
||||||
<!-- </reportSets>-->
|
|
||||||
<!-- </plugin>-->
|
|
||||||
<!-- <plugin>-->
|
|
||||||
<!-- <groupId>kr.motd.maven</groupId>-->
|
|
||||||
<!-- <artifactId>sphinx-maven-plugin</artifactId>-->
|
|
||||||
<!-- <version>2.10.0</version>-->
|
|
||||||
<!-- <configuration>-->
|
|
||||||
<!-- <builder>html</builder>-->
|
|
||||||
<!-- <configDirectory>src/site/sphinx</configDirectory>-->
|
|
||||||
<!-- </configuration>-->
|
|
||||||
<!-- </plugin>-->
|
|
||||||
<!-- </plugins>-->
|
|
||||||
<!-- </reporting>-->
|
|
||||||
</project>
|
</project>
|
|
@ -131,13 +131,13 @@ public abstract class MongoManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Document updateDoc(ObjectId id, Document updateSet) {
|
// public Document updateDoc() {
|
||||||
MongoCollection<Document> coll=getCollection();
|
// MongoCollection<Document> coll=getCollection();
|
||||||
return coll.findOneAndUpdate(
|
// return coll.findOneAndUpdate(
|
||||||
eq(mongoIDFieldName(),id),
|
// eq(mongoIDFieldName(),id),
|
||||||
updateSet,
|
// updateSet,
|
||||||
new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER));
|
// new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,16 @@
|
||||||
</init-param>
|
</init-param>
|
||||||
<load-on-startup>1</load-on-startup>
|
<load-on-startup>1</load-on-startup>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>default</servlet-name>
|
||||||
|
<url-pattern>/docs/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>default</servlet-name>
|
||||||
|
<url-pattern>/api-docs/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>org.gcube.application.geoportal.service.GeoPortalService</servlet-name>
|
<servlet-name>org.gcube.application.geoportal.service.GeoPortalService</servlet-name>
|
||||||
<url-pattern>/srv/*</url-pattern>
|
<url-pattern>/srv/*</url-pattern>
|
||||||
|
|
|
@ -8,6 +8,7 @@ public class MongoTester extends MongoManager {
|
||||||
return new MongoTester("legacyConcessioni",ID);}
|
return new MongoTester("legacyConcessioni",ID);}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String theID=null;
|
private String theID=null;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package org.gcube.application.geoportal.service.engine.mongo;
|
||||||
|
|
||||||
|
import com.mongodb.Block;
|
||||||
|
import com.mongodb.client.model.Filters;
|
||||||
|
import org.bson.BSON;
|
||||||
|
import org.bson.Document;
|
||||||
|
import org.bson.types.ObjectId;
|
||||||
|
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||||
|
import org.gcube.application.cms.serialization.Serialization;
|
||||||
|
import org.gcube.application.cms.tests.TokenSetter;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
|
import org.gcube.application.geoportal.service.engine.providers.MongoClientProvider;
|
||||||
|
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
public class ProjectsManualUpdate {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws ConfigurationException {
|
||||||
|
ImplementationProvider.get().setEngine(new MongoClientProvider() {
|
||||||
|
@Override
|
||||||
|
public Mongo getObject() throws ConfigurationException {
|
||||||
|
TokenSetter.set(GCubeTest.getContext());
|
||||||
|
return super.getObject();
|
||||||
|
}
|
||||||
|
},Mongo.class);
|
||||||
|
|
||||||
|
MongoTester mongo = new MongoTester("profiledConcessioni");
|
||||||
|
|
||||||
|
// UPDATE PHASE = DRAFT
|
||||||
|
// mongo.getCollection().find().forEach((Consumer) t ->{
|
||||||
|
// Project p= Serialization.convert(t, Project.class);
|
||||||
|
// p.getLifecycleInformation().setPhase(LifecycleInformation.CommonPhases.DRAFT_PHASE);
|
||||||
|
// try{
|
||||||
|
// mongo.replaceDoc(Serialization.asDocumentWithId(p),new ObjectId(p.getId()));
|
||||||
|
// }catch(Throwable e){throw new RuntimeException(e);}
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
mongo.getCollection().deleteMany(Filters.eq("_theDocument",null));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue