package be.cytomine.client;

/*
 * Copyright (c) 2009-2018. Authors: see NOTICE file.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import be.cytomine.client.models.Description;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class Execute {

    private static final Logger log = Logger.getLogger(Execute.class);

    public static void main(String[] args) throws Exception {
        BasicConfigurator.configure();
        PropertyConfigurator.configure("log4j.properties");
        log.info("Connection to cytomine...");

        Cytomine.connection(args[0], args[1], args[2]);

        ping();
    }

    public static void ping() throws CytomineException {
        log.info("Hello " + Cytomine.getInstance().getCurrentUser().get("username"));
    }
    public static void ping(Cytomine cytomine) throws CytomineException {
        log.info("Hello " + cytomine.getCurrentUser().get("username"));
    }
}

@@ -673,26 +673,193 @@
 ent.
-models.Description
+collections.AnnotationCollection;%0Aimport be.cytomine.client.collections.ImageInstanceCollection;%0Aimport be.cytomine.client.collections.TermCollection;%0Aimport be.cytomine.client.models.*
 ;%0Aim
@@ -978,16 +978,88 @@
 rator;%0A%0A
+import java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A
 public c
@@ -1243,24 +1243,26 @@
 onfigure();%0A
+//
         Prop
@@ -1309,16 +1309,16 @@
 ties%22);%0A
-
         
@@ -1410,24 +1410,1658 @@
  args%5B2%5D);%0A%0A
+%0A        Project project = new Project().fetch(526102245L);%0A        Ontology ontology = new Ontology().fetch(project.getLong(%22ontology%22));%0A        TermCollection terms = TermCollection.fetchByOntology(ontology);%0A%0A        Map%3CString, Object%3E parameters = new HashMap%3C%3E();%0A        parameters.put(%22project%22, 526102245L);%0A        parameters.put(%22showMeta%22, true);%0A        parameters.put(%22showTerm%22, true);%0A        parameters.put(%22showWKT%22, true);%0A        AnnotationCollection ac = AnnotationCollection.fetchWithParameters(parameters);%0A        for (int i = 0; i %3C ac.size(); i++) %7B%0A            Annotation annot = ac.get(i);%0A            System.out.println(%22Annnotation id %22 + annot.getStr(%22id%22) + %22 has terms: %22);%0A            List annotTermsIds = annot.getList(%22term%22);%0A            for (int j = 0; j %3C annotTermsIds.size(); j++) %7B%0A                for (int k = 0; k %3C terms.size(); k++) %7B%0A                    Term currentTerm = terms.get(k);%0A                    if (currentTerm.getId().equals((Long) annotTermsIds.get(j))) %7B%0A                        System.out.println(currentTerm.getStr(%22name%22));%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A%0A%0A//        ImageInstance img = new ImageInstance().fetch(526163790L);%0A//        AnnotationCollection ac = AnnotationCollection.fetchByImageInstance(img);%0A////        AnnotationCollection ac = AnnotationCollection.fetchWithParameters(parameters, 0, 1);%0A//        System.out.println(ac.size());%0A////        Project p = new Project().fetch(39738769L);%0A////        ImageInstanceCollection ic = ImageInstanceCollection.fetchByProject(p);%0A////        System.out.println(ic.get(0));%0A%0A//
         ping

Update header license year (to ease sync with Cytomine CE)