Changeset 3221


Ignore:
Timestamp:
08/02/13 13:29:30 (11 years ago)
Author:
olhsha
Message:

adding Version and CachedRepresentation? DAO's and mockeries. Only getExternalID methods are implemented. not tested

Location:
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend
Files:
10 added
5 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/nb-configuration.xml

    r3220 r3221  
    2020        <config-files>
    2121            <config-file>src/main/resources/spring-config/sourceDao.xml</config-file>
    22             <config-file>src/test/resources/spring-test-config/mockSourceDao.xml.xml</config-file>
     22            <config-file>src/main/resources/spring-config/VersionDao.xml</config-file>
     23            <config-file>src/main/resources/spring-config/CachedRepresentationDao.xml</config-file>
     24            <config-file>src/test/resources/spring-test-config/mockVersionDao.xml</config-file>
     25            <config-file>src/test/resources/spring-test-config/mockCachedRepresenationDao.xml</config-file>
    2326        </config-files>
    2427        <config-file-groups/>
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/BackendConstants.java

    r3220 r3221  
    3131    public static final int USER_HASH_PARAM_1 =  5;
    3232    public static final int USER_HASH_PARAM_2 =  19;
     33   
     34    // peter, is it okay?
    3335    public static final int SOURCE_HASH_PARAM_1 =  7;
    3436    public static final int SOURCE_HASH_PARAM_2 =  23;
     37    public static final int CACHED_REPRESENTATION_HASH_PARAM_1 =  7;
     38    public static final int CACHED_REPRESENTATION_HASH_PARAM_2 =  19;
     39    public static final int VERSION_HASH_PARAM_1 =  5;
     40    public static final int VERSION_HASH_PARAM_2 =  29;
     41   
    3542    public static final String regExpIdentifier = "[a-zA-Z0-9_-]*";
    3643}
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcAnnotationDao.java

    r3220 r3221  
    171171           result.setOwner(ownerREF);
    172172           
    173            //////////////////////////
    174173           List<SourceInfo> sourceInfoList = jdbcSourceDao.getSourceInfos(rs.getInt(annotation_id));
    175174           NewOrExistingSourceInfos noeSourceInfos = jdbcSourceDao.contructNewOrExistingSourceInfo(sourceInfoList);
    176 //           List<NewOrExistingSourceInfo> noeSourceInfoList = new ArrayList<NewOrExistingSourceInfo>();
    177 //           for (SourceInfo sourceInfo: sourceInfoList) {
    178 //                NewOrExistingSourceInfo noeSourceInfo = new NewOrExistingSourceInfo();
    179 //                noeSourceInfo.setSource(sourceInfo);
    180 //                noeSourceInfoList.add(noeSourceInfo);
    181 //           }       
    182 //           
    183 //           
    184 //           NewOrExistingSourceInfos noeSourceInfos = new  NewOrExistingSourceInfos();
    185 //           noeSourceInfos.getTarget().addAll(noeSourceInfoList);
    186175           result.setTargetSources(noeSourceInfos);
    187            ////////////////////////////////
    188176           
    189177           result.setBody(convertToAnnotationBody(rs.getString(body_xml)));
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcResourceDao.java

    r3220 r3221  
    3232public class JdbcResourceDao extends SimpleJdbcDaoSupport implements ResourceDao{
    3333   
    34     // base string constants: table Names
     34    // base string constants: resource table Names
    3535    final static protected String notebookTableName = "notebook";
    3636    final static protected String annotationTableName = "annotation";
    37     final static protected String sourceTableName = "source";     
    38     final static protected String principalTableName = "principal";   
     37    final static protected String sourceTableName = "source";   
     38    final static protected String sourcesTableName = "target_source";
     39    final static protected String cachedRepresentationTableName = "cached_representation_info";
     40    final static protected String versionTableName = "version";
     41    final static protected String principalTableName = "principal";
     42    // joint tablenames
     43   
    3944    final static protected String notebooksAnnotationsTableName = "notebooks_annotations";
    4045    final static protected String permissionsTableName = "annotations_principals_permissions";
    41     final static protected String sourcesTableName = "target_source";
    4246    final static protected String annotationsSourcesTableName = "annotations_target_sources";
     47    final static protected String versionsCachedRepresentationsTableName = "versions+cached_representations";
     48   
    4349   
    4450    // base string constants: field Names
     
    5763    final static protected String link = "link";
    5864    final static protected String version = "version";
     65    final static protected String cached_representation_id = "cached_representation_id";
     66    final static protected String version_id = "version_id";
     67    final static protected String mime_type = "mime_type";
     68    final static protected String tool = "tool";
     69    final static protected String type_ = "type_";
     70    final static protected String where_is_the_file = "where_is_the_file";
    5971   
    6072    // derived string constants: table+field names
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/MockObjectsFactory.java

    r3220 r3221  
    1919
    2020import eu.dasish.annotation.backend.dao.AnnotationDao;
     21import eu.dasish.annotation.backend.dao.CachedRepresentationDao;
    2122import eu.dasish.annotation.backend.dao.NotebookDao;
    2223import eu.dasish.annotation.backend.dao.PermissionsDao;
    2324import eu.dasish.annotation.backend.dao.SourceDao;
    2425import eu.dasish.annotation.backend.dao.UserDao;
     26import eu.dasish.annotation.backend.dao.VersionDao;
    2527import org.jmock.Mockery;
    2628
     
    5759        return context.mock(SourceDao.class);
    5860    }
     61   
     62    public CachedRepresentationDao newCachedRepresentationDao() {
     63        return context.mock(CachedRepresentationDao.class);
     64    }
     65   
     66    public VersionDao newVersionDao() {
     67        return context.mock(VersionDao.class);
     68    }
    5969}
Note: See TracChangeset for help on using the changeset viewer.