Revision 59863
Added by Claudio Atzori over 3 years ago
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/deploy.info | ||
---|---|---|
1 |
{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-actionmanager-common/trunk/", "deploy_repository": "dnet45-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-snapshots", "name": "dnet-actionmanager-common"} |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/test/java/eu/dnetlib/actionmanager/actions/ActionFactoryTest.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager.actions; |
|
2 |
|
|
3 |
import java.io.IOException; |
|
4 |
import java.io.InputStream; |
|
5 |
import java.io.StringWriter; |
|
6 |
import java.util.Arrays; |
|
7 |
import java.util.List; |
|
8 |
import javax.annotation.Resource; |
|
9 |
import javax.xml.transform.TransformerException; |
|
10 |
|
|
11 |
import eu.dnetlib.actionmanager.common.Agent; |
|
12 |
import eu.dnetlib.actionmanager.common.Agent.AGENT_TYPE; |
|
13 |
import eu.dnetlib.actionmanager.common.Operation; |
|
14 |
import eu.dnetlib.actionmanager.common.Provenance; |
|
15 |
import eu.dnetlib.actionmanager.rmi.ActionManagerException; |
|
16 |
import eu.dnetlib.data.proto.OafProtos.Oaf; |
|
17 |
import org.apache.commons.io.IOUtils; |
|
18 |
import org.apache.commons.logging.Log; |
|
19 |
import org.apache.commons.logging.LogFactory; |
|
20 |
import org.dom4j.DocumentException; |
|
21 |
import org.junit.Test; |
|
22 |
import org.junit.runner.RunWith; |
|
23 |
import org.springframework.test.context.ContextConfiguration; |
|
24 |
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
|
25 |
|
|
26 |
import static org.junit.Assert.*; |
|
27 |
|
|
28 |
@RunWith(SpringJUnit4ClassRunner.class) |
|
29 |
@ContextConfiguration(locations = { "/eu/dnetlib/actionmanager/actions/applicationContext-actionmanager-test.xml" }) |
|
30 |
public class ActionFactoryTest { |
|
31 |
|
|
32 |
private static final Log log = LogFactory.getLog(ActionFactoryTest.class); |
|
33 |
private final static Agent agent = new Agent("agentId", "agentName", AGENT_TYPE.algo); |
|
34 |
private final static String trust = "0.9"; |
|
35 |
private final InputStream recordDataciteInputStream = getClass().getResourceAsStream("recordDatacite.xml"); |
|
36 |
private final InputStream recordOafInputStream = getClass().getResourceAsStream("record.xml"); |
|
37 |
@Resource |
|
38 |
private ActionFactory actionFactory; |
|
39 |
|
|
40 |
// @Before |
|
41 |
// public void setUp() throws Exception { |
|
42 |
// |
|
43 |
// } |
|
44 |
|
|
45 |
@Test |
|
46 |
public void testBeans() { |
|
47 |
assertNotNull(actionFactory); |
|
48 |
assertNotNull(actionFactory.getXslts()); |
|
49 |
assertFalse(actionFactory.getXslts().isEmpty()); |
|
50 |
} |
|
51 |
|
|
52 |
@Test |
|
53 |
public void testDataciteInsert() throws ActionManagerException, IOException, TransformerException, DocumentException { |
|
54 |
|
|
55 |
XsltInfoPackageAction action = |
|
56 |
actionFactory.generateInfoPackageAction("datacite2insertActions", "rawSet", agent, Operation.INSERT, asString(recordDataciteInputStream), |
|
57 |
Provenance.sysimport_crosswalk_datasetarchive, trust); |
|
58 |
|
|
59 |
checkActions(action, action.asAtomicActions()); |
|
60 |
} |
|
61 |
|
|
62 |
@Test |
|
63 |
public void testRecordOafInsert() throws ActionManagerException, IOException, TransformerException, DocumentException { |
|
64 |
|
|
65 |
XsltInfoPackageAction action = |
|
66 |
actionFactory.generateInfoPackageAction("dmf2insertActions", "rawSet", agent, Operation.INSERT, asString(recordOafInputStream), |
|
67 |
Provenance.sysimport_crosswalk_datasetarchive, trust); |
|
68 |
|
|
69 |
checkActions(action, action.asAtomicActions()); |
|
70 |
} |
|
71 |
|
|
72 |
@Test |
|
73 |
public void testRecordOafUpdate() throws ActionManagerException, IOException, TransformerException, DocumentException { |
|
74 |
|
|
75 |
XsltInfoPackageAction action = |
|
76 |
actionFactory.generateInfoPackageAction("dmf2updateActions", "rawSet", agent, Operation.INSERT, asString(recordOafInputStream), |
|
77 |
Provenance.sysimport_crosswalk_datasetarchive, trust); |
|
78 |
checkActions(action, action.asAtomicActions()); |
|
79 |
} |
|
80 |
|
|
81 |
private void checkActions(final XsltInfoPackageAction action, final List<AtomicAction> actions) |
|
82 |
throws TransformerException, DocumentException, com.google.protobuf.InvalidProtocolBufferException { |
|
83 |
for (AtomicAction a : action.calculateAtomicActions()) { |
|
84 |
assertNotNull(a.getTargetValue()); |
|
85 |
|
|
86 |
String actionJSON = a.toString(); |
|
87 |
|
|
88 |
log.info(actionJSON); |
|
89 |
|
|
90 |
final AtomicAction aa = AtomicAction.fromJSON(actionJSON); |
|
91 |
|
|
92 |
assertEquals(a.getRawSet(), aa.getRawSet()); |
|
93 |
assertEquals(a.getTargetColumn(), aa.getTargetColumn()); |
|
94 |
assertEquals(a.getTargetColumnFamily(), aa.getTargetColumnFamily()); |
|
95 |
assertEquals(a.getTargetRowKey(), aa.getTargetRowKey()); |
|
96 |
assertEquals(a.getActionType(), aa.getActionType()); |
|
97 |
assertEquals(a.getRowKey(), aa.getRowKey()); |
|
98 |
|
|
99 |
assertEquals(a.getAgent().getId(), aa.getAgent().getId()); |
|
100 |
assertEquals(a.getAgent().getName(), aa.getAgent().getName()); |
|
101 |
assertEquals(a.getAgent().getType(), aa.getAgent().getType()); |
|
102 |
|
|
103 |
assertTrue(Arrays.equals(a.getTargetValue(), aa.getTargetValue())); |
|
104 |
|
|
105 |
System.out.println(Oaf.parseFrom(aa.getTargetValue())); |
|
106 |
} |
|
107 |
|
|
108 |
for (AtomicAction a : actions) { |
|
109 |
assertNotNull(a); |
|
110 |
} |
|
111 |
log.info("N. puts: " + actions.size()); |
|
112 |
} |
|
113 |
|
|
114 |
private String asString(final InputStream i) throws IOException { |
|
115 |
StringWriter writer = new StringWriter(); |
|
116 |
IOUtils.copy(i, writer); |
|
117 |
return writer.toString(); |
|
118 |
} |
|
119 |
} |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/test/resources/eu/dnetlib/actionmanager/actions/applicationContext-actionmanager-test.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
3 |
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:sec="http://cxf.apache.org/configuration/security" |
|
4 |
xmlns:wsa="http://cxf.apache.org/ws/addressing" xmlns:p="http://www.springframework.org/schema/p" |
|
5 |
xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:t="http://dnetlib.eu/springbeans/t" |
|
6 |
xmlns:template="http://dnetlib.eu/springbeans/template" xmlns:util="http://www.springframework.org/schema/util" |
|
7 |
xmlns="http://www.springframework.org/schema/beans" |
|
8 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
|
9 |
http://cxf.apache.org/ws/addressing http://cxf.apache.org/schemas/ws-addr-conf.xsd |
|
10 |
http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd |
|
11 |
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd |
|
12 |
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd |
|
13 |
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd |
|
14 |
http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd"> |
|
15 |
|
|
16 |
<bean id="actionFactory" class="eu.dnetlib.actionmanager.actions.ActionFactory"> |
|
17 |
<property name="xslts"> |
|
18 |
<util:map> |
|
19 |
<entry key="dmf2insertActions" value="classpath:/eu/dnetlib/actionmanager/xslt/dmf2insertActions.xslt" /> |
|
20 |
<entry key="dmf2updateActions" value="classpath:/eu/dnetlib/actionmanager/xslt/dmf2updateActions.xslt" /> |
|
21 |
<entry key="datacite2insertActions" value="classpath:/eu/dnetlib/actionmanager/xslt/datacite2insertActions.xslt" /> |
|
22 |
<entry key="rels2Actions" value="classpath:/eu/dnetlib/actionmanager/xslt/rels2actions.xslt" /> |
|
23 |
</util:map> |
|
24 |
</property> |
|
25 |
</bean> |
|
26 |
|
|
27 |
</beans> |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/test/resources/eu/dnetlib/actionmanager/actions/recordDatacite.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<record xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
3 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
|
4 |
<oai:header xmlns="http://namespace.openaire.eu/" xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
5 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oai="http://www.openarchives.org/OAI/2.0/" |
|
6 |
xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"> |
|
7 |
<dri:objIdentifier>r3c903d4c5a8::00a0cdbbc0c27cca1ccfafb33e7a862d |
|
8 |
</dri:objIdentifier> |
|
9 |
<dri:recordIdentifier /> |
|
10 |
<dri:dateOfCollection>2014-10-08T13:12:50.337Z</dri:dateOfCollection> |
|
11 |
<dri:repositoryId>19365384-4f97-4446-9a81-8c414d2ca27a_UmVwb3NpdG9yeVNlcnZpY2VSZXNvdXJjZXMvUmVwb3NpdG9yeVNlcnZpY2VSZXNvdXJjZVR5cGU= |
|
12 |
</dri:repositoryId> |
|
13 |
<oaf:datasourceprefix>r3c903d4c5a8</oaf:datasourceprefix> |
|
14 |
<identifier xmlns="http://www.openarchives.org/OAI/2.0/">oai:ucd.ie:ucdlib:31727</identifier> |
|
15 |
<datestamp xmlns="http://www.openarchives.org/OAI/2.0/">2014-10-07T14:28:12Z</datestamp> |
|
16 |
<setSpec xmlns="http://www.openarchives.org/OAI/2.0/">ucd_digital_library</setSpec> |
|
17 |
<setSpec xmlns="http://www.openarchives.org/OAI/2.0/">openaire_data</setSpec> |
|
18 |
</oai:header> |
|
19 |
<metadata> |
|
20 |
<resource xmlns="http://datacite.org/schema/kernel-3" |
|
21 |
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
22 |
xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance" |
|
23 |
xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd"> |
|
24 |
<identifier identifierType="DOI">10.7925/drs1.ucdlib_31727</identifier> |
|
25 |
<creators> |
|
26 |
<creator> |
|
27 |
<creatorName>Laefer, Debra L.</creatorName> |
|
28 |
<nameIdentifier nameIdentifierScheme="ORCID">0000-0001-5134-5322</nameIdentifier> |
|
29 |
</creator> |
|
30 |
<creator> |
|
31 |
<creatorName>University College, Dublin. Library</creatorName> |
|
32 |
<nameIdentifier nameIdentifierScheme="VIAF" |
|
33 |
schemeURI="http://www.viaf.org">261450561</nameIdentifier> |
|
34 |
</creator> |
|
35 |
</creators> |
|
36 |
<titles> |
|
37 |
<title>39 Grafton Street, Dublin</title> |
|
38 |
</titles> |
|
39 |
<publisher>UCD School of Architecture Landscape Civil Engineering</publisher> |
|
40 |
<publicationYear>2013</publicationYear> |
|
41 |
<subjects> |
|
42 |
<subject schemeURI="http://id.loc.gov/authorities/subjects/sh99004820#concept" |
|
43 |
subjectScheme="NAF">Buildings, structures, etc</subject> |
|
44 |
</subjects> |
|
45 |
<contributors> |
|
46 |
<contributor contributorType="Other"> |
|
47 |
<contributorName>Clarke, Julie</contributorName> |
|
48 |
<nameIdentifier nameIdentifierScheme="ORCID">0000-0001-6092-9741</nameIdentifier> |
|
49 |
</contributor> |
|
50 |
<contributor contributorType="Sponsor"> |
|
51 |
<contributorName>UCD School of Architecture, Landscape, and Civil Engineering</contributorName> |
|
52 |
</contributor> |
|
53 |
<contributor contributorType="HostingInstitution"> |
|
54 |
<contributorName>University College, Dublin. Library</contributorName> |
|
55 |
<nameIdentifier nameIdentifierScheme="VIAF" |
|
56 |
schemeURI="http://www.viaf.org">261450561</nameIdentifier> |
|
57 |
</contributor> |
|
58 |
<contributor contributorType="Funder"> |
|
59 |
<contributorName>Irish Research Council for Science, Engineering and Technology</contributorName> |
|
60 |
<nameIdentifier nameIdentifierScheme="info">info:eu-repo/grantAgreement/IRCSET//RS-2011-435</nameIdentifier> |
|
61 |
</contributor> |
|
62 |
</contributors> |
|
63 |
<dates> |
|
64 |
<date dateType="Issued">2013</date> |
|
65 |
<date dateType="Available">2014-09-29</date> |
|
66 |
</dates> |
|
67 |
<resourceType resourceTypeGeneral="Dataset">Dataset</resourceType> |
|
68 |
<alternateIdentifiers> |
|
69 |
<alternateIdentifier alternateIdentifierType="URL">http://digital.ucd.ie/view/ucdlib:31727</alternateIdentifier> |
|
70 |
</alternateIdentifiers> |
|
71 |
<relatedIdentifiers> |
|
72 |
<relatedIdentifier relatedIdentifierType="DOI" |
|
73 |
relationType="IsPartOf">10.7925/drs1.ucdlib_31100</relatedIdentifier> |
|
74 |
<relatedIdentifier relatedIdentifierType="DOI" |
|
75 |
relationType="IsReferencedBy">10.7925/drs1.ucdlib_31057</relatedIdentifier> |
|
76 |
</relatedIdentifiers> |
|
77 |
<sizes> |
|
78 |
<size>1 still image</size> |
|
79 |
<size>26859085 bytes</size> |
|
80 |
<size>1545x2946 pixels</size> |
|
81 |
</sizes> |
|
82 |
<formats> |
|
83 |
<format>image/vnd.adobe.photoshop</format> |
|
84 |
<format>image/jpeg</format> |
|
85 |
</formats> |
|
86 |
<rightsList> |
|
87 |
<rights rightsURI="info:eu-repo/semantics/openAccess" /> |
|
88 |
<rights rightsURI="http://creativecommons.org/publicdomain/zero/1.0/">Use and reproduction: CC0 1.0 Universal</rights> |
|
89 |
</rightsList> |
|
90 |
<descriptions> |
|
91 |
<description descriptionType="Abstract">Consists of an |
|
92 |
orthorectified image of the structure in Adobe PhotoShop (PSD) |
|
93 |
format. The orthorectified image has been derived from one or more |
|
94 |
photographic images that are included as layers in the original |
|
95 |
Adobe PhotoShop (PSD) file. The composite and all other image |
|
96 |
layers have been extracted and saved in TIFF image files, and JPEG |
|
97 |
files in various resolutions have been derived from the flattened |
|
98 |
image layer to facilitate inspection.</description> |
|
99 |
<description descriptionType="Other">Brickwork structure, 4 |
|
100 |
levels above ground, constructed 1864.</description> |
|
101 |
<description descriptionType="Other">Funded by an award from the |
|
102 |
Irish Research Council for Science, Engineering and Technology |
|
103 |
(IRCSET), Embark Initiative Postgraduate Scholarship, grant |
|
104 |
identifier RS/2011/435.</description> |
|
105 |
</descriptions> |
|
106 |
<geoLocations> |
|
107 |
<geoLocation> |
|
108 |
<geoLocationPoint>53.3407951 -6.26054559383235</geoLocationPoint> |
|
109 |
</geoLocation> |
|
110 |
</geoLocations> |
|
111 |
</resource> |
|
112 |
<oaf:embargoenddate>2014-09-29</oaf:embargoenddate> |
|
113 |
<dr:CobjCategory>0021</dr:CobjCategory> |
|
114 |
<oaf:dateAccepted>2013-01-01</oaf:dateAccepted> |
|
115 |
<oaf:accessrights>OPEN</oaf:accessrights> |
|
116 |
<oaf:language>und</oaf:language> |
|
117 |
<oaf:hostedBy id="re3data_____::r3d100010742" name="UCD Digital Library" /> |
|
118 |
<oaf:collectedFrom id="re3data_____::r3d100010742" |
|
119 |
name="UCD Digital Library" /> |
|
120 |
<oaf:relatedPublication |
|
121 |
id="r39633d1e8c4::f5299dc87856b62949f02d0f780b05c3" /> |
|
122 |
</metadata> |
|
123 |
<about xmlns="http://namespace.openaire.eu/" xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
124 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oai="http://www.openarchives.org/OAI/2.0/" |
|
125 |
xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"> |
|
126 |
<oaf:datainfo> |
|
127 |
<oaf:inferred>false</oaf:inferred> |
|
128 |
<oaf:deletedbyinference>false</oaf:deletedbyinference> |
|
129 |
<oaf:trust>0.9</oaf:trust> |
|
130 |
<oaf:inferenceprovenance /> |
|
131 |
<oaf:provenanceaction classid="sysimport:crosswalk:datasetarchive" |
|
132 |
classname="sysimport:crosswalk:datasetarchive" schemeid="dnet:provenanceActions" |
|
133 |
schemename="dnet:provenanceActions" /> |
|
134 |
</oaf:datainfo> |
|
135 |
</about> |
|
136 |
</record> |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/test/resources/eu/dnetlib/actionmanager/actions/record.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<record xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
3 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
4 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
5 |
xmlns:oaf="http://namespace.openaire.eu/oaf" |
|
6 |
> |
|
7 |
<header xmlns="http://namespace.openaire.eu/"> |
|
8 |
<dri:objIdentifier>od_______296::74732b873f881d9bff67c2a11b6a66d6</dri:objIdentifier> |
|
9 |
<dri:recordIdentifier>ebfb74b7-3087-4da0-aaab-917121e40028_TURTdG9yZURTUmVzb3VyY2VzL01EU3RvcmVEU1Jlc291cmNlVHlwZQ==::oai:www.tdx.cat:10803/32188 |
|
10 |
</dri:recordIdentifier> |
|
11 |
<dri:dateOfCollection/> |
|
12 |
<dri:mdFormat/> |
|
13 |
<dri:mdFormatInterpretation/> |
|
14 |
<dri:repositoryId>1d3fe9bd-a21d-4bba-9238-dc6259ee1424_UmVwb3NpdG9yeVNlcnZpY2VSZXNvdXJjZXMvUmVwb3NpdG9yeVNlcnZpY2VSZXNvdXJjZVR5cGU=</dri:repositoryId> |
|
15 |
<dr:objectIdentifier/> |
|
16 |
<dr:dateOfCollection>2014-07-12T06:03:38Z</dr:dateOfCollection> |
|
17 |
<oaf:datasourceprefix>od_______296</oaf:datasourceprefix> |
|
18 |
</header> |
|
19 |
<metadata xmlns="http://namespace.openaire.eu/"> |
|
20 |
<dc:contributor>Riera Guilera, Carme</dc:contributor> |
|
21 |
<dc:contributor>Universitat Autònoma de Barcelona. Departament de Filologia Espanyola</dc:contributor> |
|
22 |
<dc:creator>Torras Francés, Meri</dc:creator> |
|
23 |
<dc:creator>Moreno-Noguer, Francese</dc:creator> |
|
24 |
<dc:dateAccepted>1998-10-26</dc:dateAccepted> |
|
25 |
<dc:description>La tesi parteix d’una reflexió des de la teoria a propòsit de l’estatut de l’autobiografia (i del gènere epistolar en particular), |
|
26 |
preguntant-se a propòsit d’aspectes com són ara la construcció del subjecte en el discurs o el valor de l’experiència com a categoria de diferència. |
|
27 |
Per tal de aprofundir en aquesta aproximació, el segon capÃtol realitza un alectura crÃtica de dues cartes autobiogrà fiques escrites per dones: la |
|
28 |
Carta a Sor Filotea de la Cruz, escrita per Sor Juana i l’ AutobiografÃa epistolar de Gertrudis Góme de Avellaneda. El capÃtol central analitza el |
|
29 |
binomi gènere femenÃ-gènere epistolar per demostrar de quina manera va establir-se a la modernitat (la França dels segles XVII i XVIII) i per què la |
|
30 |
carta privada acaba definint-se com un gènere (genre) de gènere (gender) femenÃ, sobre quins condicionaments socials va succeir i quin va ser el |
|
31 |
paper de les dones en tot això. En el darrer capÃtol s’aborda el seguiment del binomi a l’Espanya dels segles XVIII, XIX i XX, fent paleses les |
|
32 |
aplicacions particulars que va patir en aquest altre context historico-cultural. Tot això fent ús d’un plantejament i un enfocament propis de la |
|
33 |
filologia, la teoria de la literatura i la literatura comparada que, a l’apèndix, abraça altres arts, ja que s’hi recullen mostres de la pintura |
|
34 |
holandesa del xvii on el motiu de la carta femenina té un tractament plenament en consonà ncia amb els parà metres que van constituir l’assimmilació |
|
35 |
de gèneres (gènere femenÃ-gènere epistolar) a la França dels salons. |
|
36 |
</dc:description> |
|
37 |
<dc:description>La tesis parte de una reflexión desde la teorÃa a propósito del estatuto de la autobiografÃa (y del género epistolar en particular), |
|
38 |
preguntándose sobre aspectos como la construcción del sujeto en el discurso o el valor de la experiencia como categorÃa de diferencia. En aras de |
|
39 |
ahondar en esta aproximación, el segundo capÃtulo realiza una lectura crÃtica de dos cartas autobiográficas escritas por mujeres: la Carta a Sor |
|
40 |
Filotea de la Cruz, escrita por Sor Juana y la AutobiografÃa epistolar de Gertrudis Gómez de Avellaneda. El capÃtulo central está destinado a |
|
41 |
analizar el binomio género femenino-género epistolar para demostrar de qué modo se estableció en la modernidad (en la Francia de los siglos XVII y |
|
42 |
XVIII) y por qué la carta privada terminó definiéndose como un género (genre) de género (gender) femenino, sobre qué condicionamientos sociales |
|
43 |
aconteció y cuál fue el papel de las mujeres en ello. En el capÃtulo posterior se acomete el seguimiento del binomio en la España de los siglos |
|
44 |
XVIII, XIX y XX, dando cuenta de las aplicaciones particulares que sufrió en este otro contexto histórico-cultural. Todo ello haciendo uso de un |
|
45 |
planteamiento y un enfoque propios de la filologÃa, la teorÃa de la literatura y la literatura comparada que, en el apéndice, abraza otras artes, |
|
46 |
puesto que en él se recogen muestras de la pintura holandesa del XVII donde el motivo de la carta femenina observa un tratamiento plenamente en |
|
47 |
consonancia con los parámetros que constituyeron la asimilación de los géneros (género femenino-género epistolar) en la Francia de los salones. |
|
48 |
</dc:description> |
|
49 |
<dc:description>The thesis departs from a theoretic reflection on the status of autobiography in general —and of epistolary genre in particular— |
|
50 |
inquiring about aspects like the construction of the subject in the discourse or the value of experience as a category of difference. In order to |
|
51 |
examine in depth this approach, the second chapter performs a critical reading of two autobiographic letters written by women: the Carta a Sor |
|
52 |
Filotea de la Cruz by Sor Juana and the epistolary AutobiografÃa of Gertrudis Gómez de Avellaneda. The central chapter is devoted to analyze the |
|
53 |
epistolary genre—feminine gender relationship to show how it was established in Modernity (in France, XVII and XVIII centuries) and why the personal |
|
54 |
letter finished defined as a genre of feminine gender, on what social factors happened and what was the woman’s role in all that. The following |
|
55 |
chapter shows the relationship in Spain, XVIII, XIX and XX centuries, giving an account of particular applications that it suffered in this |
|
56 |
historical and cultural context. All this using approaches of Philology, Literary Theory and Comparative. The appendix considers some samples of the |
|
57 |
Dutch painting of the xvii where the motive of the feminine letter observes a treatment fully accordance with the parameters that constituted the |
|
58 |
assimilation of gender/genre (feminine gender/epistolary genre) in the French salons. |
|
59 |
</dc:description> |
|
60 |
<dc:identifier>http://hdl.handle.net/10803/32188</dc:identifier> |
|
61 |
<oaf:identifier identifierType="doi">10803/32188</oaf:identifier> |
|
62 |
<oaf:identifier identifierType="orcidworkid">1234-1234-1234-1111</oaf:identifier> |
|
63 |
<dc:language>esl/spa</dc:language> |
|
64 |
<dc:publisher>Universitat Autònoma de Barcelona</dc:publisher> |
|
65 |
<dc:title>La epistola privada como género: estrategias de construcción</dc:title> |
|
66 |
<dc:source>TDX (Tesis Doctorals en Xarxa)</dc:source> |
|
67 |
<dc:subject>Ciències Humanes</dc:subject> |
|
68 |
<dc:subject>82 - Literatura</dc:subject> |
|
69 |
<dr:CobjCategory>0006</dr:CobjCategory> |
|
70 |
<dr:CobjCategory>0000</dr:CobjCategory> |
|
71 |
<dr:CobjIdentifier>urn:isbn:9788469416310</dr:CobjIdentifier> |
|
72 |
<oaf:projectid>corda_______::295128</oaf:projectid> |
|
73 |
<oaf:collectedDatasourceid>opendoar____::296</oaf:collectedDatasourceid> |
|
74 |
<oaf:accessrights>OPEN</oaf:accessrights> |
|
75 |
<oaf:reference |
|
76 |
identifier="CHEMBL1658379" |
|
77 |
query="http://www.ebi.ac.uk/europepmc/webservices/rest/PMC/PMC2934972/databaseLinks/ChEMBL/2/json" |
|
78 |
source="CHEMBL" |
|
79 |
title="Antifungal activity against Candida albicans isolate 108 harboring erg11 and erg5 double mutant after 48 hrs by Etest" |
|
80 |
type="dataset">https://www.ebi.ac.uk/chembldb/assay/inspect/CHEMBL1658379 |
|
81 |
</oaf:reference> |
|
82 |
<oaf:hostedBy id="opendoar____::296" name="Tesis Doctorals en Xarxa"/> |
|
83 |
<oaf:collectedFrom id="opendoar____::296" name="Tesis Doctorals en Xarxa"/> |
|
84 |
</metadata> |
|
85 |
</record> |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/main/java/eu/dnetlib/actionmanager/actions/XsltInfoPackageAction.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager.actions; |
|
2 |
|
|
3 |
import java.io.StringReader; |
|
4 |
import java.util.List; |
|
5 |
import javax.xml.transform.Transformer; |
|
6 |
import javax.xml.transform.TransformerException; |
|
7 |
|
|
8 |
import com.google.common.base.Predicate; |
|
9 |
import com.google.common.collect.Iterables; |
|
10 |
import com.google.common.collect.Lists; |
|
11 |
import eu.dnetlib.actionmanager.ActionManagerConstants.ACTION_TYPE; |
|
12 |
import eu.dnetlib.actionmanager.common.Agent; |
|
13 |
import eu.dnetlib.actionmanager.common.Operation; |
|
14 |
import eu.dnetlib.actionmanager.common.Provenance; |
|
15 |
import org.apache.commons.codec.binary.Base64; |
|
16 |
import org.apache.commons.lang.StringUtils; |
|
17 |
import org.apache.commons.logging.Log; |
|
18 |
import org.apache.commons.logging.LogFactory; |
|
19 |
import org.dom4j.Document; |
|
20 |
import org.dom4j.DocumentException; |
|
21 |
import org.dom4j.Element; |
|
22 |
import org.dom4j.io.DocumentResult; |
|
23 |
import org.dom4j.io.DocumentSource; |
|
24 |
import org.dom4j.io.SAXReader; |
|
25 |
|
|
26 |
public class XsltInfoPackageAction extends AbstractAction { |
|
27 |
|
|
28 |
private static final Log log = LogFactory.getLog(XsltInfoPackageAction.class); // NOPMD by marko on 11/24/08 5:02 PM |
|
29 |
|
|
30 |
private Operation operation; |
|
31 |
private String infoPackage; |
|
32 |
private Provenance provenance; |
|
33 |
private String trust; |
|
34 |
private ActionFactory actionFactory; |
|
35 |
private Transformer transformer; |
|
36 |
|
|
37 |
public XsltInfoPackageAction(final String rawSet, final Agent agent, final Operation operation, final String infoPackage, final Provenance provenance, |
|
38 |
final String trust, final Transformer transformer, final ActionFactory actionFactory) { |
|
39 |
super(ACTION_TYPE.pkg, rawSet, agent); |
|
40 |
|
|
41 |
this.transformer = transformer; |
|
42 |
this.operation = operation; |
|
43 |
this.infoPackage = infoPackage; |
|
44 |
this.provenance = provenance; |
|
45 |
this.trust = trust; |
|
46 |
this.actionFactory = actionFactory; |
|
47 |
this.transformer = transformer; |
|
48 |
} |
|
49 |
|
|
50 |
public List<AtomicAction> asAtomicActions() throws TransformerException, DocumentException { |
|
51 |
return Lists.newArrayList(Iterables.filter(calculateAtomicActions(), new Predicate<AtomicAction>() { |
|
52 |
@Override |
|
53 |
public boolean apply(final AtomicAction action) { |
|
54 |
return action != null && action.isValid(); |
|
55 |
} |
|
56 |
})); |
|
57 |
} |
|
58 |
|
|
59 |
private Document applyXslt(final String xml, final Provenance provenance, final String trust) throws DocumentException, |
|
60 |
TransformerException { |
|
61 |
final Document doc = (new SAXReader()).read(new StringReader(xml)); |
|
62 |
|
|
63 |
final DocumentResult result = new DocumentResult(); |
|
64 |
|
|
65 |
transformer.setParameter("trust", trust); |
|
66 |
transformer.setParameter("provenance", provenance.toString()); |
|
67 |
|
|
68 |
transformer.transform(new DocumentSource(doc), result); |
|
69 |
|
|
70 |
return result.getDocument(); |
|
71 |
} |
|
72 |
|
|
73 |
protected List<AtomicAction> calculateAtomicActions() throws TransformerException, DocumentException { |
|
74 |
final List<AtomicAction> list = Lists.newArrayList(); |
|
75 |
|
|
76 |
final Document doc = applyXslt(getInfoPackage(), provenance, trust); |
|
77 |
for (Object o : doc.selectNodes("//ROW")) { |
|
78 |
list.add(createAtomicAction((Element) o)); |
|
79 |
} |
|
80 |
|
|
81 |
return list; |
|
82 |
} |
|
83 |
|
|
84 |
private AtomicAction createAtomicAction(final Element elem) { |
|
85 |
String key = elem.valueOf("./@key"); |
|
86 |
String colFamily = elem.valueOf("./@columnFamily"); |
|
87 |
String col = elem.valueOf("./QUALIFIER/@name"); |
|
88 |
final String text = elem.valueOf("./QUALIFIER"); |
|
89 |
byte[] value = StringUtils.isBlank(text) ? null : Base64.decodeBase64(text.trim()); |
|
90 |
|
|
91 |
return getActionFactory().createAtomicAction(getRawSet(), getAgent(), key, colFamily, col, value); |
|
92 |
} |
|
93 |
|
|
94 |
public Operation getOperation() { |
|
95 |
return operation; |
|
96 |
} |
|
97 |
|
|
98 |
public void setOperation(final Operation operation) { |
|
99 |
this.operation = operation; |
|
100 |
} |
|
101 |
|
|
102 |
public ActionFactory getActionFactory() { |
|
103 |
return actionFactory; |
|
104 |
} |
|
105 |
|
|
106 |
public void setActionFactory(final ActionFactory actionFactory) { |
|
107 |
this.actionFactory = actionFactory; |
|
108 |
} |
|
109 |
|
|
110 |
protected byte[] getBytesContent(final String content) { |
|
111 |
return content.getBytes(); |
|
112 |
} |
|
113 |
|
|
114 |
public String getInfoPackage() { |
|
115 |
return infoPackage; |
|
116 |
} |
|
117 |
|
|
118 |
public void setInfoPackage(final String infoPackage) { |
|
119 |
this.infoPackage = infoPackage; |
|
120 |
} |
|
121 |
|
|
122 |
public Provenance getProvenance() { |
|
123 |
return provenance; |
|
124 |
} |
|
125 |
|
|
126 |
public void setProvenance(final Provenance provenance) { |
|
127 |
this.provenance = provenance; |
|
128 |
} |
|
129 |
|
|
130 |
public String getTrust() { |
|
131 |
return trust; |
|
132 |
} |
|
133 |
|
|
134 |
public void setTrust(final String trust) { |
|
135 |
this.trust = trust; |
|
136 |
} |
|
137 |
|
|
138 |
public Transformer getTransformer() { |
|
139 |
return transformer; |
|
140 |
} |
|
141 |
|
|
142 |
public void setTransformer(final Transformer transformer) { |
|
143 |
this.transformer = transformer; |
|
144 |
} |
|
145 |
|
|
146 |
} |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/main/java/eu/dnetlib/actionmanager/actions/AbstractAction.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager.actions; |
|
2 |
|
|
3 |
import java.util.UUID; |
|
4 |
|
|
5 |
import eu.dnetlib.actionmanager.ActionManagerConstants.ACTION_TYPE; |
|
6 |
import eu.dnetlib.actionmanager.common.Agent; |
|
7 |
import eu.dnetlib.miscutils.functional.hash.Hashing; |
|
8 |
|
|
9 |
public abstract class AbstractAction { |
|
10 |
|
|
11 |
private ACTION_TYPE actionType; |
|
12 |
private String rawSet; |
|
13 |
private String rowKey; |
|
14 |
private Agent agent; |
|
15 |
|
|
16 |
public AbstractAction(final ACTION_TYPE actionType, final String rawSet, final Agent agent) { |
|
17 |
super(); |
|
18 |
this.actionType = actionType; |
|
19 |
this.rawSet = rawSet; |
|
20 |
this.agent = agent; |
|
21 |
this.rowKey = actionType + "|" + Hashing.md5(agent.getId()) + "|" + UUID.randomUUID(); |
|
22 |
} |
|
23 |
|
|
24 |
public ACTION_TYPE getActionType() { |
|
25 |
return actionType; |
|
26 |
} |
|
27 |
|
|
28 |
public void setActionType(final ACTION_TYPE actionType) { |
|
29 |
this.actionType = actionType; |
|
30 |
} |
|
31 |
|
|
32 |
public String getRawSet() { |
|
33 |
return rawSet; |
|
34 |
} |
|
35 |
|
|
36 |
public void setRawSet(final String rawSet) { |
|
37 |
this.rawSet = rawSet; |
|
38 |
} |
|
39 |
|
|
40 |
public String getRowKey() { |
|
41 |
return rowKey; |
|
42 |
} |
|
43 |
|
|
44 |
public void setRowKey(final String rowKey) { |
|
45 |
this.rowKey = rowKey; |
|
46 |
} |
|
47 |
|
|
48 |
/** |
|
49 |
* @return the agent |
|
50 |
*/ |
|
51 |
public Agent getAgent() { |
|
52 |
return agent; |
|
53 |
} |
|
54 |
|
|
55 |
/** |
|
56 |
* @param agent |
|
57 |
* the agent to set |
|
58 |
*/ |
|
59 |
public void setAgent(final Agent agent) { |
|
60 |
this.agent = agent; |
|
61 |
} |
|
62 |
|
|
63 |
} |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/main/java/eu/dnetlib/actionmanager/actions/ActionFactory.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager.actions; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
import java.util.Map; |
|
5 |
import javax.xml.transform.Transformer; |
|
6 |
import javax.xml.transform.TransformerFactory; |
|
7 |
|
|
8 |
import com.google.common.collect.Lists; |
|
9 |
import eu.dnetlib.actionmanager.common.Agent; |
|
10 |
import eu.dnetlib.actionmanager.common.Operation; |
|
11 |
import eu.dnetlib.actionmanager.common.Provenance; |
|
12 |
import eu.dnetlib.actionmanager.rmi.ActionManagerException; |
|
13 |
import eu.dnetlib.data.proto.TypeProtos.Type; |
|
14 |
import eu.dnetlib.miscutils.datetime.DateUtils; |
|
15 |
import org.apache.commons.logging.Log; |
|
16 |
import org.apache.commons.logging.LogFactory; |
|
17 |
import org.dom4j.Document; |
|
18 |
import org.dom4j.io.DocumentSource; |
|
19 |
import org.dom4j.io.SAXReader; |
|
20 |
import org.springframework.beans.factory.annotation.Required; |
|
21 |
import org.springframework.core.io.Resource; |
|
22 |
|
|
23 |
/** |
|
24 |
* Factory bean to create Actions bypassing the Action Manager API |
|
25 |
* |
|
26 |
* @author michele |
|
27 |
*/ |
|
28 |
public class ActionFactory { |
|
29 |
|
|
30 |
private static final Log log = LogFactory.getLog(ActionFactory.class); |
|
31 |
final TransformerFactory tFactory = TransformerFactory.newInstance(); |
|
32 |
private Map<String, Resource> xslts; |
|
33 |
|
|
34 |
/** |
|
35 |
* Creates a list of AtomicAction(s) to handle an UPDATE. Produces one Oaf, stored in CF = [entity]:update_[timestamp] |
|
36 |
* |
|
37 |
* @param set |
|
38 |
* the given set. |
|
39 |
* @param agent |
|
40 |
* the given agent. |
|
41 |
* @param originalId |
|
42 |
* main entity identifier to be updated (already existing in the information space). |
|
43 |
* @param entityType |
|
44 |
* one of: result, person, project, datasource, organization {@link eu.dnetlib.data.proto.TypeProtos.Type}. |
|
45 |
* @param updateContent |
|
46 |
* content to be updated over the original main entity. Oaf#OafEntity#[entity]#id must be consistent with the originalId. |
|
47 |
* note that: the given trust level has to be [>.9 | NEUTRAL | INFINITE] in order to gain visibility after the merging |
|
48 |
* process. |
|
49 |
* @return the list of AtomicActions. |
|
50 |
*/ |
|
51 |
public List<AtomicAction> createUpdateActions(final String set, |
|
52 |
final Agent agent, |
|
53 |
final String originalId, |
|
54 |
final Type entityType, |
|
55 |
final byte[] updateContent) { |
|
56 |
final List<AtomicAction> res = Lists.newArrayList(); |
|
57 |
|
|
58 |
res.add(createAtomicAction(set, agent, originalId, entityType.toString(), "update_" + DateUtils.now(), updateContent)); |
|
59 |
|
|
60 |
return res; |
|
61 |
} |
|
62 |
|
|
63 |
public AtomicAction createAtomicAction(final String set, |
|
64 |
final Agent agent, |
|
65 |
final String targetKey, |
|
66 |
final String targetColFamily, |
|
67 |
final String targetCol, |
|
68 |
final byte[] targetContent) { |
|
69 |
final AtomicAction action = new AtomicAction(set, agent); |
|
70 |
|
|
71 |
action.setTargetRowKey(targetKey); |
|
72 |
action.setTargetColumnFamily(targetColFamily); |
|
73 |
action.setTargetColumn(targetCol); |
|
74 |
action.setTargetValue(targetContent); |
|
75 |
|
|
76 |
return action; |
|
77 |
} |
|
78 |
|
|
79 |
public XsltInfoPackageAction generateInfoPackageAction(final String xsltResource, |
|
80 |
final String rawSet, |
|
81 |
final Agent agent, |
|
82 |
final Operation operation, |
|
83 |
final String infoPackage, |
|
84 |
final Provenance provenance, |
|
85 |
final String trust) throws ActionManagerException { |
|
86 |
|
|
87 |
final Transformer transformer = prepareXsltTransformer(xsltResource); |
|
88 |
|
|
89 |
return new XsltInfoPackageAction(rawSet, agent, operation, infoPackage, provenance, trust, transformer, this); |
|
90 |
} |
|
91 |
|
|
92 |
public Transformer prepareXsltTransformer(final String xsltName) throws ActionManagerException { |
|
93 |
try { |
|
94 |
if (!xslts.containsKey(xsltName)) { throw new ActionManagerException("XSLT " + xsltName + " not found"); } |
|
95 |
|
|
96 |
final Document doc = new SAXReader().read(xslts.get(xsltName).getInputStream()); |
|
97 |
if (log.isDebugEnabled()) { |
|
98 |
log.debug("using transformer factory: '" + tFactory.getClass().getName() + "'"); |
|
99 |
log.debug("xslt: \n" + doc.asXML()); |
|
100 |
} |
|
101 |
return tFactory.newTransformer(new DocumentSource(doc)); |
|
102 |
} catch (final Throwable e) { |
|
103 |
throw new ActionManagerException("Problem with xslt resource " + xsltName, e); |
|
104 |
} |
|
105 |
} |
|
106 |
|
|
107 |
public Map<String, Resource> getXslts() { |
|
108 |
return xslts; |
|
109 |
} |
|
110 |
|
|
111 |
@Required |
|
112 |
public void setXslts(final Map<String, Resource> xslts) { |
|
113 |
this.xslts = xslts; |
|
114 |
} |
|
115 |
|
|
116 |
} |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/main/java/eu/dnetlib/actionmanager/actions/AtomicActionDeserialiser.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager.actions; |
|
2 |
|
|
3 |
import java.lang.reflect.Type; |
|
4 |
import java.nio.charset.Charset; |
|
5 |
|
|
6 |
import com.google.gson.*; |
|
7 |
import com.googlecode.protobuf.format.JsonFormat; |
|
8 |
import eu.dnetlib.actionmanager.common.Agent; |
|
9 |
import eu.dnetlib.data.proto.OafProtos; |
|
10 |
import eu.dnetlib.miscutils.functional.hash.Hashing; |
|
11 |
import org.apache.commons.lang3.StringUtils; |
|
12 |
import org.apache.commons.logging.Log; |
|
13 |
import org.apache.commons.logging.LogFactory; |
|
14 |
|
|
15 |
import static org.apache.commons.lang3.StringUtils.*; |
|
16 |
|
|
17 |
/** |
|
18 |
* Created by claudio on 30/09/15. |
|
19 |
*/ |
|
20 |
public class AtomicActionDeserialiser extends AbstractActionSerializer implements JsonDeserializer<AtomicAction> { |
|
21 |
|
|
22 |
private static final Log log = LogFactory.getLog(AtomicActionDeserialiser.class); |
|
23 |
|
|
24 |
private final static byte[] EMPTY = "".getBytes(Charset.forName("UTF-8")); |
|
25 |
|
|
26 |
@Override |
|
27 |
public AtomicAction deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context) throws JsonParseException { |
|
28 |
|
|
29 |
if (json.isJsonObject()) { |
|
30 |
final JsonObject j = (JsonObject) json; |
|
31 |
|
|
32 |
final Agent a = new Agent(); |
|
33 |
|
|
34 |
final JsonObject aj = j.get(agent).getAsJsonObject(); |
|
35 |
a.setId(aj.get(agent_id).getAsString()); |
|
36 |
a.setName(aj.get(agent_name).getAsString()); |
|
37 |
a.setType(Agent.AGENT_TYPE.valueOf(aj.get(agent_type).getAsString())); |
|
38 |
|
|
39 |
AtomicAction aa = new AtomicAction(j.get(rawSet).getAsString(), a); |
|
40 |
|
|
41 |
aa.setTargetColumn(j.get(targetColumn).getAsString()); |
|
42 |
aa.setTargetColumnFamily(j.get(targetColumnFamily).getAsString()); |
|
43 |
aa.setTargetRowKey(j.get(targetRowKey).getAsString()); |
|
44 |
|
|
45 |
aa.setRowKey(j.get(rowKey).getAsString()); |
|
46 |
aa.setTargetValue(decodeTargetValue(j.get(targetValue).getAsString())); |
|
47 |
|
|
48 |
return aa; |
|
49 |
|
|
50 |
} |
|
51 |
|
|
52 |
throw new JsonParseException("input is not a json object"); |
|
53 |
} |
|
54 |
|
|
55 |
private byte[] decodeTargetValue(final String s) throws JsonParseException { |
|
56 |
if (isBlank(s)) { |
|
57 |
return EMPTY; |
|
58 |
} |
|
59 |
|
|
60 |
try { |
|
61 |
final String json = Hashing.decodeBase64(s); |
|
62 |
|
|
63 |
OafProtos.Oaf.Builder oaf = OafProtos.Oaf.newBuilder(); |
|
64 |
JsonFormat.merge(json, oaf); |
|
65 |
|
|
66 |
return oaf.build().toByteArray(); |
|
67 |
} catch (JsonFormat.ParseException e) { |
|
68 |
throw new JsonParseException("unable to parse proto", e); |
|
69 |
} |
|
70 |
} |
|
71 |
|
|
72 |
} |
|
73 |
|
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/main/java/eu/dnetlib/actionmanager/actions/AtomicAction.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager.actions; |
|
2 |
|
|
3 |
import com.google.gson.GsonBuilder; |
|
4 |
import eu.dnetlib.actionmanager.ActionManagerConstants.ACTION_TYPE; |
|
5 |
import eu.dnetlib.actionmanager.common.Agent; |
|
6 |
|
|
7 |
public class AtomicAction extends AbstractAction { |
|
8 |
|
|
9 |
private String targetRowKey; |
|
10 |
private String targetColumnFamily; |
|
11 |
private String targetColumn; |
|
12 |
|
|
13 |
private byte[] targetValue; |
|
14 |
|
|
15 |
public AtomicAction(final String rawSet, final Agent agent) { |
|
16 |
super(ACTION_TYPE.aac, rawSet, agent); |
|
17 |
} |
|
18 |
|
|
19 |
public AtomicAction(final String rawSet, final Agent agent, final String targetRowKey, final String targetColumnFamily, |
|
20 |
final String targetColumn, final byte[] targetValue) { |
|
21 |
this(rawSet, agent); |
|
22 |
this.targetRowKey = targetRowKey; |
|
23 |
this.targetColumnFamily = targetColumnFamily; |
|
24 |
this.targetColumn = targetColumn; |
|
25 |
this.targetValue = targetValue; |
|
26 |
} |
|
27 |
|
|
28 |
public static AtomicAction fromJSON(String s) { |
|
29 |
final GsonBuilder gson = new GsonBuilder(); |
|
30 |
gson.registerTypeAdapter(AtomicAction.class, new AtomicActionDeserialiser()); |
|
31 |
return gson.create().fromJson(s, AtomicAction.class); |
|
32 |
} |
|
33 |
|
|
34 |
public String toJSON() { |
|
35 |
final GsonBuilder gson = new GsonBuilder(); |
|
36 |
gson.registerTypeAdapter(AtomicAction.class, new AtomicActionSerialiser()); |
|
37 |
return gson.create().toJson(this); |
|
38 |
} |
|
39 |
|
|
40 |
public String getTargetRowKey() { |
|
41 |
return targetRowKey; |
|
42 |
} |
|
43 |
|
|
44 |
public void setTargetRowKey(final String targetRowKey) { |
|
45 |
this.targetRowKey = targetRowKey; |
|
46 |
} |
|
47 |
|
|
48 |
public String getTargetColumnFamily() { |
|
49 |
return targetColumnFamily; |
|
50 |
} |
|
51 |
|
|
52 |
public void setTargetColumnFamily(final String targetColumnFamily) { |
|
53 |
this.targetColumnFamily = targetColumnFamily; |
|
54 |
} |
|
55 |
|
|
56 |
public String getTargetColumn() { |
|
57 |
return targetColumn; |
|
58 |
} |
|
59 |
|
|
60 |
public void setTargetColumn(final String targetColumn) { |
|
61 |
this.targetColumn = targetColumn; |
|
62 |
} |
|
63 |
|
|
64 |
public byte[] getTargetValue() { |
|
65 |
return targetValue; |
|
66 |
} |
|
67 |
|
|
68 |
public void setTargetValue(final byte[] targetValue) { |
|
69 |
this.targetValue = targetValue; |
|
70 |
} |
|
71 |
|
|
72 |
public boolean isValid() { |
|
73 |
return ((getRowKey() != null) && !getRowKey().isEmpty() && (getRawSet() != null) && !getRawSet().isEmpty() && (targetRowKey != null) |
|
74 |
&& !targetRowKey.isEmpty() && (targetColumnFamily != null) && !targetColumnFamily.isEmpty() && (targetColumn != null) |
|
75 |
&& !targetColumn.isEmpty() && (targetValue != null) && (targetValue.length > 0)); |
|
76 |
} |
|
77 |
|
|
78 |
@Override |
|
79 |
public String toString() { |
|
80 |
return toJSON(); |
|
81 |
} |
|
82 |
|
|
83 |
} |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/main/java/eu/dnetlib/actionmanager/actions/AbstractActionSerializer.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager.actions; |
|
2 |
|
|
3 |
/** |
|
4 |
* Created by claudio on 01/10/15. |
|
5 |
*/ |
|
6 |
public abstract class AbstractActionSerializer { |
|
7 |
|
|
8 |
protected final static String targetColumn = "TargetColumn"; |
|
9 |
|
|
10 |
protected final static String targetColumnFamily = "TargetColumnFamily"; |
|
11 |
|
|
12 |
protected final static String targetRowKey = "TargetRowKey"; |
|
13 |
|
|
14 |
protected final static String rawSet = "RawSet"; |
|
15 |
|
|
16 |
protected final static String rowKey = "RowKey"; |
|
17 |
|
|
18 |
protected final static String actionType = "ActionType"; |
|
19 |
|
|
20 |
protected final static String targetValue = "TargetValue"; |
|
21 |
|
|
22 |
protected final static String agent = "Agent"; |
|
23 |
|
|
24 |
protected final static String agent_id = "Agent.Id"; |
|
25 |
protected final static String agent_name = "Agent.name"; |
|
26 |
protected final static String agent_type = "Agent.type"; |
|
27 |
|
|
28 |
} |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/main/java/eu/dnetlib/actionmanager/actions/AtomicActionSerialiser.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager.actions; |
|
2 |
|
|
3 |
import java.lang.reflect.Type; |
|
4 |
|
|
5 |
import com.google.gson.JsonElement; |
|
6 |
import com.google.gson.JsonObject; |
|
7 |
import com.google.gson.JsonSerializationContext; |
|
8 |
import com.google.gson.JsonSerializer; |
|
9 |
import com.google.protobuf.InvalidProtocolBufferException; |
|
10 |
import com.googlecode.protobuf.format.JsonFormat; |
|
11 |
import eu.dnetlib.actionmanager.common.Agent; |
|
12 |
import eu.dnetlib.data.proto.OafProtos.Oaf; |
|
13 |
import eu.dnetlib.miscutils.functional.hash.Hashing; |
|
14 |
import org.apache.commons.logging.Log; |
|
15 |
import org.apache.commons.logging.LogFactory; |
|
16 |
|
|
17 |
/** |
|
18 |
* Created by claudio on 30/09/15. |
|
19 |
*/ |
|
20 |
public class AtomicActionSerialiser extends AbstractActionSerializer implements JsonSerializer<AtomicAction> { |
|
21 |
|
|
22 |
private static final Log log = LogFactory.getLog(AtomicActionSerialiser.class); |
|
23 |
|
|
24 |
@Override |
|
25 |
public JsonElement serialize(final AtomicAction aa, final Type typeOfSrc, final JsonSerializationContext context) { |
|
26 |
|
|
27 |
JsonObject json = new JsonObject(); |
|
28 |
json.addProperty(targetColumn, aa.getTargetColumn()); |
|
29 |
json.addProperty(targetColumnFamily, aa.getTargetColumnFamily()); |
|
30 |
json.addProperty(targetRowKey, aa.getTargetRowKey()); |
|
31 |
json.addProperty(rawSet, aa.getRawSet()); |
|
32 |
json.addProperty(rowKey, aa.getRowKey()); |
|
33 |
json.addProperty(actionType, aa.getActionType().toString()); |
|
34 |
|
|
35 |
json.add(agent, getAgentJSON(aa)); |
|
36 |
|
|
37 |
//json.addProperty(targetValue, getTargetValueJSON(aa)); |
|
38 |
json.addProperty(targetValue, Hashing.encodeBase64(getTargetValueJSON(aa))); |
|
39 |
|
|
40 |
return json; |
|
41 |
} |
|
42 |
|
|
43 |
private JsonElement getAgentJSON(final AtomicAction aa) { |
|
44 |
|
|
45 |
final Agent a = aa.getAgent(); |
|
46 |
|
|
47 |
JsonObject json = new JsonObject(); |
|
48 |
json.addProperty(agent_id, a.getId()); |
|
49 |
json.addProperty(agent_name, a.getName()); |
|
50 |
json.addProperty(agent_type, a.getType().toString()); |
|
51 |
|
|
52 |
return json; |
|
53 |
} |
|
54 |
|
|
55 |
private String getTargetValueJSON(final AtomicAction aa) { |
|
56 |
try { |
|
57 |
return aa.getTargetValue() != null && aa.getTargetValue().length > 0 ? JsonFormat.printToString(Oaf.parseFrom(aa.getTargetValue())) : ""; |
|
58 |
} catch (InvalidProtocolBufferException e) { |
|
59 |
log.error("unable to parse proto", e); |
|
60 |
return null; |
|
61 |
} |
|
62 |
} |
|
63 |
} |
|
64 |
|
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/src/main/java/eu/dnetlib/actionmanager/ActionManagerConstants.java | ||
---|---|---|
1 |
package eu.dnetlib.actionmanager; |
|
2 |
|
|
3 |
public class ActionManagerConstants { |
|
4 |
|
|
5 |
public static enum ACTION_TYPE { |
|
6 |
aac, //atomicAction, |
|
7 |
pkg, //infoPackage, |
|
8 |
all //all |
|
9 |
} |
|
10 |
|
|
11 |
} |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/.springBeans | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beansProjectDescription> |
|
3 |
<version>1</version> |
|
4 |
<pluginVersion><![CDATA[3.1.0.201210040510-RELEASE]]></pluginVersion> |
|
5 |
<configSuffixes> |
|
6 |
<configSuffix><![CDATA[xml]]></configSuffix> |
|
7 |
</configSuffixes> |
|
8 |
<enableImports><![CDATA[false]]></enableImports> |
|
9 |
<configs> |
|
10 |
<config>src/main/resources/eu/dnetlib/actionmanager/hack/applicationContext-claimed-import.xml</config> |
|
11 |
</configs> |
|
12 |
<configSets> |
|
13 |
</configSets> |
|
14 |
</beansProjectDescription> |
modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<parent> |
|
4 |
<groupId>eu.dnetlib</groupId> |
|
5 |
<artifactId>dnet45-parent</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
<relativePath /> |
|
8 |
</parent> |
|
9 |
<modelVersion>4.0.0</modelVersion> |
|
10 |
<groupId>eu.dnetlib</groupId> |
|
11 |
<artifactId>dnet-actionmanager-common</artifactId> |
|
12 |
<packaging>jar</packaging> |
|
13 |
<version>6.0.6</version> |
|
14 |
<scm> |
|
15 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-actionmanager-common/tags/dnet-actionmanager-common-6.0.6</developerConnection> |
|
16 |
</scm> |
|
17 |
<repositories> |
|
18 |
<!-- Cloudera Repositories --> |
|
19 |
<repository> |
|
20 |
<snapshots> |
|
21 |
<enabled>false</enabled> |
|
22 |
</snapshots> |
|
23 |
<id>cloudera-central</id> |
|
24 |
<name>cloundera-libs-release</name> |
|
25 |
<url>https://maven.d4science.org/nexus/content/repositories/cloudera-central</url> |
|
26 |
</repository> |
|
27 |
<repository> |
|
28 |
<id>cloudera-snapshots</id> |
|
29 |
<name>cloudera-libs-snapshot</name> |
|
30 |
<url>https://maven.d4science.org/nexus/content/repositories/cloudera-snapshots</url> |
|
31 |
</repository> |
|
32 |
</repositories> |
|
33 |
<dependencies> |
|
34 |
<dependency> |
|
35 |
<groupId>apache</groupId> |
|
36 |
<artifactId>commons-logging</artifactId> |
|
37 |
<version>[1.0.0,1.1.0)</version> |
|
38 |
</dependency> |
|
39 |
<dependency> |
|
40 |
<groupId>eu.dnetlib</groupId> |
|
41 |
<artifactId>dnet-openaireplus-mapping-utils</artifactId> |
|
42 |
<version>[6.0.0,7.0.0)</version> |
|
43 |
<exclusions> |
|
44 |
<exclusion> |
|
45 |
<artifactId>jsp-api</artifactId> |
|
46 |
<groupId>javax.servlet.jsp</groupId> |
|
47 |
</exclusion> |
|
48 |
</exclusions> |
|
49 |
</dependency> |
|
50 |
<dependency> |
|
51 |
<groupId>eu.dnetlib</groupId> |
|
52 |
<artifactId>dnet-actionmanager-api</artifactId> |
|
53 |
<version>[4.0.1,5.0.0)</version> |
|
54 |
</dependency> |
|
55 |
<dependency> |
|
56 |
<groupId>org.apache.hadoop</groupId> |
|
57 |
<artifactId>hadoop-common</artifactId> |
|
58 |
<version>${hadoop.common.version}</version> |
|
59 |
<exclusions> |
|
60 |
<exclusion> |
|
61 |
<artifactId>jasper-compiler</artifactId> |
|
62 |
<groupId>tomcat</groupId> |
|
63 |
</exclusion> |
|
64 |
<exclusion> |
|
65 |
<artifactId>jasper-runtime</artifactId> |
|
66 |
<groupId>tomcat</groupId> |
|
67 |
</exclusion> |
|
68 |
<exclusion> |
|
69 |
<artifactId>mockito-all</artifactId> |
|
70 |
<groupId>org.mockito</groupId> |
|
71 |
</exclusion> |
|
72 |
<exclusion> |
|
73 |
<artifactId>jetty</artifactId> |
|
74 |
<groupId>org.mortbay.jetty</groupId> |
|
75 |
</exclusion> |
|
76 |
<exclusion> |
|
77 |
<artifactId>jetty-util</artifactId> |
|
78 |
<groupId>org.mortbay.jetty</groupId> |
|
79 |
</exclusion> |
|
80 |
<exclusion> |
|
81 |
<artifactId>core</artifactId> |
|
82 |
<groupId>org.eclipse.jdt</groupId> |
|
83 |
</exclusion> |
|
84 |
<exclusion> |
|
85 |
<groupId>javax.servlet</groupId> |
|
86 |
<artifactId>servlet-api</artifactId> |
|
87 |
</exclusion> |
|
88 |
<exclusion> |
|
89 |
<artifactId>slf4j-api</artifactId> |
|
90 |
<groupId>org.slf4j</groupId> |
|
91 |
</exclusion> |
|
92 |
<exclusion> |
|
93 |
<artifactId>slf4j-log4j12</artifactId> |
|
94 |
<groupId>org.slf4j</groupId> |
|
95 |
</exclusion> |
|
96 |
<exclusion> |
|
97 |
<artifactId>jsp-api</artifactId> |
|
98 |
<groupId>javax.servlet.jsp</groupId> |
|
99 |
</exclusion> |
|
100 |
<exclusion> |
|
101 |
<artifactId>guava</artifactId> |
|
102 |
<groupId>com.google.guava</groupId> |
|
103 |
</exclusion> |
|
104 |
</exclusions> |
|
105 |
</dependency> |
|
106 |
<dependency> |
|
107 |
<groupId>com.googlecode.protobuf-java-format</groupId> |
|
108 |
<artifactId>protobuf-java-format</artifactId> |
|
109 |
<version>1.2</version> |
|
110 |
</dependency> |
|
111 |
<dependency> |
|
112 |
<groupId>junit</groupId> |
|
113 |
<artifactId>junit</artifactId> |
|
114 |
<version>${junit.version}</version> |
|
115 |
<scope>test</scope> |
|
116 |
</dependency> |
|
117 |
<dependency> |
|
118 |
<groupId>org.springframework</groupId> |
|
119 |
<artifactId>spring-context</artifactId> |
|
120 |
<version>${spring.version}</version> |
|
121 |
<scope>test</scope> |
|
122 |
</dependency> |
|
123 |
</dependencies> |
|
124 |
</project> |
Also available in: Unified diff
[maven-release-plugin] copy for tag dnet-actionmanager-common-6.0.6