### Launch Netbeans Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Start Netbeans by executing the 'netbeans' script located in the installation's bin directory. ```bash ./bin/netbeans ``` -------------------------------- ### Install Composer using PHP Script Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Installs Composer globally using the official setup script with specified installation directory and filename. ```bash php composer-setup.php --install-dir=bin --filename=composer ``` -------------------------------- ### Run Netbeans Installer Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Execute the Netbeans installer script to begin the installation process. ```bash sh ~/Downloads/netbeans-X.X-linux.sh ``` -------------------------------- ### Configuration Properties Example Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Example of configuration properties for MongoDB, PostgreSQL, RDF4J, and Webservice. ```properties # MongoDB configuration mongo.host=127.0.0.1 mongo.port=27017 mongo.db= mongo.user=opensilex mongo.password=azerty mongo.authdb=opensilex # PostgreSQL configuration pg.host=127.0.0.1 pg.port=5432 pg.db= pg.user=opensilex pg.password=azerty # RDF4J Configuration rdf.host=127.0.0.1 rdf.port=8080 rdf.path=rdf4j-server rdf.infra=opensilex rdf.repo=opensilex # Webservice configuration ws.log.dir=/home/tomcat/apache-tomcat/logs/opensilex-ws ws.host=127.0.0.1 ws.port=8080 ws.target=phis2ws ws.baseUrl=rest ws.doc.host=127.0.0.1 ws.doc.port=8080 ws.doc.name=phis2ws ws.updir.host=127.0.0.1 ws.updir.user= ws.updir.password= ws.updir.doc=~/opensilex/documents/instance ws.images.dir=/var/www/html/images ws.images.url=http://127.0.0.1/images ws.layers.dir=/var/www/html/layers ws.layers.url=http://127.0.0.1/layers ``` -------------------------------- ### Enable and Start mongod Service Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Enable the mongod service to start automatically on boot and then start the service. ```bash sudo systemctl enable mongod sudo systemctl start mongod ``` -------------------------------- ### Install Git Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Installs Git package using apt-get. Git is necessary for cloning repositories. ```bash sudo apt-get install git ``` -------------------------------- ### Install PHP and Extensions Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Install PHP version 7.0 along with the mbstring and dom extensions required for OpenSILEX. ```bash sudo apt-get update sudo apt-get install php php-mbstring php-dom ``` -------------------------------- ### Create JDK Installation Directory Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Create a directory to store the Java Development Kit (JDK) installation files. ```bash mkdir ~/jdk ``` -------------------------------- ### Install Composer Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Installs Composer using the official installer script. Ensure Curl is installed beforehand. ```bash sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer ``` -------------------------------- ### Start Tomcat Service Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Start the Apache Tomcat service using the startup script. ```bash /home/tomcat/apache-tomcat/bin/startup.sh ``` -------------------------------- ### Install Apache2 and PHP Module Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Install the Apache2 web server and the PHP 7.0 module for Apache. ```bash sudo apt-get update sudo apt-get install apache2 libapache2-mod-php7.0 ``` -------------------------------- ### Create Tomcat Installation Directory Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Create a directory in the home folder to store the Apache Tomcat installation files. ```bash sudo mkdir /home/tomcat ``` -------------------------------- ### Start Servers and Check Ports Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Starts Apache2, PostgreSQL, and Tomcat services, then uses nmap to check if their default ports are open. ```bash sudo systemctl start apache2 sudo systemctl start postgresql /home/tomcat/apache-tomcat/bin/startup nmap 127.0.0.1 ``` -------------------------------- ### Install Git on Linux Source: https://opensilex.github.io/docs-community-dev/github.html Installs the Git version control system on a Linux distribution using apt-get. Super-user privileges may be required. ```bash apt-get install git ``` -------------------------------- ### Install PostgreSQL and PostGIS Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Install PostgreSQL and the PostGIS extension on your system using apt-get. These are essential for geospatial data handling in OpenSILEX PHIS. ```bash sudo apt-get update sudo apt-get install postgresql sudo apt-get install postgresql-9.5-postgis-2.2 ``` -------------------------------- ### Run Robo 3T Installation Program Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Execute the Robo 3T program. Replace `` with the specific version number. ```bash ./robo3t /bin/robo3t ``` -------------------------------- ### Install Missing PHP Package Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Installs a missing PHP package identified by Composer. ```bash sudo apt-get install php- ``` -------------------------------- ### Install Composer Asset Plugin Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Installs the Composer asset plugin globally, which is required for managing frontend assets with Composer. ```bash sudo composer global require "fxp/composer-asset-plugin:^1.2.0" ``` -------------------------------- ### MongoDB Connection Output Example Source: https://opensilex.github.io/docs-community-dev/MongoDBInstallv4 This is an example of the output you should see when successfully connecting to a MongoDB 4.0 instance using the mongo shell. It confirms the server version and connection details. ```text MongoDB shell version v4.0.4 connecting to: mongodb://127.0.0.1:27017 Implicit session: session { "id" : UUID("bca506e0-589d-482d-a8f2-6da60e56b80c") } MongoDB server version: 4.0.4 Server has startup warnings: 2018-12-10T12:28:02.828+0100 I STORAGE [initandlisten] 2018-12-10T12:28:02.828+0100 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 2018-12-10T12:28:02.828+0100 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem 2018-12-10T12:28:03.489+0100 I CONTROL [initandlisten] 2018-12-10T12:28:03.489+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2018-12-10T12:28:03.489+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2018-12-10T12:28:03.489+0100 I CONTROL [initandlisten] --- ``` -------------------------------- ### Run MongoDB Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Starts the MongoDB server using its configuration file. This is required for the database operations. ```bash sudo mongod --config /etc/mongod.conf ``` -------------------------------- ### Check Git Version and Help Source: https://opensilex.github.io/docs-community-dev/github.html Displays the installed Git version and opens the Git help documentation in the terminal. These commands are also usable on Windows via Git Bash. ```bash git --version ``` ```bash git --help ``` -------------------------------- ### Initialize Replica Set Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Initiate the replica set configuration from the MongoDB shell. This command starts the replica set process. ```javascript > rs.initiate() ``` -------------------------------- ### Function Documentation Source: https://opensilex.github.io/docs-community-dev/codingStyle Standard Javadoc format for function documentation, including purpose, error handling, examples, and parameters. Comments generally start with a verb in the third person. ```Java /** * Generates a new vector URI. A vector URI follows this pattern: * :/ * = 1 letter type + 2 numbers year + auto incremented number * with 3 digits (per year). * Functions comment generally starts with a verb in the third person. * @error the error message possible or what happends if an error occured. * @example http://www.phenome-fppn.fr/diaphen/2017/v1702 * @example * SELECT ?uri * WHERE { * ?uri rdf:type * } * @param year the insertion year of the vector. * @return the new vector URI. */ public String generateVectorUri(String year) { ... } ``` -------------------------------- ### Create PostgreSQL Database Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Creates a new PostgreSQL database, recommended to be named after the experimental installation. The 'opensilex' user is set as the owner. ```sql CREATE DATABASE OWNER opensilex; ``` -------------------------------- ### Update Apt and Install MongoDB 4.0 Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Update the package list to include the new repository and then install the MongoDB 4.0 package. ```bash sudo apt-get update sudo apt-get install mongodb-org ``` -------------------------------- ### Get Git Remote Help Source: https://opensilex.github.io/docs-community-dev/github.html Displays the help documentation for Git remote commands directly in the shell. ```bash git remote --help ``` -------------------------------- ### Check PHP Version Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Verify the installed PHP version from the terminal. ```bash php --version ``` -------------------------------- ### Run MongoDB Service Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Start the MongoDB service using its configuration file. This command ensures MongoDB is running with the specified settings. ```bash sudo mongod --config /etc/mongod.conf ``` -------------------------------- ### Locate PostgreSQL Client Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Find the path to the PostgreSQL client executable (`psql`). This is useful for verifying the installation and connecting to the database. ```bash which psql ``` -------------------------------- ### Start Tomcat Manager App Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Access the Tomcat Manager App to manage deployed applications. Ensure you have the correct Tomcat user credentials. ```bash sudo -i -u postgres ``` -------------------------------- ### Check Java Development Kit Version Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Verify if Java Development Kit (JDK) is installed and check its version from the terminal. ```bash java -version ``` -------------------------------- ### Extract JDK Archive Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Extract the downloaded JDK archive into the specified installation directory. ```bash tar -xvf ~/Downloads/jdk-X.X.X_linux-x64_bin.tar.gz ~/jdk/ ``` -------------------------------- ### Create PHIS Alias Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Creates a shell alias to easily start the OpenSILEX PHIS application and open it in the web browser. ```bash alias phis='apache-tomcat/bin/startup.sh;xdg-open http://localhost/phis-webapp/web' ``` -------------------------------- ### MongoDB Web Service Configuration Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Configuration properties for connecting to a MongoDB instance. Ensure the host, port, and database name match your MongoDB setup. ```properties mongo.host=localhost mongo.port=27017 mongo.db=opensilex ``` -------------------------------- ### Checkout and Pull Latest Changes Source: https://opensilex.github.io/docs-community-dev/github.html Before starting work, ensure your local repository is up-to-date by checking out the master branch and pulling the latest changes from the upstream repository. ```bash git checkout and git pull upstream master ``` -------------------------------- ### Extract Robo 3T Archive Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Unpack the downloaded Robo 3T archive. Replace `` with the specific version number and `` with your desired installation path. ```bash tar -xvf ~/Downloads/robo3t .tar.gz ``` -------------------------------- ### Extract Tomcat Archive Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Extract the downloaded Apache Tomcat archive into the specified installation directory. ```bash cd /home/tomcat/ tar --owner= -xvzf ~/Downloads/apache-tomcat.tar.gz ``` -------------------------------- ### Update Composer Dependencies Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Runs the Composer update command to install or update project dependencies, ignoring platform requirements. ```bash composer update --ignore-platform-reqs ``` -------------------------------- ### Java Bean Validation Example Source: https://opensilex.github.io/docs-community-dev/webService Demonstrates using JSR 380 annotations for input validation in a Java web service. Includes validation for query parameters and complex object lists. ```java public class ExampleResourceService { @GET public Response get( @QueryParam("url") @Required @URL String url ) { ... } @POST public Response post(ArrayList @Valid examples) { ... } } public class ExampleDTO { String url; SecondExample secondExample; @URL @Required public String getUrl() { return url; } @Valid public SecondExample getSecondExample() { return secondExample; } } ``` -------------------------------- ### Check MongoDB Version Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Use this command to verify your installed MongoDB version. This is crucial for ensuring compatibility with OpenSILEX PHIS v3.0, which requires at least MongoDB v4.0. ```bash mongod --version ``` -------------------------------- ### Create Project Directory Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Creates a directory named 'OpenSILEX' in the user's home directory to store project files. ```bash mkdir ~/OpenSILEX ``` -------------------------------- ### Register MongoDB 4.0 GPG Key Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Add the public GPG key for MongoDB 4.0 to your system's trusted keys. This is necessary for verifying the authenticity of the MongoDB packages during installation. ```bash sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 ``` -------------------------------- ### Acquisition Session Metadata JSON Structure Source: https://opensilex.github.io/docs-community-dev/4p This JSON structure represents the data retrieved from the `GET /acquisitionSessions/metadataFile` webservice. It includes pagination details, status, data files, and the actual metadata for acquisition sessions, with each object in the 'data' array corresponding to a row in an Excel sheet. ```json { "metadata": { "pagination": { "pageSize": 20, "currentPage": 0, "totalCount": 24, "totalPages": 2 }, "status": [], "datafiles": [] }, "result": { "data": [ { "Camera_type": null, "Camera_alias": null, "Camera_uri": null, "Vector_type": "http://www.phenome-fppn.fr/vocabulary/2017#UAV", "Vector_alias": "my-drone", "Vector_uri": "http://www.phenome-fppn.fr/my-installation/2018/v1802", "RadiometricTarget_uri": null, "RadiometricTarget_alias": null, "Installation": "http://www.phenome-fppn.fr/my-installation", "GroupPlot_type": "http://www.phenome-fppn.fr/vocabulary/2017#Experiment", "GroupPlot_alias": "EX_18", "GroupPlot_uri": "http://www.phenome-fppn.fr/my-installation/EXP2018-1", "GroupPlot_species": "maize, appletree", "Pilot": "uav.pilot@example.com" }, {"..."} ] } } ``` -------------------------------- ### Create PostgreSQL Database and Extension Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet SQL commands to create the OpenSILEX database and enable the PostGIS extension. Ensure you have the necessary privileges. ```sql CREATE DATABASE opensilex OWNER opensilex; CREATE EXTENSION postgis; select postgis_full_version(); \q ``` -------------------------------- ### Create Web Service Directories Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Creates necessary directories for OpenSILEX web service, including instance documents, images, and layers. It also sets ownership and permissions for these directories. ```bash mkdir -p ~/opensilex-ws/documents/instance sudo mkdir /var/www/html/images sudo mkdir /var/www/html/layers sudo chown -R : /var/www/html/images sudo chown -R : /var/www/html/layers sudo chown -R : ~/opensilex-ws/documents/ sudo chmod -R 775 /var/www/html/images sudo chmod -R 775 /var/www/html/layers sudo chmod -R 775 ~/opensilex-ws/documents/ ``` -------------------------------- ### Configure Application Name and Hostname Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Set the application name and hostname, which determine the URL at which the application is accessible. ```php # Application name, accessible at the URL http://$hostname/$appli $appli = 'opensilex'; $hostname = 'localhost'; ``` -------------------------------- ### Configure OpenSILEX Web Service Paths Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Define the base paths for OpenSILEX web services, including the REST API and documentation. ```php // http://{ws.host}:{ws.port}/{ws.target}/{ws.baseUrl}/ define('WS_PHIS_PATH', 'http://localhost:8080/opensilex/rest/'); // http://{ws.host}:{ws.port}/{ws.name} define('WS_PHIS_PATH_DOC', 'http://localhost:8080/opensilex'); ``` -------------------------------- ### Build with Maven Profile Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Command to build the project using a specific Maven profile (e.g., 'test'). ```bash mvn install -Ptest ``` -------------------------------- ### Enable PostGIS Extension Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Connects to the specified PostgreSQL database as the 'opensilex' user and enables the PostGIS extension, which provides geospatial capabilities. It also displays the PostGIS version. ```bash psql -U opensilex -h 127.0.0.1 -d ``` ```sql CREATE EXTENSION postgis; select postgis_full_version(); ``` -------------------------------- ### List Git Configuration Source: https://opensilex.github.io/docs-community-dev/github.html Displays the current Git configuration settings. This command helps verify that the user's email and name have been set correctly. ```bash git config --list ``` -------------------------------- ### Configure Web Services Path Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Sets the necessary paths for the web services in the configuration file. ```php define('WS_PHIS_PATH', 'http://localhost:8080/phis2ws/rest/'); define('WS_PHIS_PATH_DOC', 'http://localhost:8080/phis2ws'); ``` -------------------------------- ### Check MongoDB Access with User Credentials Source: https://opensilex.github.io/docs-community-dev/MongoDBInstallv4 Verify access to the 'mydatabase' by connecting using the 'opensilex' user and 'azerty' password, specifying the authentication database. ```shell mongo -u "opensilex" -p "azerty" --authenticationDatabase "mydatabase" "mydatabase" ``` -------------------------------- ### Set Platform Configuration Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Configure the platform identifier for the OpenSILEX application. ```php 'platform' => 'Demo' ``` -------------------------------- ### Navigate to Web Application Directory Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Changes the current directory to the web application's root folder. ```bash cd /var/www/html/phis-webapp ``` -------------------------------- ### OpenSILEX Web Service General Configurations Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet General configuration settings for the OpenSILEX web service, including logging directory, host, port, and file upload settings. ```properties # Logs repertory. You need to create this directory # (do not forget the access rights!) ws.log.dir=/home/training/opensilex/logs # The web service url access will be: # http://{ws.host}:{ws.port}/{ws.target}/{ws.baseUrl} ws.host=localhost ws.port=8080 # Name of the application - can be personalized in the pom.xml file ws.target=opensilex ws.baseUrl=rest ws.doc.host=localhost ws.doc.port=8080 ws.doc.name=opensilex ws.pageSize.max=2097152 ws.updir.host=opensilex ws.updir.user=username ws.updir.password=password # Files storage directory (do not forget the access rights) ws.updir.doc=/home/training/opensilex/documents/{rdf.infra} ``` -------------------------------- ### Download OpenSILEX Webapp Release Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Use this command to download a specific release of the OpenSILEX web application from GitHub. ```bash git clone --branch 3.2.4 https://github.com/OpenSILEX/phis-webapp.git ``` -------------------------------- ### Run Netbeans IDE Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Command to launch the Netbeans IDE from the terminal. ```bash ~/netbeans/bin/netbeans ``` -------------------------------- ### Set Web Application File Permissions Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Commands to set ownership and permissions for the OpenSILEX web application files. Ensure the user and group match your Apache configuration. ```bash sudo chown -R :www-data /var/html/phis-webapp sudo chmod -R 775 /var/html/phis-webapp ``` -------------------------------- ### Remove Older MongoDB Version and Data Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Purge existing MongoDB packages and remove the old data directory. This ensures a clean slate for the new installation. The data directory is then recreated and ownership is set. ```bash sudo apt-get purge mongodb-org* sudo rm -rf /var/lib/mongodb sudo mkdir /var/lib/mongodb/ sudo chown -R mongodb:mongodb /var/lib/mongodb/ ``` -------------------------------- ### Clone Repository using HTTPS Source: https://opensilex.github.io/docs-community-dev/github.html Use this command to create a local copy of your GitHub repository using the HTTPS protocol. This is an alternative to SSH but may require repeated authentication. ```bash git clone ``` -------------------------------- ### Create PostgreSQL User Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Creates a new PostgreSQL user named 'opensilex' with elevated privileges, including the ability to create databases and superuser status. Sets an encrypted password for the user. ```bash psql ``` ```sql CREATE USER opensilex; ALTER ROLE opensilex WITH CREATEDB; ALTER ROLE opensilex WITH SUPERUSER; ALTER USER opensilex WITH ENCRYPTED PASSWORD 'azerty'; ``` -------------------------------- ### Create Admin User for OpenSILEX Database Source: https://opensilex.github.io/docs-community-dev/MongoDBInstallv4 Create a new user with 'readWrite' role for the 'opensilex' database. This allows the user to manage collections and data within that specific database. ```javascript db.createUser( { user: "opensilex", pwd: "azerty", roles: [ { role: "readWrite", db: "opensilex" } ] } ) ``` -------------------------------- ### Run Robo 3T Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Launches the Robo 3T GUI client for MongoDB. This tool is used to manage MongoDB connections and databases. ```bash ~/robo3t/bin/robo3t ``` -------------------------------- ### Create and Checkout a New Branch Source: https://opensilex.github.io/docs-community-dev/github.html Creates a new branch and immediately switches to it, preparing it for development. The command `git branch ` is preferred for just creating a branch. ```bash git checkout -b ``` -------------------------------- ### Clone Ontology Vocabularies Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Clones the ontology-vocabularies repository from GitHub into the ~/OpenSILEX directory. Consider cloning a specific release tag for stability. ```bash cd ~/OpenSILEX git clone https://github.com/OpenSILEX/ontology-vocabularies.git ``` -------------------------------- ### Interface and Class Structure with Blank Lines Source: https://opensilex.github.io/docs-community-dev/codingStyle Demonstrates the correct usage of blank lines between interface and class definitions, and within class members. Two blank lines separate sections, one blank line separates methods and local variables. ```Java /** * Comment. */ public interface MyInterface { Boolean isEmptyMethod(); } /** * Comment. */ class Sample extends Object { int ivar1; int ivar2; Sample(int i, int j) { int k; i = k; /* Comment. */ ivar1 = i; ivar2 = j; } int emptyMethod() {} Boolean isEmptyMethod() {} ... } ``` -------------------------------- ### Connect to MongoDB Shell Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Attempt to connect to the MongoDB instance using the mongo shell to verify the upgrade and service status. The output shows the shell version, server version, and startup warnings. ```bash mongo ``` -------------------------------- ### Clone Repository using SSH Source: https://opensilex.github.io/docs-community-dev/github.html Use this command to create a local copy of your GitHub repository using the SSH protocol. Ensure your SSH connection is configured. ```bash git clone ``` -------------------------------- ### PostgreSQL Web Service Configuration Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Configuration properties for connecting to a PostgreSQL database. Update the host, port, database name, username, and password as needed. ```properties pg.host=localhost pg.port=5432 pg.db=opensilex pg.user=username pg.password=password ``` -------------------------------- ### Configure Replica Set Name Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Add this configuration to your mongod.conf file to specify the replica set name. Replace 'opensilex' with your desired name. ```yaml replication: replSetName: "opensilex" ``` -------------------------------- ### Configure Git User Email and Name Source: https://opensilex.github.io/docs-community-dev/github.html Sets the global Git configuration for the user's email and name, which will appear in the Git log. This configuration is done once per system. ```bash git config --global user.email "" git config --global user.name "" ``` -------------------------------- ### OpenSILEX Web Service Configuration Properties Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Configuration properties for the OpenSILEX web service, including logging, host, port, and file server settings. Ensure these paths and ports are correctly set for your environment. ```properties [...] logDirectory=/home/tomcat/phis2ws/logs [...] host=127.0.0.1:8080 basePath=/phisws/rest [...] webAppHost=127.0.0.1 webAppPort=8080 [...] webAppApiDocsName=phis2ws [...] webAppApiBasePath=/phis2ws/resources [...] uploadFileServerPort=22 # Adresse de sauvegarde des donn uploadFileServerIP=127.0.0.1 uploadFileServerUsername= uploadFileServerPassword= uploadFileServerDirectory=/home//phis-ws/documents/instance uploadImageServerDirectory=/var/www/html/images layerFileServerDirectory=/var/www/html/layers layerFileServerAddress=http://127.0.0.1/layers [...] ``` -------------------------------- ### Import PostgreSQL Dump Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Command to import a SQL dump file into the PostgreSQL database. Replace the path with the actual location of your dump file. ```bash psql -U opensilex opensilex < Documents/opensilex_st_dump.sql ``` -------------------------------- ### Configure PostgreSQL Listen Addresses Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Edits the postgresql.conf file to allow connections from any IP address. ```ini listen_addresses: '*' ``` -------------------------------- ### Experiment Form Styling Source: https://opensilex.github.io/docs-community-dev/webapp Specifies the Bootstrap class .well for styling new forms, as shown in the experiment form. ```php
``` -------------------------------- ### Dump MongoDB Database Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Use this command to create a backup of your MongoDB database before performing an upgrade. It saves all data into a dump folder in the current directory. ```bash mongodump --host localhost ``` -------------------------------- ### Commit Changes with a Message Source: https://opensilex.github.io/docs-community-dev/github.html Use this command to record staged changes to the local repository with a descriptive message. The message should concisely explain the nature of the changes. ```bash git commit -m ``` -------------------------------- ### Clone OpenSILEX PHIS Web Service Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Clones the phis-ws repository from GitHub into the ~/OpenSILEX directory. Consider cloning a specific release tag for stability. ```bash cd ~/OpenSILEX git clone https://github.com/OpenSILEX/phis-ws.git ``` -------------------------------- ### Clone OpenSILEX Web Service Repository Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Download the latest release of the OpenSILEX web service (phis-ws) using Git. This command clones the specific branch for version 3.2.4. ```bash git clone --branch 3.2.4 https://github.com/OpenSILEX/phis-ws.git ``` -------------------------------- ### Class Documentation Source: https://opensilex.github.io/docs-community-dev/codingStyle Standard Javadoc format for class documentation, including purpose, author, update history, and parameter types. Comments begin with a capital letter and end with a dot. ```Java /** * DAO mother class. * Provides generic functions to query the storage. * Comments begins with a capital letter and ends with a dot. * The @author tag designates the main contributors of the class. A contributor that * updates the class won't be considered as an @author. The case of a reworked class will be discussed. * @update [Arnaud Charleroy] 4 Sept. 2018: explanation. * @update [Morgane Vidal, Andréas Garcia] 18 Sept. 2018: explanation. * @see optional link to class or website that helps the comprehension of the class. * @param the type of object handled. * @author Morgane Vidal , Arnaud Charleroy */ public class UriGenerator { /** * Comment which explains the complexeAttribute purpose. * @example possible value for this attribute without parenthesis. */ private String complexeAttribute; // Comment which explains the simpleAttribute purpose with an example if needed. private String simpleAttribute; } ``` -------------------------------- ### Navigate to Robo 3T Directory Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Change the current directory to the location where Robo 3T was extracted. This is necessary before running the executable. ```bash cd ``` -------------------------------- ### Copy WAR Archive to Tomcat Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Command to copy the generated WAR file to the Tomcat webapps directory. ```bash cp /target/phis2ws.war /home/tomcat/apache-tomcat/webapps/phis2ws.war ``` -------------------------------- ### Check Netbeans Folder Permissions Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Lists the permissions of files and folders within the Netbeans configuration directory. ```bash ls -l ~/.netbeans/8.2 ``` -------------------------------- ### Copy Web Application to Apache Root Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Copies the phis-webapp folder to the Apache web server's root directory. ```bash sudo cp -r /phis-webapp /var/www/html ``` -------------------------------- ### Register New BrAPI Service Source: https://opensilex.github.io/docs-community-dev/brapiImplementation Register your new BrAPI service implementation within the application's configuration by binding it to the `BrapiCall.class`. This ensures that your service is recognized and can be injected where needed. ```java register(new AbstractBinder() { @Override protected void configure() { // create the session from the last sessionId received bindFactory(SessionFactory.class).to(Session.class); // Session injection thanks to the type defined in SessionInjectResolver bind(SessionInjectResolver.class) .to(new TypeLiteral>() { }) .in(Singleton.class); //Brapi services injection bind(CallsResourceService.class).to(BrapiCall.class); bind(NewBrapiResourceService.class).to(BrapiCall.class); } }); ``` -------------------------------- ### List and Manage Git Branches Source: https://opensilex.github.io/docs-community-dev/github.html Commands for listing existing branches, creating new ones, switching between them, and deleting them. Deleting a branch requires pushing the deletion to the remote. ```bash git branch ``` ```bash git branch ``` ```bash git checkout ``` ```bash git branch -d ``` ```bash git push origin : ``` -------------------------------- ### Clone OpenSILEX PHIS Web Application Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Clones the phis-webapp repository from GitHub into the ~/OpenSILEX directory. Consider cloning a specific release tag for stability. ```bash cd ~/OpenSILEX git clone https://github.com/OpenSILEX/phis-webapp.git ``` -------------------------------- ### Add Upstream Remote Repository Source: https://opensilex.github.io/docs-community-dev/github.html Use this command to add the main OpenSILEX repository as an 'upstream' remote. This is recommended for tracking changes from the original project. ```bash git remote add upstream https://github.com/OpenSILEX/docs-community-dev.git ``` -------------------------------- ### Extract RDF4J Archive Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Extract the downloaded RDF4J SDK archive to the home directory. ```bash unzip ~/Downloads/eclipse-rdf4j--sdk.zip -d ~/ ``` -------------------------------- ### Configure MongoDB Storage Path Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Modify the MongoDB configuration file to specify the database storage path. Ensure the MongoDB user has ownership of this directory. ```bash sudo chown -R mongodb:mongodb ``` -------------------------------- ### Implement BrAPI Call Information Source: https://opensilex.github.io/docs-community-dev/brapiImplementation Implement the `BrapiCall` interface to override the `callInfo()` method. This method provides essential details about your new BrAPI call, including its name, supported data types, HTTP methods, and versions. ```java public class CallsResourceService implements BrapiCall { final static Logger LOGGER = LoggerFactory.getLogger(CallsResourceService.class); /** * Overriding BrapiCall method * @date 27 Aug 2018 * @return Calls call information */ @Override public Call callInfo() { ArrayList calldatatypes = new ArrayList<>(); calldatatypes.add("json"); ArrayList callMethods = new ArrayList<>(); callMethods.add("GET"); ArrayList callVersions = new ArrayList<>(); callVersions.add("1.1"); callVersions.add("1.2"); Call callscall = new Call("calls", calldatatypes, callMethods, callVersions); return callscall; } } ``` -------------------------------- ### RDF4J Web Service Configuration Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Configuration settings for the RDF4J triple store. This includes base URI, host, port, repository ID, and vocabulary context. ```properties # Base of the generated URIs - can be personalized: rdf.base.uri=http://www.opensilex.org/ # RDF4J localisation and repository ID: rdf.host=localhost rdf.port=8080 rdf.path=rdf4j-server rdf.repo=opensilex # Managed infrastructure - can be personalized:rdf.infra=opensilex # 3 letters code for the infrastructure: rdf.infra.code=OSX # Context of the vocabulary. Oeso by default: rdf.vocabulary.context=http://www.opensilex.org/vocabulary/oeso ``` -------------------------------- ### Copy RDF4J WAR files to Tomcat Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Copy the RDF4J web application archive (.war) files to the Tomcat webapps directory. ```bash cp ~/eclipse-rdf4j-/war/* /home/tomcat/apache-tomcat/webapps/ ``` -------------------------------- ### Set Folder Permissions for Web Application Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Changes ownership and permissions for the phis-webapp directory to ensure proper access for the web server and user. ```bash sudo chown -R :www-data /var/www/html/phis-webapp sudo chmod 775 -R /var/www/html/phis-webapp ``` -------------------------------- ### Test SSH Connection to GitHub Source: https://opensilex.github.io/docs-community-dev/github.html Tests the SSH connection to GitHub to ensure successful authentication. A success message indicates that the SSH key is correctly configured. ```bash ssh -T git@github.com ``` -------------------------------- ### Configure MongoDB for Remote Connections Source: https://opensilex.github.io/docs-community-dev/MongoDBInstallv4 Comment out network interface configuration lines in `/etc/mongod.conf` to allow remote connections. This includes disabling the default `bindIp` setting. ```properties # network interfaces net: port: 27017 bindIp: 127.0.0.1 ``` -------------------------------- ### Restore MongoDB Database Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Use this command to restore your MongoDB database from the dump created earlier. Run this in the same directory where the `mongodump` command was executed. ```bash mongorestore --host localhost ``` -------------------------------- ### Keyword Spacing with Parentheses Source: https://opensilex.github.io/docs-community-dev/codingStyle Illustrates correct spacing around keywords followed by parentheses. A space is required between the keyword and the opening parenthesis, with no space after the closing parenthesis and before the opening curly brace. ```Java if (expression) { } for (expression) { } while (expression) { } ``` -------------------------------- ### Add and Commit Local Modifications Source: https://opensilex.github.io/docs-community-dev/github.html Stages all changes in the current directory for commit using 'git add' and then commits them to the master branch with a descriptive message using 'git commit'. ```bash git add . git commit -m "Your commit message" ``` -------------------------------- ### Restart PostgreSQL Service Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Apply changes made to the PostgreSQL configuration by restarting the service. This ensures the new port or settings are active. ```bash sudo systemctl restart postgresql ``` -------------------------------- ### Configure Apache2 Port Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Edit the ports.conf file to change the listening port for Apache2 to 80. ```bash sudo nano /etc/apache2/ports.conf ``` -------------------------------- ### Boolean Function Return Documentation Source: https://opensilex.github.io/docs-community-dev/codingStyle Specific Javadoc format for documenting boolean return values, explaining both true and false conditions. Used when a function returns a boolean. ```Java /** * @return true explanation * false explanation */ ``` -------------------------------- ### Set Webapp Files Group for Apache Access Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Change the group ownership of the webapp files to allow the Apache web server to read them. ```bash chown -R training:www-data /home/training/opensilex/phis-webapp ``` -------------------------------- ### Restart Apache2 Service Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Restart the Apache2 service to apply the configuration changes. ```bash sudo systemctl restart apache2 ``` -------------------------------- ### SILEX To-Do Tag Source: https://opensilex.github.io/docs-community-dev/codingStyle Indicates code that needs to be written, explained in simple terms. ```plaintext //SILEX:todo Code to write, explained in simple words. //\SILEX:todo ``` -------------------------------- ### Configure PostgreSQL Peer Authentication Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Modifies the pg_hba.conf file to change authentication from peer to md5 for local connections. ```sql local all all peer ``` ```sql local all all md5 ``` -------------------------------- ### Configure PostgreSQL Host Authentication Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Modifies the pg_hba.conf file to allow connections from a specific IP address using MD5 authentication. ```sql hosts all all md5 ``` -------------------------------- ### Edit MongoDB Configuration File Source: https://opensilex.github.io/docs-community-dev/MongoDBInstallv4 Opens the MongoDB configuration file using 'gedit' with super-user privileges. This command allows modification of settings like the replica set name. ```bash sudo gedit /etc/mongod.conf ``` -------------------------------- ### Test MongoDB Authentication Source: https://opensilex.github.io/docs-community-dev/MongoDBInstallv4 Use this command to test authentication by connecting to the 'admin' database and authenticating with provided credentials. ```javascript use admin db.auth("superadmin", "mydatabase") ``` -------------------------------- ### Configure PostgreSQL Port Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Edit the `postgresql.conf` file to change the default port for the PostgreSQL service. Ensure the new port is not in use. ```bash nano /etc/postgresql/9.5/main/postgresql.conf ``` -------------------------------- ### Enable MongoDB Fork Mode Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Add `fork: true` to the MongoDB configuration file to ensure it runs as a daemon. This is recommended for stable operation. ```ini # how the process runs processManagement:* fork: true ``` -------------------------------- ### Restart PostgreSQL Service Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Command to restart the PostgreSQL database service. Use this if you suspect database connectivity issues. ```bash sudo systemctl restart postgresql ``` -------------------------------- ### Grant Read/Write Permissions for Netbeans Folder Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Grants read and write permissions to the owner and group for Netbeans configuration files and folders. ```bash sudo chmod -R ug+rw ~/.netbeans ``` -------------------------------- ### Generate PostgreSQL Dump Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Generates a PostgreSQL database dump file. Options include excluding owner information (-O) and dumping only the schema (-s). Specify the host and user for the connection. ```bash # from postres server pg_dump -O -U opensilex > opensilex_st_dump.sql # -O : --no-owner # -s : only schema # -h : postgres host # -U : user ``` -------------------------------- ### Method Call Spacing Source: https://opensilex.github.io/docs-community-dev/codingStyle Shows the correct spacing for method calls, emphasizing no space between the method name and its opening parenthesis. This distinguishes method calls from keywords. ```Java callMethod(); this.myMethod(); ``` -------------------------------- ### Add MongoDB 4.0 Repository Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Configure your system's package manager to include the MongoDB 4.0 repository. This command is specific to Debian 9 (Stretch). Refer to MongoDB documentation for other distributions. ```bash echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list ``` -------------------------------- ### Activate Animated Multiple Background Images Source: https://opensilex.github.io/docs-community-dev/webapp Activates the animated multiple background images feature by adding the FullScreenImageSliderWidget to the site index view. Image links are relative to the web/images directory. ```php use app\components\widgets\FullScreenImageSliderWidget; [ // local image links "background/wallpaper_grapes_vine.jpg", "background/wallpaper_leaf.jpg", "background/wallpaper_tomato.jpg", "background/wallpaper_vine.jpg" ], // FullScreenImageSliderWidget::DURATION_PER_IMAGE => 10 // time in seconds between two images ]); ?> ``` -------------------------------- ### Binary Operator Spacing Source: https://opensilex.github.io/docs-community-dev/codingStyle Illustrates correct spacing for binary operators. Spaces are required between the operator and its operands, except for the dot operator. Unary operators should not be separated from their operands. ```Java a += c + d; a = (a + b) / (c * d); ``` -------------------------------- ### Variable Assignment Spacing Source: https://opensilex.github.io/docs-community-dev/codingStyle Demonstrates the required spacing around the assignment operator (=) for variable assignments. A space is required on both sides of the equals sign. ```Java myVariable = 33; ``` -------------------------------- ### Edit Tomcat Server XML Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Edit the server.xml file to configure the HTTP port for Tomcat. ```bash nano /home/tomcat/apache-tomcat/conf/server.xml ``` -------------------------------- ### Generate MD5 Password Source: https://opensilex.github.io/docs-community-dev/localInstallation.html Generates an MD5 hash for a given password string, useful for password management in certain systems. ```bash echo -n bonjour | md5sum ``` -------------------------------- ### Restart MongoDB Service Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Restart the MongoDB service after updating the configuration file to apply the changes. ```bash sudo systemctl restart mongod ``` -------------------------------- ### Check Replica Set Status Source: https://opensilex.github.io/docs-community-dev/MongoDBUpgradeTov4 Check the status of the replica set to ensure it has been initialized correctly. ```javascript > rs.status() ``` -------------------------------- ### Create Superadmin User Source: https://opensilex.github.io/docs-community-dev/MongoDBInstallv4 Creates a new administrative user with privileges to manage users across all databases. This is a fundamental step for enabling authentication and securing your MongoDB instance. ```javascript use admin db.createUser( { user: "useradmin", pwd: "pwd", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] } ) ``` -------------------------------- ### SILEX Login Tag Source: https://opensilex.github.io/docs-community-dev/codingStyle Highlights temporary login code blocks used in the PHIS main client. ```plaintext //SILEX:login Used in the PHIS main client, to highlight the temporary login blocks of code. //\SILEX:login ``` -------------------------------- ### File Header Comment Source: https://opensilex.github.io/docs-community-dev/codingStyle Standard file header comment format including copyright, creation date, and contact information. Used for Java and PHP files. ```Java //****************************************************************************** // ${nameAndExt} // SILEX-PHIS // Copyright © INRA ${date?date?string("yyyy")} // Creation date: ${date} // Contact: ${userEmail}, anne.tireau@inra.fr, pascal.neveu@inra.fr //****************************************************************************** ``` -------------------------------- ### Set Meta Refresh for Web App Redirect Source: https://opensilex.github.io/docs-community-dev/install-cheatsheet Configure an automatic redirect to the web application's main interface using a meta refresh tag. ```html ```