Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
afi
opacce
Commits
09422c8d
Commit
09422c8d
authored
Jun 25, 2019
by
Patrick Barroca
😁
Browse files
dev #93528 : numel records integrated in cosmogramme
parent
3c02fc5a
Pipeline
#8469
failed with stage
in 30 minutes and 2 seconds
Changes
22
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
898 additions
and
41 deletions
+898
-41
VERSIONS_WIP/93528
VERSIONS_WIP/93528
+1
-0
application/modules/opac/controllers/NoticeajaxController.php
...ication/modules/opac/controllers/NoticeajaxController.php
+3
-0
cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerNumelTest.php
...ules/cosmo/controllers/DataProfileControllerNumelTest.php
+92
-0
cosmogramme/php/classes/classe_notice_integration.php
cosmogramme/php/classes/classe_notice_integration.php
+7
-2
library/Class/Cosmogramme/FileParser.php
library/Class/Cosmogramme/FileParser.php
+1
-0
library/Class/Cosmogramme/Integration.php
library/Class/Cosmogramme/Integration.php
+5
-0
library/Class/Cosmogramme/Integration/DataSource.php
library/Class/Cosmogramme/Integration/DataSource.php
+9
-4
library/Class/Cosmogramme/Integration/Record/Numel.php
library/Class/Cosmogramme/Integration/Record/Numel.php
+58
-0
library/Class/Indexation/PseudoNotice/UnimarcVisitor.php
library/Class/Indexation/PseudoNotice/UnimarcVisitor.php
+16
-0
library/Class/IntProfilDonnees.php
library/Class/IntProfilDonnees.php
+15
-2
library/Class/Notice/DoubleFinder.php
library/Class/Notice/DoubleFinder.php
+3
-1
library/Class/Notice/Numel.php
library/Class/Notice/Numel.php
+54
-0
library/Class/Notice/Sso.php
library/Class/Notice/Sso.php
+5
-30
library/Class/Notice/ThirdParty.php
library/Class/Notice/ThirdParty.php
+46
-0
library/Class/ProfileSerializer.php
library/Class/ProfileSerializer.php
+1
-0
library/Class/ProfileSerializer/Numel.php
library/Class/ProfileSerializer/Numel.php
+56
-0
library/Class/WebService/OAI/DublinCoreParser/Numel.php
library/Class/WebService/OAI/DublinCoreParser/Numel.php
+120
-0
library/ZendAfi/Validate/VignetteUrl.php
library/ZendAfi/Validate/VignetteUrl.php
+3
-2
tests/application/modules/opac/controllers/NoticeAjaxControllerNumelTest.php
...odules/opac/controllers/NoticeAjaxControllerNumelTest.php
+72
-0
tests/library/Class/Cosmogramme/Integration/PhaseNoticeNumelTest.php
...ry/Class/Cosmogramme/Integration/PhaseNoticeNumelTest.php
+331
-0
No files found.
VERSIONS_WIP/93528
0 → 100644
View file @
09422c8d
- ticket #93528 : Intégration : Meilleur prise en compte des types de documents Numel
\ No newline at end of file
application/modules/opac/controllers/NoticeajaxController.php
View file @
09422c8d
...
...
@@ -250,6 +250,9 @@ class NoticeAjaxController extends ZendAfi_Controller_Action {
public
function
resnumeriquesAction
()
{
if
(
$viewer
=
(
new
Class_Notice_Numel
(
$this
->
notice
))
->
getViewer
())
return
$this
->
_sendResponseWithScripts
(
$viewer
->
renderOn
(
$this
->
view
));
$html
=
$add_album_tag
=
''
;
if
(
1
==
Class_AdminVar
::
isBibNumEnabled
()
...
...
cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerNumelTest.php
0 → 100644
View file @
09422c8d
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
abstract
class
Cosmo_DataProfileControllerNumelProfileTestCase
extends
CosmoControllerTestCase
{
public
function
setUp
()
{
parent
::
setUp
();
$this
->
fixture
(
'Class_IntProfilDonnees'
,
[
'id'
=>
789
,
'libelle'
=>
'OAI Numel'
,
'accents'
=>
Class_IntProfilDonnees
::
ENCODING_UTF8
,
'rejet_periodiques'
=>
0
,
'id_article_periodique'
=>
Class_IntProfilDonnees
::
SERIAL_FORMAT_NONE
,
'type_fichier'
=>
Class_IntProfilDonnees
::
FT_RECORDS
,
'format'
=>
Class_IntProfilDonnees
::
FORMAT_NUMEL
,
'attributs'
=>
[
[
Class_IntProfilDonnees
::
FIELD_TYPE_DOC_RECOGNITION
=>
[]]
]
]);
}
}
class
Cosmo_DataProfileControllerNumelEditTest
extends
Cosmo_DataProfileControllerNumelProfileTestCase
{
public
function
setUp
()
{
parent
::
setUp
();
$this
->
dispatch
(
'/cosmo/data-profile/edit/id/789'
,
true
);
}
/** @test */
public
function
fileFormatShouldBeNumel
()
{
$this
->
assertXPath
(
'//select/option[@label="Dublin Core Numel"][@value="12"][@selected]'
);
}
/** @test */
public
function
fieldsetDocTypesShouldBePresent
()
{
$this
->
assertXPathContentContains
(
'//form//fieldset/legend'
,
'Type de documents'
);
}
/** @test */
public
function
typeDocColumnLabelsShouldBeType
()
{
$this
->
assertXPathContentContains
(
'//script'
,
'fields:[{"name":"1_type","label":"dcterms:type"}]'
);
}
}
class
Cosmo_DataProfileControllerNumelPostTest
extends
Cosmo_DataProfileControllerNumelProfileTestCase
{
public
function
setUp
()
{
parent
::
setUp
();
$post
=
[
'1_type'
=>
[
'atlas'
,
'image fixe'
,
'image'
],
Class_IntProfilDonnees
::
PROFILE_FILE_TYPE
=>
(
string
)
Class_IntProfilDonnees
::
FT_RECORDS
,
Class_IntProfilDonnees
::
PROFILE_FILE_FORMAT
=>
(
string
)
Class_IntProfilDonnees
::
FORMAT_NUMEL
];
$this
->
postDispatch
(
'/cosmo/data-profile/edit/id/789'
,
$post
);
Class_IntProfilDonnees
::
clearCache
();
}
/** @test */
public
function
docTypeFieldsShouldBeAsExpected
()
{
$this
->
assertEquals
([
'code'
=>
'1'
,
'type'
=>
'atlas;image fixe;image'
,
'format'
=>
''
],
Class_IntProfilDonnees
::
find
(
789
)
->
getItemDocTypesPrefs
()[
1
]);
}
}
\ No newline at end of file
cosmogramme/php/classes/classe_notice_integration.php
View file @
09422c8d
...
...
@@ -138,6 +138,10 @@ class notice_integration {
$this
->
analyseur
=
new
Class_Cosmogramme_Integration_Record_Bibliondemand
();
break
;
case
Class_IntProfilDonnees
::
FORMAT_NUMEL
:
$this
->
analyseur
=
new
Class_Cosmogramme_Integration_Record_Numel
();
break
;
default
:
require_once
(
"classe_notice_ascii.php"
);
$this
->
analyseur
=
new
notice_ascii
();
...
...
@@ -593,8 +597,9 @@ class notice_integration {
$this
->
statut
=
static
::
RECORD_UPDATE
;
if
(
in_array
(
$this
->
format
,
[
Class_IntProfilDonnees
::
FORMAT_DUBLIN_CORE
,
Class_IntProfilDonnees
::
FORMAT_BIBLIONDEMAND
]))
[
Class_IntProfilDonnees
::
FORMAT_DUBLIN_CORE
,
Class_IntProfilDonnees
::
FORMAT_BIBLIONDEMAND
,
Class_IntProfilDonnees
::
FORMAT_NUMEL
]))
return
$this
->
_realUpdate
(
$existing_notice
);
// Zones forcees
...
...
library/Class/Cosmogramme/FileParser.php
View file @
09422c8d
...
...
@@ -36,6 +36,7 @@ abstract class Class_Cosmogramme_FileParser {
Class_IntProfilDonnees
::
FORMAT_MARC21
=>
'Marc'
,
Class_IntProfilDonnees
::
FORMAT_AVENIO
=>
'Ascii_Tab'
,
Class_IntProfilDonnees
::
FORMAT_BIBLIONDEMAND
=>
'OaiDC'
,
Class_IntProfilDonnees
::
FORMAT_NUMEL
=>
'OaiDC'
,
];
protected
$_file_handle
,
$_position
,
$_file_size
,
$_profil
;
...
...
library/Class/Cosmogramme/Integration.php
View file @
09422c8d
...
...
@@ -93,6 +93,11 @@ class Class_Cosmogramme_Integration extends Storm_Model_Abstract {
}
public
function
isNumel
()
{
return
$this
->
getProfilDonnees
()
->
isNumel
();
}
public
function
fileExists
()
{
return
$this
->
getFileSystem
()
->
file_exists
(
$this
->
getFilePath
());
}
...
...
library/Class/Cosmogramme/Integration/DataSource.php
View file @
09422c8d
...
...
@@ -27,7 +27,9 @@ abstract class Class_Cosmogramme_Integration_DataSource {
public
static
function
on
(
$integration
)
{
if
(
$integration
->
isSourceHTTP
()
&&
(
$integration
->
isFormatDublinCore
()
||
$integration
->
isBibliondemand
()))
&&
(
$integration
->
isFormatDublinCore
()
||
$integration
->
isBibliondemand
()
||
$integration
->
isNumel
()))
return
new
Class_Cosmogramme_Integration_DataSourceOAIDublinCore
(
$integration
);
if
(
$integration
->
isSourceHTTP
())
...
...
@@ -250,9 +252,12 @@ class Class_Cosmogramme_Integration_DataSourceOAIMarc21 extends Class_Cosmogramm
class
Class_Cosmogramme_Integration_DataSourceOAIDublinCore
extends
Class_Cosmogramme_Integration_DataSourceOAI
{
public
function
newClient
()
{
$parser
=
$this
->
_integration
->
isBibliondemand
()
?
new
Class_WebService_OAI_DublinCoreParser_Bibliondemand
()
:
new
Class_WebService_OAI_DublinCoreParser
();
$parser
=
new
Class_WebService_OAI_DublinCoreParser
();
if
(
$this
->
_integration
->
isBibliondemand
())
$parser
=
new
Class_WebService_OAI_DublinCoreParser_Bibliondemand
();
if
(
$this
->
_integration
->
isNumel
())
$parser
=
new
Class_WebService_OAI_DublinCoreParser_Numel
();
return
(
new
Class_WebService_OAI
())
->
setOAIHandler
(
$this
->
_uri
)
...
...
library/Class/Cosmogramme/Integration/Record/Numel.php
0 → 100644
View file @
09422c8d
<?php
/**
* Copyright (c) 2019, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class
Class_Cosmogramme_Integration_Record_Numel
extends
Class_Cosmogramme_Integration_Record_DublinCore
{
protected
function
_parseDatas
(
$data
)
{
if
(
is_array
(
$data
))
return
$data
;
$parser
=
new
Class_WebService_OAI_DublinCoreParser_Numel
();
return
$parser
->
parse
(
$data
)[
0
];
}
protected
function
_dublinCoreToUnimarc
()
{
$visitor
=
parent
::
_dublinCoreToUnimarc
();
$visitor
->
visitThumbnail
(
$this
->
_datas
[
'thumbnail'
])
->
visitPrivateUrl
(
$this
->
_datas
[
'external_uri'
])
->
visitCatalogAgency
(
'Numel'
)
->
visitLocations
(
$this
->
_datas
[
'source'
])
->
visitCollections
(
$this
->
_datas
[
'collections'
])
->
visitSubjectCommonNames
(
$this
->
_datas
[
'subjects'
]);
return
$visitor
;
}
protected
function
_achieveUnimarc
(
$unimarc_visitor
)
{
return
$unimarc_visitor
;
}
protected
function
_getItem
()
{
return
[[
'f'
,
$this
->
_datas
[
'id_oai'
]],
[
'r'
,
implode
(
';'
,
$this
->
_types
)],
[
'k'
,
$this
->
_datas
[
'cote'
]],];
}
}
library/Class/Indexation/PseudoNotice/UnimarcVisitor.php
View file @
09422c8d
...
...
@@ -178,6 +178,14 @@ class Class_Indexation_PseudoNotice_UnimarcVisitor extends Class_Indexation_Pseu
}
public
function
visitSubjectCommonNames
(
$subjects
)
{
foreach
(
$subjects
as
$subject
)
$this
->
addUnimarcField
(
'606'
,
'1 '
,
[[
'a'
,
$subject
]]);
return
$this
;
}
public
function
visitRessource
(
$ressource
)
{
$ressource
->
acceptVisitor
(
$this
);
}
...
...
@@ -252,6 +260,14 @@ class Class_Indexation_PseudoNotice_UnimarcVisitor extends Class_Indexation_Pseu
}
public
function
visitCollections
(
$datas
)
{
foreach
(
$datas
as
$collection
)
$this
->
addUnimarcField
(
'225'
,
' '
,
[[
'a'
,
$collection
]]);
return
$this
;
}
public
function
visitCreationDate
(
$data
)
{
return
$this
->
_updateCreationDate
(
$data
);
}
...
...
library/Class/IntProfilDonnees.php
View file @
09422c8d
...
...
@@ -76,7 +76,8 @@ class IntProfilDonneesLoader extends Storm_Model_Loader {
Class_IntProfilDonnees
::
FORMAT_UNIMARC_XML
=>
$this
->
_
(
'Unimarc XML'
),
Class_IntProfilDonnees
::
FORMAT_AVENIO
=>
$this
->
_
(
'Avenio'
),
Class_IntProfilDonnees
::
FORMAT_DUBLIN_CORE
=>
$this
->
_
(
'Dublin Core'
),
Class_IntProfilDonnees
::
FORMAT_BIBLIONDEMAND
=>
$this
->
_
(
'Dublin Core Bibliondemand'
)];
Class_IntProfilDonnees
::
FORMAT_BIBLIONDEMAND
=>
$this
->
_
(
'Dublin Core Bibliondemand'
),
Class_IntProfilDonnees
::
FORMAT_NUMEL
=>
$this
->
_
(
'Dublin Core Numel'
)];
}
...
...
@@ -121,7 +122,8 @@ class IntProfilDonneesLoader extends Storm_Model_Loader {
Class_IntProfilDonnees
::
FORMAT_UNIMARC_XML
=>
''
,
Class_IntProfilDonnees
::
FORMAT_AVENIO
=>
''
,
Class_IntProfilDonnees
::
FORMAT_DUBLIN_CORE
=>
''
,
Class_IntProfilDonnees
::
FORMAT_BIBLIONDEMAND
=>
''
]);
Class_IntProfilDonnees
::
FORMAT_BIBLIONDEMAND
=>
''
,
Class_IntProfilDonnees
::
FORMAT_NUMEL
=>
''
,]);
}
...
...
@@ -169,6 +171,11 @@ class IntProfilDonneesLoader extends Storm_Model_Loader {
}
public
function
isFormatNumel
(
$format
)
{
return
Class_IntProfilDonnees
::
FORMAT_NUMEL
==
$format
;
}
public
function
getLoanFields
()
{
return
Class_CosmoVar
::
getList
(
'champs_pret'
);
}
...
...
@@ -306,6 +313,7 @@ class Class_IntProfilDonnees extends Storm_Model_Abstract {
FORMAT_DUBLIN_CORE
=
9
,
FORMAT_CG68_ARCHIVES
=
10
,
FORMAT_BIBLIONDEMAND
=
11
,
FORMAT_NUMEL
=
12
,
SERIAL_FORMAT_NONE
=
0
,
SERIAL_FORMAT_PERGAME
=
1
,
...
...
@@ -938,6 +946,11 @@ class Class_IntProfilDonnees extends Storm_Model_Abstract {
}
public
function
isNumel
()
{
return
self
::
FORMAT_NUMEL
==
$this
->
getFormat
();
}
public
function
getSeparator
()
{
switch
(
$this
->
getFormat
())
{
case
self
::
FORMAT_SEMI_COLON_ASCII
:
return
';'
;
break
;
...
...
library/Class/Notice/DoubleFinder.php
View file @
09422c8d
...
...
@@ -60,7 +60,9 @@ class Class_Notice_DoubleFinder {
protected
function
_strategyName
()
{
if
(
$this
->
_profil
&&
(
$this
->
_profil
->
isFormatDublinCore
()
||
$this
->
_profil
->
isBibliondemand
()))
&&
(
$this
->
_profil
->
isFormatDublinCore
()
||
$this
->
_profil
->
isBibliondemand
()
||
$this
->
_profil
->
isNumel
()))
return
'Class_Notice_DoubleFinder_BarcodeStrategy'
;
if
((
$this
->
_double_mode
==
Class_CosmoVar
::
DOUBLE_SEARCH_NONE
)
...
...
library/Class/Notice/Numel.php
0 → 100644
View file @
09422c8d
<?php
/**
* Copyright (c) 2019, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class
Class_Notice_Numel
extends
Class_Notice_ThirdParty
{
public
function
getViewer
()
{
return
(
'Numel'
==
$this
->
getFirstCatalogAgency
()
&&
$this
->
getFirstPrivateUrl
())
?
$this
:
null
;
}
public
function
renderOn
(
$view
)
{
if
(
!
$viewer
=
$this
->
getFirstPrivateUrl
())
return
''
;
$class
=
'Numel_viewer'
;
Class_ScriptLoader
::
getInstance
()
->
addInlineStyle
(
sprintf
(
'iframe.%s { height: %dpx; width: %dpx; margin-top: 2ex; }'
,
$class
,
900
,
600
));
return
$view
->
tagAnchor
(
$viewer
,
$view
->
_
(
'Voir en pleine page'
),
[
'class'
=>
'bouton'
,
'target'
=>
'_blank'
])
.
$view
->
tag
(
'iframe'
,
null
,
[
'src'
=>
$viewer
,
'class'
=>
$class
]);
}
}
library/Class/Notice/Sso.php
View file @
09422c8d
...
...
@@ -20,40 +20,15 @@
*/
class
Class_Notice_Sso
extends
Class_Entity
{
public
function
__construct
(
$record
)
{
$this
->
setRecord
(
$record
);
}
class
Class_Notice_Sso
extends
Class_Notice_ThirdParty
{
public
function
isValid
()
{
if
(
!
$this
->
getRecord
())
return
false
;
if
(
!
$catalog_agency
=
$this
->
getFirstCatalogAgency
())
return
false
;
return
$catalog_agency
==
'Bibliondemand'
;
}
protected
function
getFirstCatalogAgency
()
{
$agencies
=
$this
->
getRecord
()
->
get_subfield
(
'801'
,
'b'
);
return
reset
(
$agencies
);
}
public
function
getFirstPrivateUrl
()
{
$urls
=
$this
->
getRecord
()
->
get_subfield
(
'956'
,
'u'
);
return
reset
(
$urls
);
return
'Bibliondemand'
==
$this
->
getFirstCatalogAgency
();
}
public
function
getConfig
()
{
if
(
!
$this
->
isValid
())
return
null
;
return
Class_DigitalResource
::
getInstance
()
->
configFor
(
$this
->
getFirstCatalogAgency
());
return
$this
->
isValid
()
?
Class_DigitalResource
::
getInstance
()
->
configFor
(
$this
->
getFirstCatalogAgency
())
:
null
;
}
}
library/Class/Notice/ThirdParty.php
0 → 100644
View file @
09422c8d
<?php
/**
* Copyright (c) 2019, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class
Class_Notice_ThirdParty
extends
Class_Entity
{
public
function
__construct
(
$record
)
{
$this
->
setRecord
(
$record
);
}
public
function
getFirstCatalogAgency
()
{
return
$this
->
_getFirstRecordSubfield
(
'801'
,
'b'
);
}
public
function
getFirstPrivateUrl
()
{
return
$this
->
_getFirstRecordSubfield
(
'956'
,
'u'
);
}
protected
function
_getFirstRecordSubfield
(
$field
,
$subfield
)
{
if
(
!
$record
=
$this
->
getRecord
())
return
''
;
$datas
=
$record
->
get_subfield
(
$field
,
$subfield
);
return
reset
(
$datas
);
}
}
library/Class/ProfileSerializer.php
View file @
09422c8d
...
...
@@ -39,6 +39,7 @@ class Class_ProfileSerializer {
if
(
Class_IntProfilDonnees
::
isRecordFileType
(
$this
->
_fileType
()))
return
$this
->
_buildStrategyWith
([
'UnimarcRecord'
=>
'isFormatUnimarc'
,
'DublinCoreRecords'
=>
'isFormatDublinCoreOrBiblionDemand'
,
'Numel'
=>
'isFormatNumel'
,
'CSVItem'
=>
'isFormatCSV'
]);
if
(
Class_IntProfilDonnees
::
isPatronFileType
(
$this
->
_fileType
()))
...
...
library/Class/ProfileSerializer/Numel.php
0 → 100644
View file @
09422c8d
<?php
/**
* Copyright (c) 2019, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class
Class_ProfileSerializer_Numel
extends
Class_ProfileSerializer_DublinCoreRecords
{
public
function
buildForm
(
$form
)
{
return
$form
->
addDocTypeGroup
([
'type'
=>
$this
->
_
(
'dcterms:type'
)]);
}
public
function
populateForm
(
$form
)
{
return
$form
->
populateItemDocTypes
([
'type'
=>
'type'
]);
}
protected
function
_extractRecordsSettings
()
{
$doc_types_prefs
=
[];
$doc_types
=
Class_TypeDoc
::
findAll
();
foreach
(
$doc_types
as
$doc_type
)
{
$doc_type_id
=
$doc_type
->
getId
();
$doc_types_prefs
[
$doc_type_id
]
=
[
'code'
=>
$doc_type_id
,
'type'
=>
$this
->
_extractDocTypeType
(
$doc_type_id
),
'format'
=>
''
];
}
return
[
Class_IntProfilDonnees
::
PROFILE_DOC_TYPES
=>
$doc_types_prefs
,
Class_IntProfilDonnees
::
FIELD_ITEM_BARCODE
=>
'f'
,
Class_IntProfilDonnees
::
FIELD_ITEM_COTE
=>
''
,
Class_IntProfilDonnees
::
FIELD_ITEM_TYPE_DOC
=>
''
,
Class_IntProfilDonnees
::
FIELD_ITEM_GENRE
=>
''
,
Class_IntProfilDonnees
::
FIELD_ITEM_SECTION
=>
''
,
Class_IntProfilDonnees
::
FIELD_ITEM_EMPLACEMENT
=>
''
,
Class_IntProfilDonnees
::
FIELD_ITEM_ANNEXE
=>
''
,
Class_IntProfilDonnees
::
FIELD_ITEM_AVAILABILITY
=>
''
,
Class_IntProfilDonnees
::
FIELD_ITEM_URL
=>
[
'zone'
=>
'995'
,
'champ'
=>
'u'
]];
}
}
library/Class/WebService/OAI/DublinCoreParser/Numel.php
0 → 100644
View file @
09422c8d
<?php
/**
* Copyright (c) 2019, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class
Class_WebService_OAI_DublinCoreParser_Numel
extends
Class_WebService_OAI_DublinCoreParser
{
protected
$_current_type
,
$_current_relation_type
;
public
function
endIdentifier
(
$data
)
{
if
(
!
$this
->
parser
->
getParent
()
==
'header'
)
return
;
$this
->
_record
[
'id_oai'
]
=
$data
;
}
public
function
enddcterms_identifier
(
$data
)
{
$this
->
_record
[
'url'
]
=
trim
(
$data
);
}
public
function
enddcterms_title
(
$data
)
{
$this
->
enddc_title
(
trim
(
$data
));
}
public
function
enddcterms_langage
(
$data
)
{
$this
->
enddc_language
(
'Fre'
);
}