MICO Platform
 All Classes Namespaces Functions Variables Friends
ItemAnno4cpp.hpp
1 #ifndef ITEMANNO4CPP_HPP
2 #define ITEMANNO4CPP_HPP 1
3 
4 #include "rdf_model.hpp"
5 #include "Item.hpp"
6 #include "PartAnno4cpp.hpp"
7 #include "ResourceAnno4cpp.hpp"
8 #include "anno4cpp.h"
9 
10 namespace mico {
11  namespace persistence {
12  namespace model {
13  class ItemAnno4cpp: public Item, public ResourceAnno4cpp
14  {
15  protected:
16  //PersistenceService& m_persistenceService;
17 
18  //the item hold the Global JNI reference to the ItemMMM object
19  jnipp::GlobalRef<jnipp::eu::mico::platform::anno4j::model::ItemMMM> m_itemMMM;
20 
21  public:
22  ItemAnno4cpp(jnipp::Ref<jnipp::eu::mico::platform::anno4j::model::ItemMMM> itemMMM, PersistenceService& persistenceService)
23  : ResourceAnno4cpp(itemMMM, persistenceService),
24  //m_persistenceService(persistenceService),
25  m_itemMMM(itemMMM)
26 
27  {
28  }
29 
30  std::shared_ptr<Part> createPart(const mico::persistence::model::URI& extractorID);
31 
32  std::shared_ptr<Part> getPart(const mico::persistence::model::URI& uri);
33 
34  std::list< std::shared_ptr<Part> > getParts();
35 
36  std::string getSerializedAt() {
37  jnipp::Env::Scope scope(PersistenceService::m_sJvm);
38  std::string timestamp = m_itemMMM->getSerializedAt()->std_str();
39  m_persistenceService.checkJavaExceptionNoThrow(m_jnippErrorMessage);
40  return timestamp;
41  }
42 
46  jnipp::Ref<jnipp::java::lang::Object>& createObject(const jnipp::Ref<jnipp::Class>& clazz);
47 
54  jnipp::Ref<jnipp::java::lang::Object>& createObjectNoCommit(
55  jnipp::Ref<jnipp::org::openrdf::repository::object::ObjectConnection> con,
56  const jnipp::Ref<jnipp::Class>& clazz);
57 
61  jnipp::Ref<jnipp::java::lang::Object>& findObject(const mico::persistence::model::URI& uri,
62  const jnipp::Ref<jnipp::Class>& clazz);
63 
64 
65 
66 
67  };
68  }
69  }
70 }
71 #endif
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in c...
Definition: http_client.cpp:23
std::shared_ptr< Part > getPart(const mico::persistence::model::URI &uri)
Return a handle to the ContentPart with the given URI, or null in case the content item does not have...
Definition: ItemAnno4cpp.cpp:88
jnipp::Ref< jnipp::java::lang::Object > & createObjectNoCommit(jnipp::Ref< jnipp::org::openrdf::repository::object::ObjectConnection > con, const jnipp::Ref< jnipp::Class > &clazz)
Create a new jnipp Object of the desired class using the connection.
Definition: ItemAnno4cpp.cpp:171
jnipp::Ref< jnipp::java::lang::Object > & createObject(const jnipp::Ref< jnipp::Class > &clazz)
Create a new jnipp Object of the desired class.
Definition: ItemAnno4cpp.cpp:140
Main service for accessing the MICO persistence API.
Definition: PersistenceService.hpp:51
std::list< std::shared_ptr< Part > > getParts()
Return a list over all content parts contained in this item.
Definition: ItemAnno4cpp.cpp:114
Definition: ResourceAnno4cpp.hpp:15
jnipp::Ref< jnipp::java::lang::Object > & findObject(const mico::persistence::model::URI &uri, const jnipp::Ref< jnipp::Class > &clazz)
Retrieve an existing jnipp Object of the desired class.
Definition: ItemAnno4cpp.cpp:187
std::shared_ptr< Part > createPart(const mico::persistence::model::URI &extractorID)
Create a new content part with a random URI and return a handle.
Definition: ItemAnno4cpp.cpp:23
Representation of a Item.
Definition: Item.hpp:17
Definition: ItemAnno4cpp.hpp:13
A URI.
Definition: Uri.hpp:22