Changeset 3546 for cats/ISOcat
- Timestamp:
- 09/10/13 12:06:47 (11 years ago)
- Location:
- cats/ISOcat/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cats/ISOcat/trunk/mod-ISOcat-access-data/dbms/ISOcat-schema-views.sql
r2029 r3546 457 457 FROM 458 458 ( 459 ( -- the owner with access rights 460 SELECT 461 id AS dcs, 462 "owner" AS account, 463 'rud'::access_rights_enum AS rights, 464 NULL AS propagate, 465 'owner' AS "type" 466 FROM 467 core_data_category_selection 468 ) 469 UNION 459 470 ( -- all users with access rights 460 471 SELECT … … 512 523 AS SELECT access.dc, access.account, access.type, max(access.rights) AS rights 513 524 FROM ( 525 ( 526 SELECT id AS dc,"owner" AS account, 'ru'::access_rights_enum AS rights, 'owner' AS type 527 FROM core_data_category 528 ) 529 UNION 514 530 ( -- user/group access rights directly on the DC 515 531 ( … … 543 559 ; 544 560 561 545 562 CREATE OR REPLACE VIEW 546 563 view_link_dcs_access -
cats/ISOcat/trunk/mod-ISOcat-access-data/dbx/DCIF.xml
r3458 r3546 554 554 <dbx:where field="text_type" value="note" type="string"/> 555 555 <dbx:sort field="id"/> 556 <dcif:note isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-36" >556 <dcif:note isocat:id="{$current/id}" dbx:field="text" dcr:datcat="http://www.isocat.org/datcat/DC-36" dbx:when="normalize-space(.)!=''"> 557 557 <dbx:attribute name="xml:lang" select="$core_language//row[id=$current/language]/tag"/> 558 558 <dbx:attribute name="isocat:direction" select="$core_language//row[id=$current/language]/direction"/> -
cats/ISOcat/trunk/mod-ISOcat-access-data/schemas/DCIF-1_3.rng
r3543 r3546 308 308 </optional> 309 309 <data type="string"> 310 <param name="pattern">.*[\S].*</param> 310 <xrng:strict> 311 <param name="pattern">.*[\S].*</param> 312 </xrng:strict> 311 313 </data> 312 314 </element> … … 328 330 </attribute> 329 331 </optional> 330 <data type="string"/> 332 <data type="string"/> 331 333 </element> 332 334 </interleave> … … 390 392 <ref name="anyAttributes"/> 391 393 <data type="string"> 392 <param name="pattern">.*[\S].*</param> 394 <xrng:strict> 395 <param name="pattern">.*[\S].*</param> 396 </xrng:strict> 393 397 </data> 394 398 </element> -
cats/ISOcat/trunk/mod-ISOcat-manage-system/manage/import-batch.acc
r2906 r3546 498 498 <xsl:apply-templates select="node()"/> 499 499 <xsl:choose> 500 <xsl:when test="exists(dcif:lastChange )">500 <xsl:when test="exists(dcif:lastChange[normalize-space(@isocat:id)=''])"> 501 501 <isocat:change> 502 502 <xsl:value-of select="dcif:lastChange/dcif:changeDescription"/> -
cats/ISOcat/trunk/mod-ISOcat-manage-system/manage/import.acc
r3515 r3546 1 <accessor debug=" false" trace="false" deadlock="true">1 <accessor debug="true" trace="false" deadlock="true"> 2 2 <name>/isocat/manage/import</name> 3 3 <descr>Import a DCIF document into the registry</descr> … … 57 57 </source> 58 58 </param> 59 <param> 60 <name>validation-mode</name> 61 <descr>validation mode</descr> 62 <type canonical="true">string</type> 63 <source> 64 <nvp/> 65 <default> 66 <string>strict</string> 67 </default> 68 </source> 69 </param> 70 <param> 71 <name>shared</name> 72 <descr>also update shared DCs</descr> 73 <type canonical="true">string</type> 74 <source> 75 <nvp/> 76 <default> 77 <string>false</string> 78 </default> 79 </source> 80 </param> 59 81 <params/> 60 82 <idoc> … … 271 293 <target>var:loc</target> 272 294 </instr> 273 <instr> 274 <type>validateRNG</type> 275 <operand>curi:var:loc</operand> 276 <operator>active:ISOcat.access.data.dcif.schema</operator> 277 <target>var:valid</target> 278 </instr> 295 <if> 296 <cond> 297 <instr> 298 <type>sloot.xpath2eval</type> 299 <operand>var:validation-mode</operand> 300 <operator> 301 <xpath>.='lax'</xpath> 302 </operator> 303 <target>this:cond</target> 304 </instr> 305 </cond> 306 <then> 307 <instr> 308 <type>validateRNG</type> 309 <operand>curi:var:loc</operand> 310 <operator>active:ISOcat.access.data.dcif.schema.lax</operator> 311 <target>var:valid</target> 312 </instr> 313 </then> 314 <else> 315 <instr> 316 <type>validateRNG</type> 317 <operand>curi:var:loc</operand> 318 <operator>active:ISOcat.access.data.dcif.schema</operator> 319 <target>var:valid</target> 320 </instr> 321 </else> 322 </if> 279 323 <!-- dump the validation result --> 280 324 <instr> … … 298 342 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> 299 343 <xsl:param name="valid"/> 344 <xsl:param name="validation-mode"/> 300 345 <xsl:template match="@*|node()"> 301 346 <xsl:copy> … … 305 350 <xsl:template match="valid"> 306 351 <xsl:copy> 352 <xsl:choose> 353 <xsl:when test="$validation-mode='lax'"> 354 <xsl:attribute name="mode" select="'lax'"/> 355 </xsl:when> 356 <xsl:otherwise> 357 <xsl:attribute name="mode" select="'strict'"/> 358 </xsl:otherwise> 359 </xsl:choose> 307 360 <xsl:copy-of select="$valid"/> 308 361 </xsl:copy> … … 311 364 </operator> 312 365 <valid>var:valid</valid> 366 <validation-mode>var:validation-mode</validation-mode> 313 367 <target>var:status</target> 314 368 </instr> … … 332 386 <operand>var:action</operand> 333 387 <operator> 334 <xpath>.= 'check'</xpath>388 <xpath>.=('check','forced check')</xpath> 335 389 </operator> 336 390 <target>this:cond</target> … … 356 410 exclude-result-prefixes="dcif" 357 411 > 412 <xsl:param name="status"/> 413 <xsl:param name="shared"/> 358 414 <xsl:template match="text()"/> 359 415 <xsl:template match="/dcif:dataCategorySelection"> … … 380 436 --THEN 'update' 381 437 --ELSE 'revision' 382 ELSE 'update' 438 WHEN owner_id = <xsl:value-of select="$status//owner//id"/> 439 THEN 'update' 440 WHEN rights::text LIKE '%u%' 441 THEN 'update' 442 ELSE 'select' 383 443 END AS action 384 444 FROM … … 388 448 ON 389 449 view_data_category.pid = DCIFimport.pid 450 LEFT JOIN 451 view_dc_access 452 ON 453 view_dc_access.dc = view_data_category.id 454 AND 455 view_dc_access.account = <xsl:value-of select="$status//owner//id"/> 456 AND 457 view_dc_access."type" = '<xsl:value-of select="if ($shared='true') then ('user') else ('owner')"/>' 390 458 ORDER BY tpe DESC 391 459 ; … … 413 481 </xsl:stylesheet> 414 482 </operator> 483 <status>var:status</status> 484 <shared>var:shared</shared> 415 485 <target>var:sql</target> 416 486 </instr> … … 564 634 <operator> 565 635 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> 636 <xsl:param name="action"/> 566 637 <xsl:param name="check"/> 638 <xsl:param name="shared"/> 567 639 <xsl:template match="@*|node()"> 568 640 <xsl:copy> … … 572 644 <xsl:template match="check"> 573 645 <xsl:copy> 646 <xsl:choose> 647 <xsl:when test="$action='forced check'"> 648 <xsl:attribute name="forced" select="'true'"/> 649 </xsl:when> 650 <xsl:otherwise> 651 <xsl:attribute name="forced" select="'false'"/> 652 </xsl:otherwise> 653 </xsl:choose> 654 <xsl:attribute name="shared" select="$shared"/> 574 655 <xsl:copy-of select="$check"/> 575 656 </xsl:copy> … … 577 658 </xsl:stylesheet> 578 659 </operator> 660 <action>var:action</action> 579 661 <check>var:check</check> 662 <shared>var:shared</shared> 580 663 <target>var:status</target> 581 664 </instr> … … 951 1034 <xsl:choose> 952 1035 <xsl:when test="$valid"> 953 <xsl:text>valid</xsl:text> 1036 <xsl:text>valid (</xsl:text> 1037 <xsl:value-of select="valid/@mode"/> 1038 <xsl:text>)</xsl:text> 954 1039 </xsl:when> 955 1040 <xsl:when test="valid/b/(text())[1]='f'"> 956 <b>invalid</b> 1041 <b> 1042 <xsl:text>invalid (</xsl:text> 1043 <xsl:value-of select="valid/@mode"/> 1044 <xsl:text>)</xsl:text> 1045 </b> 957 1046 <!-- show warnings/errors --> 958 1047 <div> … … 993 1082 </td> 994 1083 <td valign="top"> 995 <button type="submit" name="action" value="validate">validate DCIF</button> 1084 <button type="submit" name="action" value="validate"> 1085 <xsl:if test="not($owned)"> 1086 <xsl:attribute name="disabled" select="'disabled'"/> 1087 </xsl:if> 1088 <xsl:text>validate DCIF</xsl:text> 1089 </button> 1090 <input type="checkbox" name="validation-mode" value="lax"> 1091 <xsl:if test="not($owned)"> 1092 <xsl:attribute name="disabled" select="'disabled'"/> 1093 </xsl:if> 1094 <xsl:if test="valid/@mode='lax'"> 1095 <xsl:attribute name="checked" select="'checked'"/> 1096 </xsl:if> 1097 </input> 1098 <xsl:text> </xsl:text> 1099 <span>lax</span> 996 1100 </td> 997 1101 </tr> 998 1102 <tr> 999 <td valign="top">Check </td> 1103 <td valign="top"> 1104 <xsl:text>Check</xsl:text> 1105 <xsl:if test="check/@forced='true'"> 1106 <xsl:text> (forced)</xsl:text> 1107 </xsl:if> 1108 </td> 1000 1109 <td> 1001 1110 <xsl:choose> … … 1019 1128 </td> 1020 1129 <td valign="top"> 1021 <button type="submit" name="action" value="check"> 1022 <xsl:if test="not($owned) or not($valid)"> 1130 <button type="submit" name="action"> 1131 <xsl:choose> 1132 <xsl:when test="not($owned) or normalize-space(valid)=''"> 1133 <xsl:attribute name="value" select="'check'"/> 1134 <xsl:attribute name="disabled" select="'disabled'"/> 1135 <xsl:text>check actions</xsl:text> 1136 </xsl:when> 1137 <xsl:when test="valid/b/(text())[1]='f'"> 1138 <xsl:attribute name="value" select="'forced check'"/> 1139 <xsl:text>check actions (forced)</xsl:text> 1140 </xsl:when> 1141 <xsl:otherwise> 1142 <xsl:attribute name="value" select="'check'"/> 1143 <xsl:text>check actions</xsl:text> 1144 </xsl:otherwise> 1145 </xsl:choose> 1146 </button> 1147 <input type="checkbox" name="shared" value="true"> 1148 <xsl:if test="not($owned) or normalize-space(valid)=''"> 1023 1149 <xsl:attribute name="disabled" select="'disabled'"/> 1024 1150 </xsl:if> 1025 <xsl:text>check actions</xsl:text> 1026 </button> 1151 <xsl:if test="check/@shared='true'"> 1152 <xsl:attribute name="checked" select="'checked'"/> 1153 </xsl:if> 1154 </input> 1155 <xsl:text> </xsl:text> 1156 <span>update shared DCs</span> 1027 1157 </td> 1028 1158 </tr>
Note: See TracChangeset
for help on using the changeset viewer.