Collection<CvTopic> cvTopics = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvTopic.class).getAll();
Collection<CvTopic> cvTopics = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvTopic.class).getAll();
Collection<CvTopic> cvTopics = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvTopic.class).getAll();
Collection<CvTopic> cvTopics = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvTopic.class).getAll();
/** * Determines the root node of that class and inserts the whole DAG as a tree into the database. Takes a class which * should inherit from the CvDagObject. * * @param cvClass Cv class to be inserted into the database. * * @throws IntactException if an error occur. */ public void insertCVs( Class<? extends CvObject> cvClass ) throws IntactException { if ( !CvDagObject.class.isAssignableFrom( cvClass ) ) { throw new IntactException( "invalid class!" ); } Collection cvDagObjects = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao( cvClass ).getAll(); // take any object out of the list to get the root CvDagObject aDagObject = ( CvDagObject ) cvDagObjects.iterator().next(); // get the root of the specified class CvDagObject root = aDagObject.getRoot(); // build the bounds of the root and all its children and insert them into the database this.buildBounds( root, 1 ); }
/** * Loads all CvTopics that should not be shown on the public interface. */ private AnnotationFilter() { logger.debug( "Initializing which CvTopic should be filtered out." ); // search for the CvTopic no-export CvTopic noExport = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotatedObjectDao( CvTopic.class ).getByShortLabel( CvTopic.NO_EXPORT ); if ( noExport != null ) { // load all CvTopics Collection<CvTopic> cvTopics = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao( CvTopic.class ).getAll(); // select those that have an Annotation( no-export ) for ( CvTopic cvTopic : cvTopics ) { for ( Annotation annotation : cvTopic.getAnnotations() ) { if ( noExport.equals( annotation.getCvTopic() ) ) { if ( filteredTopics == null ) { filteredTopics = new HashSet<CvTopic>( 8 ); } logger.debug( "CvTopic( " + cvTopic.getShortLabel() + " )" ); filteredTopics.add( cvTopic ); } } } } if ( filteredTopics == null ) { filteredTopics = Collections.EMPTY_SET; } logger.debug( filteredTopics.size() + " CvTopic" + ( filteredTopics.size() > 1 ? "s" : "" ) + " filtered." ); }