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
limbra
limbra
Commits
7c8fd1f4
Commit
7c8fd1f4
authored
Sep 02, 2016
by
LE GAC Renaud
Browse files
Rename the table affiliation_rules as affiliation_keys.
parent
92abcd5a
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
56 additions
and
52 deletions
+56
-52
controllers/wizards.py
controllers/wizards.py
+15
-14
docs/db_schema/database.png
docs/db_schema/database.png
+0
-0
docs/db_schema/database.xml
docs/db_schema/database.xml
+3
-3
languages/fr-fr.py
languages/fr-fr.py
+6
-2
models/db0_affiliation_keys.py
models/db0_affiliation_keys.py
+9
-0
models/db0_affiliation_rules.py
models/db0_affiliation_rules.py
+0
-9
models/ui_affiliation_keys.py
models/ui_affiliation_keys.py
+6
-6
models/widgets_viewport.py
models/widgets_viewport.py
+1
-1
static/app.js
static/app.js
+1
-1
static/limbra/locale/limbra-lang-fr.js
static/limbra/locale/limbra-lang-fr.js
+7
-8
static/limbra/src/grid/plugin/AffiliationKeysContextMenu.js
static/limbra/src/grid/plugin/AffiliationKeysContextMenu.js
+8
-8
No files found.
controllers/wizards.py
View file @
7c8fd1f4
...
...
@@ -24,7 +24,7 @@ MSG_NO_AUTHORS = "<br><br>Removing affiliation failed.<br>"\
def
affiliation_institute
():
"""
Build
affiliation
rule form
the institute database.
"""
Determine
affiliation
keys using
the institute database.
"""
# shortcuts
...
...
@@ -36,20 +36,20 @@ def affiliation_institute():
raise
HTTP
(
500
,
"Record not found!"
)
# extract keys defining the affiliation
rule
_1
=
dict
(
u
=
record
[
u
"110"
][
"u"
],
v
=
""
)
rule
_2
=
dict
(
u
=
record
[
u
"110"
][
"t"
],
v
=
""
)
key
_1
=
dict
(
key_
u
=
record
[
u
"110"
][
"u"
],
key_
v
=
""
)
key
_2
=
dict
(
key_
u
=
record
[
u
"110"
][
"t"
],
key_
v
=
""
)
# check that the rules does not exist
# load new rules
for
rule
in
(
rule_1
,
rule
_2
):
if
get_id
(
db
.
affiliation_
rule
s
,
**
rule
)
is
None
:
db
.
affiliation_
rule
s
[
0
]
=
rule
for
key
in
(
key_1
,
key
_2
):
if
get_id
(
db
.
affiliation_
key
s
,
**
key
)
is
None
:
db
.
affiliation_
key
s
[
0
]
=
key
return
def
affiliation_publication
():
"""
Build
affiliation
rule form
a given publication.
"""
Determine
affiliation
keys using
a given publication.
"""
# shortcuts
...
...
@@ -67,27 +67,28 @@ def affiliation_publication():
# find the author
pattern
=
"^%s, %s$"
%
(
family_name
.
strip
(),
first_name
.
strip
())
reg
=
re
.
compile
(
pattern
,
re
.
IGNORECASE
)
rule
=
None
key
=
None
if
"700"
in
record
and
isinstance
(
record
[
u
"700"
],
list
):
for
di
in
record
[
u
"700"
]:
author
=
di
[
"a"
]
if
reg
.
match
(
author
):
rule
=
dict
(
u
=
di
[
"u"
])
if
"v"
in
di
:
rule
[
"v"
]
=
di
[
"v"
]
key
=
dict
(
key_u
=
di
[
"u"
],
key_v
=
di
[
"v"
])
else
:
key
=
dict
(
key_u
=
di
[
"u"
],
key_v
=
""
)
break
if
rule
is
None
:
if
key
is
None
:
raise
HTTP
(
500
,
"Author not found!"
)
# check that the rules does not exist
# load new rules
if
get_id
(
db
.
affiliation_
rule
s
,
**
rule
)
is
None
:
db
.
affiliation_
rule
s
[
0
]
=
rule
if
get_id
(
db
.
affiliation_
key
s
,
**
key
)
is
None
:
db
.
affiliation_
key
s
[
0
]
=
key
else
:
raise
HTTP
(
500
,
"
Rule
already exists!"
)
raise
HTTP
(
500
,
"
Keys
already exists!"
)
return
...
...
docs/db_schema/database.png
View replaced file @
92abcd5a
View file @
7c8fd1f4
171 KB
|
W:
|
H:
172 KB
|
W:
|
H:
2-up
Swipe
Onion skin
docs/db_schema/database.xml
View file @
7c8fd1f4
...
...
@@ -549,14 +549,14 @@
<part>
id
</part>
</key>
</table>
<table
x=
"64
2
"
y=
"492"
name=
"affiliation_
rule
s"
>
<table
x=
"64
3
"
y=
"492"
name=
"affiliation_
key
s"
>
<row
name=
"id"
null=
"1"
autoincrement=
"1"
>
<datatype>
integer
</datatype>
<default>
NULL
</default></row>
<row
name=
"u"
null=
"0"
autoincrement=
"0"
>
<row
name=
"
key_
u"
null=
"0"
autoincrement=
"0"
>
<datatype>
string
</datatype>
</row>
<row
name=
"v"
null=
"1"
autoincrement=
"0"
>
<row
name=
"
key_
v"
null=
"1"
autoincrement=
"0"
>
<datatype>
string
</datatype>
<default>
NULL
</default></row>
<key
type=
"PRIMARY"
name=
""
>
...
...
languages/fr-fr.py
View file @
7c8fd1f4
...
...
@@ -25,8 +25,9 @@
'Address of the invenio store where the search is performed.'
:
'Addresse du site invenio où les recherches sont effectuées.'
,
'administrators, librairians,...'
:
'administrateurs, documentalistes,...'
,
'Affiliation'
:
'Affiliation'
,
'affiliation rules'
:
"régles définissant l'affiliation"
,
'affiliation_rules'
:
"régles définissant l'affiliation"
,
'affiliation keys'
:
"clés définissant l'affiliation"
,
'affiliation_keys'
:
"clés définissant l'affiliation"
,
'affiliation_rules'
:
'affiliation_rules'
,
'Agencies'
:
'Agences'
,
'agencies'
:
'agences'
,
'agency'
:
'agence'
,
...
...
@@ -232,6 +233,7 @@
'Fill'
:
'Remplir'
,
'Fill all fields'
:
'Remplir tous les champs'
,
'Filter'
:
'Filtrer'
,
'Filter affiliation_keys'
:
'Filter affiliation_keys'
,
'Filter affiliation_rules'
:
"Filtrer les régles d'affiliation"
,
'Filter categories'
:
'Filtrer les catégories'
,
'Filter collaborations'
:
'Filtrer les collaborations'
,
...
...
@@ -321,6 +323,8 @@
'ISBN'
:
'ISBN'
,
'ISSN'
:
'ISSN'
,
'Javascript API'
:
'Javascript API'
,
'Key U'
:
'Clé U'
,
'Key V'
:
'Clé V'
,
'Last name'
:
'Last name'
,
'Level'
:
'Niveau'
,
'Level 1'
:
'Niveau 1'
,
...
...
models/db0_affiliation_keys.py
0 → 100644
View file @
7c8fd1f4
# -*- coding: utf-8 -*-
""" affiliation_rules
"""
db
.
define_table
(
"affiliation_keys"
,
Field
(
"key_u"
,
"string"
,
length
=
255
,
notnull
=
True
),
Field
(
"key_v"
,
"string"
,
length
=
255
,
notnull
=
False
),
migrate
=
"affiliation_keys.table"
)
\ No newline at end of file
models/db0_affiliation_rules.py
deleted
100644 → 0
View file @
92abcd5a
# -*- coding: utf-8 -*-
""" affiliation_rules
"""
db
.
define_table
(
"affiliation_rules"
,
Field
(
"u"
,
"string"
,
length
=
255
,
notnull
=
True
),
Field
(
"v"
,
"string"
,
length
=
255
,
notnull
=
False
),
migrate
=
"affiliation_rules.table"
)
\ No newline at end of file
models/ui_affiliation_
rule
s.py
→
models/ui_affiliation_
key
s.py
View file @
7c8fd1f4
...
...
@@ -19,21 +19,21 @@
# GRID CONFIGURATiON
#
#-------------------------------------------------------------------------------
gridModifier
=
dbui
.
GridModifier
(
'affiliation_
rule
s'
)
gridModifier
=
dbui
.
GridModifier
(
'affiliation_
key
s'
)
gridModifier
.
append_filter
((
'u'
,
'contains'
,
T
(
'contains'
)))
gridModifier
.
append_filter
((
'v'
,
'contains'
,
T
(
'contains'
)))
gridModifier
.
append_filter
((
'
key_
u'
,
'contains'
,
T
(
'contains'
)))
gridModifier
.
append_filter
((
'
key_
v'
,
'contains'
,
T
(
'contains'
)))
gridModifier
.
configure_filters
(
plugins
=
[
'pFormToolTip'
],
width
=
300
)
gridModifier
.
configure_gridWithFilter
(
selectorTitle
=
T
(
'Filter'
))
gridModifier
.
configure
(
plugins
=
[
'pGridRowEditor'
,
'pGridAffiliation
Rule
sContextMenu'
])
'pGridAffiliation
Key
sContextMenu'
])
#-------------------------------------------------------------------------------
#
# STORE CONFIGURATiON
#
#-------------------------------------------------------------------------------
storeModifier
=
dbui
.
StoreModifier
(
'affiliation_
rule
s'
)
storeModifier
.
orderby
(
db
.
affiliation_
rules
.
u
,
db
.
affiliation_
rules
.
v
)
storeModifier
=
dbui
.
StoreModifier
(
'affiliation_
key
s'
)
storeModifier
.
orderby
(
db
.
affiliation_
keys
.
key_
u
,
db
.
affiliation_
keys
.
key_
v
)
models/widgets_viewport.py
View file @
7c8fd1f4
...
...
@@ -84,7 +84,7 @@ if session.role == ADMIN:
dataInstituteNode
=
None
if
session
.
role
==
ADMIN
:
leaves
=
(
'affiliation_
rule
s'
,
'projects'
,
'teams'
)
leaves
=
(
'affiliation_
key
s'
,
'projects'
,
'teams'
)
dataInstituteNode
=
Node
(
T
(
'Data institute'
))
dataInstituteNode
.
add_children
(
leaves
,
func
=
to_grid
)
...
...
static/app.js
View file @
7c8fd1f4
...
...
@@ -25,7 +25,7 @@ Ext.require('Ext.direct.RemotingProvider');
Ext
.
require
(
'
Ext.EventManager
'
);
Ext
.
require
(
'
Ext.tip.QuickTipManager
'
);
Ext
.
require
(
'
Limbra.grid.plugin.Affiliation
Rule
sContextMenu
'
);
Ext
.
require
(
'
Limbra.grid.plugin.Affiliation
Key
sContextMenu
'
);
Ext
.
require
(
'
Limbra.wizard.Harvester
'
);
Ext
.
onReady
(
function
(){
...
...
static/limbra/locale/limbra-lang-fr.js
View file @
7c8fd1f4
...
...
@@ -2,13 +2,13 @@
* French translation
*
*/
Ext
.
define
(
'
Limbra.local.fr.grid.plugin.Affiliation
Rule
sContextMenu
'
,
{
Ext
.
define
(
'
Limbra.local.fr.grid.plugin.Affiliation
Key
sContextMenu
'
,
{
override
:
'
Limbra.grid.plugin.Affiliation
Rule
sContextMenu
'
,
override
:
'
Limbra.grid.plugin.Affiliation
Key
sContextMenu
'
,
textAddFromInstitute
:
'
Ajouter
une règle
à partir des fiches laboratoire
'
,
textAddFromPublication
:
"
Ajouter
une règle
à partir d'une publication
"
,
textDestroy
:
'
Détruire
une régle
'
textAddFromInstitute
:
'
Ajouter
des clés
à partir des fiches laboratoire
'
,
textAddFromPublication
:
"
Ajouter
des clés
à partir d'une publication
"
,
textDestroy
:
'
Détruire
'
});
...
...
@@ -24,8 +24,7 @@ Ext.define('Limbra.local.fr.wizard.AffiliationFromInstituteDb', {
"
<p>Chaque fiche contient les clés définissant l'affiliation de votre
"
,
"
laboratoire. Elles sont utilisée
"
,
"
dans les entrepôts <i>inspirehep.net</i> et <i>cds.cern.ch</i>.
"
,
"
Cet assistant va trouver ces clés et les charger en tant que
"
,
"
régles.</p>
"
,
"
Cet assistant va trouver ces clés et les charger.</p>
"
,
"
<p>Cliquer sur le boutton <i>suivant</i> ou <i>Précédent</i> pour
"
,
"
changer de page.
"
,
"
A la fin, cliquer sur le boutton <i>Fin</i>.</p>
"
,
...
...
@@ -55,7 +54,7 @@ Ext.define('Limbra.local.fr.wizard.AffiliationFromPublication', {
"
<p>Dans les entrepôts <i>inspirehep.net</i> ou <i>cds.cern.ch</i>
"
,
"
l'affiliation est définie pour chaque auteur et pour chaque
"
,
"
publication.</p>
"
,
"
Cet assistant
c
a trouve
z
les clés définissant l'affiliation de
"
,
"
Cet assistant
v
a trouve
r
les clés définissant l'affiliation de
"
,
"
votre laboratoire en utilisant une publication et un auteur.
"
,
"
Gardez à l'esprit que ces clés
"
,
"
peuvent dépendre de l'entrepôt, de la collection, <i>etc</i>.
"
,
...
...
static/limbra/src/grid/plugin/Affiliation
Rule
sContextMenu.js
→
static/limbra/src/grid/plugin/Affiliation
Key
sContextMenu.js
View file @
7c8fd1f4
/**
* The
plugin instantiating the
context menu for the Affiliation_
rule
s grid.
* The context menu for the Affiliation_
key
s grid.
*
* The menu allows to run the wizard "add
rule
from publication"
* and "add
rule
institute database" as well as to delete any
rule
s.
* The menu allows to run the wizard "add
key
from publication"
* and "add
key
institute database" as well as to delete any
key
s.
*
* @uses Dbui.grid.plugin.RowEditorBase
* @since 0.9.6
*
*/
Ext
.
define
(
'
Limbra.grid.plugin.Affiliation
Rule
sContextMenu
'
,
{
Ext
.
define
(
'
Limbra.grid.plugin.Affiliation
Key
sContextMenu
'
,
{
extend
:
'
Dbui.grid.plugin.ContextMenu
'
,
alias
:
'
plugin.pGridAffiliation
Rule
sContextMenu
'
,
alias
:
'
plugin.pGridAffiliation
Key
sContextMenu
'
,
uses
:
[
'
Ext.window.Window
'
,
'
Limbra.wizard.AffiliationFromInstituteDb
'
,
'
Limbra.wizard.AffiliationFromPublication
'
],
...
...
@@ -21,9 +21,9 @@ Ext.define('Limbra.grid.plugin.AffiliationRulesContextMenu', {
widthFromPublication
:
350
,
// private properties for internationalization
textAddFromInstitute
:
'
Add
one rule
from the institute database
'
,
textAddFromPublication
:
'
Add
one rule
from a given publication
'
,
textDestroy
:
'
Delete
a rule
'
,
textAddFromInstitute
:
'
Add
keys
from the institute database
'
,
textAddFromPublication
:
'
Add
keys
from a given publication
'
,
textDestroy
:
'
Delete
'
,
// jshint strict: false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment