Changeset 5845 for cats


Ignore:
Timestamp:
11/24/14 08:35:54 (9 years ago)
Author:
Menzo Windhouwer
Message:

M mod-ISOcat-manage-system/manage/dump.acc

  • fix the HTML
  • dump also the guest workspace
  • dump only public groups and DCSs

M mod-ISOcat-interface-rest/representations/html/group.xsl
M mod-ISOcat-interface-rest/representations/html/tdg.xsl

  • return xhtml

M mod-ISOcat-control-access/control/validate.acc

  • admin has always access
Location:
cats/ISOcat/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cats/ISOcat/trunk/mod-ISOcat-control-access/control/validate.acc

    r2029 r5845  
    102102                                </instr>
    103103                                <choose>
    104 <!--
     104
    105105                                        <cond>
    106106                                                <instr>
     
    114114                                        </cond>
    115115                                        <then>
    116                                                 <!-X- administrators can do everything -X->
     116                                                <!-- administrators can do everything -->
    117117                                                <instr>
    118118                                                        <type>copy</type>
     
    123123                                                </instr>
    124124                                        </then>
    125 -->
     125
    126126                                        <cond>
    127127                                                <instr>
  • cats/ISOcat/trunk/mod-ISOcat-interface-rest/representations/html/group.xsl

    r3040 r5845  
    99  xmlns="http://www.w3.org/1999/xhtml"
    1010>
     11       
     12        <xsl:output method="xml" encoding="UTF-8"/>
    1113
    1214        <xsl:param name="title" select="'default'"/>
  • cats/ISOcat/trunk/mod-ISOcat-interface-rest/representations/html/tdg.xsl

    r3040 r5845  
    88  xmlns:dcif="http://www.isocat.org/ns/dcif"
    99>
     10       
     11        <xsl:output method="xml" encoding="UTF-8"/>
    1012
    1113        <xsl:param name="title" select="'default'"/>
  • cats/ISOcat/trunk/mod-ISOcat-manage-system/manage/dump.acc

    r5786 r5845  
    8282                    FROM
    8383                        core_data_category
    84                     --LIMIT 1
    8584                    ;
    8685                </sql>
     
    9493                            {
    9594                                for $id in $dcs//row/id return
    96                                     for $ext in ('.dcif','.html','.rdf') return
     95                                    for $ext in ('.dcif','.rdf','/context.html','/context.xml','/history.xml','/history.html','/history.atom') return
    9796                    <instr>
    9897                        <type>copy</type>
     
    105104                                <instr>
    106105                                        <type>xslt2</type>
    107                                         <operand>ffcpl:/isocat/rest/dc/{string($id)}.dcif+dcif-cleanup@data:text/plain,false+method@data:text/plain,GET</operand>
     106                                        <operand>ffcpl:/isocat/rest/dc/{string($id)}.html+method@data:text/plain,GET</operand>
    108107                                        <operator>
    109108                                                <xsl:stylesheet
    110109                                                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    111                                                         version="2.0">
     110                                                        version="2.0"
     111                                                        xpath-default-namespace="http://www.w3.org/1999/xhtml"
     112                                                        xmlns="http://www.w3.org/1999/xhtml">
    112113                                                        <xsl:output method="xml" encoding="utf-8"/>
    113114                                                       
     
    118119                                                        </xsl:template>
    119120                                                       
    120                                                         <xsl:template match="/html/head/link/@href" priority="1">
    121                                                                 <xsl:copy>
    122                                                                         <xsl:value-of select="replace(.,'.*/interface/','/interface/')"/>
    123                                                                 </xsl:copy>
    124                                                         </xsl:template>
    125 
    126                                                         <xsl:template match="/html/head/script/@src" priority="1">
    127                                                                 <xsl:copy>
    128                                                                         <xsl:value-of select="replace(.,'.*/interface/','/interface/')"/>
    129                                                                 </xsl:copy>
     121                                                        <xsl:template match="@href" priority="1">
     122                                                                <xsl:attribute name="href">
     123                                                                        <xsl:choose>
     124                                                                                <xsl:when test="matches(.,'.^*/interface/.*$')">
     125                                                                                        <xsl:value-of select="replace(.,'^.*(/interface/.*)$','$1')"/>
     126                                                                                </xsl:when>
     127                                                                                <xsl:otherwise>
     128                                                                                        <xsl:value-of select="."/>
     129                                                                                </xsl:otherwise>
     130                                                                        </xsl:choose>
     131                                                                </xsl:attribute>
    130132                                                        </xsl:template>
    131133                                                       
     134                                                        <xsl:template match="@src" priority="1">
     135                                                                <xsl:attribute name="src">
     136                                                                        <xsl:choose>
     137                                                                                <xsl:when test="matches(.,'.^*/interface/.*$')">
     138                                                                                        <xsl:value-of select="replace(.,'^.*(/interface/.*)$','$1')"/>
     139                                                                                </xsl:when>
     140                                                                                <xsl:otherwise>
     141                                                                                        <xsl:value-of select="."/>
     142                                                                                </xsl:otherwise>
     143                                                                        </xsl:choose>
     144                                                                </xsl:attribute>
     145                                                        </xsl:template>
     146                                                       
     147                                                        <xsl:template match="tr[td='View']"/>
     148                                                       
     149                                                        <xsl:template match="a[@target='forum']" priority="1">
     150                                                                <span>
     151                                                                        <xsl:value-of select="."/>
     152                                                                </span>
     153                                                        </xsl:template>
    132154                                                </xsl:stylesheet>
    133                                                
    134155                                        </operator>
    135156                                        <target>file://{string($dir)}/rest/dc/{string($id)}.html</target>
     
    180201                                FROM
    181202                                        core_data_category_selection
    182                                 --LIMIT 1
     203                                WHERE
     204                                        private = false
    183205                                ;
    184206                        </sql>
     
    222244                        <sql>
    223245                                SELECT
    224                                 id
     246                                        id
    225247                                FROM
    226                                 core_profile
    227                                 --LIMIT 1
     248                                        core_profile
    228249                                ;
    229250                        </sql>
     
    248269                <dir>var:dir</dir>
    249270                <profs>var:profs</profs>
     271                <target>var:dpml</target>
     272        </instr>
     273        <accessor-debug>
     274                <instr>
     275                        <type>log</type>
     276                        <operand>var:dpml</operand>
     277                </instr>
     278        </accessor-debug>
     279        <instr>
     280                <type>dpml</type>
     281                <operand>var:dpml</operand>
     282                <target>var:void</target>
     283        </instr>
     284        <!-- Thematic Domain Groups -->
     285        <instr>
     286                <type>ISOcat.access.data.query</type>
     287                <query>
     288                        <sql>
     289                                SELECT
     290                                        id
     291                                FROM
     292                                        core_thematic_domain_group
     293                                ;
     294                        </sql>
     295                </query>
     296                <target>var:tdgs</target>
     297        </instr>
     298        <instr>
     299                <type>sloot.xquery</type>
     300                <operator>
     301                        <idoc>
     302                                {
     303                                        for $id in $tdgs//row/id return
     304                                <instr>
     305                                        <type>copy</type>
     306                                        <operand>ffcpl:/isocat/rest/tdg/{string($id)}.xml+method@data:text/plain,GET</operand>
     307                                        <target>file://{string($dir)}/rest/tdg/{string($id)}.xml</target>
     308                                </instr>
     309                                }
     310                                {
     311                                for $id in $tdgs//row/id return
     312                                <instr>
     313                                        <type>xslt2</type>
     314                                        <operand>ffcpl:/isocat/rest/tdg/{string($id)}.html+method@data:text/plain,GET</operand>
     315                                        <operator>
     316                                                <xsl:stylesheet
     317                                                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     318                                                        version="2.0"
     319                                                        xpath-default-namespace="http://www.w3.org/1999/xhtml"
     320                                                        xmlns="http://www.w3.org/1999/xhtml">
     321                                                        <xsl:output method="xml" encoding="utf-8"/>
     322                                                       
     323                                                        <xsl:template match="@*|node()">
     324                                                                <xsl:copy>
     325                                                                        <xsl:apply-templates select="@*|node()"/>
     326                                                                </xsl:copy>
     327                                                        </xsl:template>
     328                                                       
     329                                                        <xsl:template match="@href" priority="1">
     330                                                                <xsl:attribute name="href">
     331                                                                        <xsl:choose>
     332                                                                                <xsl:when test="matches(.,'.^*/interface/.*$')">
     333                                                                                        <xsl:value-of select="replace(.,'^.*(/interface/.*)$','$1')"/>
     334                                                                                </xsl:when>
     335                                                                                <xsl:otherwise>
     336                                                                                        <xsl:value-of select="."/>
     337                                                                                </xsl:otherwise>
     338                                                                        </xsl:choose>
     339                                                                </xsl:attribute>
     340                                                        </xsl:template>
     341                                                       
     342                                                        <xsl:template match="@src" priority="1">
     343                                                                <xsl:attribute name="src">
     344                                                                        <xsl:choose>
     345                                                                                <xsl:when test="matches(.,'.^*/interface/.*$')">
     346                                                                                        <xsl:value-of select="replace(.,'^.*(/interface/.*)$','$1')"/>
     347                                                                                </xsl:when>
     348                                                                                <xsl:otherwise>
     349                                                                                        <xsl:value-of select="."/>
     350                                                                                </xsl:otherwise>
     351                                                                        </xsl:choose>
     352                                                                </xsl:attribute>
     353                                                        </xsl:template>
     354                                                       
     355                                                        <xsl:template match="tr[td='View']"/>
     356                                                       
     357                                                        <xsl:template match="a[@target='forum']" priority="1">
     358                                                                <span>
     359                                                                        <xsl:value-of select="."/>
     360                                                                </span>
     361                                                        </xsl:template>
     362                                                </xsl:stylesheet>
     363                                        </operator>
     364                                        <target>file://{string($dir)}/rest/tdg/{string($id)}.html</target>
     365                                </instr>
     366                                }
     367                               
     368                        </idoc>
     369                </operator>
     370                <dir>var:dir</dir>
     371                <tdgs>var:tdgs</tdgs>
     372                <target>var:dpml</target>
     373        </instr>
     374        <accessor-debug>
     375                <instr>
     376                        <type>log</type>
     377                        <operand>var:dpml</operand>
     378                </instr>
     379        </accessor-debug>
     380        <instr>
     381                <type>dpml</type>
     382                <operand>var:dpml</operand>
     383                <target>var:void</target>
     384        </instr>
     385        <!-- Groups -->
     386        <instr>
     387                <type>ISOcat.access.data.query</type>
     388                <query>
     389                        <sql>
     390                                SELECT DISTINCT
     391                                        core_adhoc_group.id AS id
     392                                FROM
     393                                        core_adhoc_group
     394                                JOIN
     395                                        link_dcs_access
     396                                ON
     397                                        link_dcs_access.account = core_adhoc_group.id
     398                                JOIN
     399                                        core_data_category_selection
     400                                ON
     401                                        core_data_category_selection.id = link_dcs_access.dcs
     402                                WHERE
     403                                        core_data_category_selection.private = false
     404                                ;
     405                        </sql>
     406                </query>
     407                <target>var:grps</target>
     408        </instr>
     409        <instr>
     410                <type>sloot.xquery</type>
     411                <operator>
     412                        <idoc>
     413                                {
     414                                        for $id in $grps//row/id return
     415                                <instr>
     416                                        <type>copy</type>
     417                                        <operand>ffcpl:/isocat/rest/group/{string($id)}.xml+method@data:text/plain,GET</operand>
     418                                        <target>file://{string($dir)}/rest/group/{string($id)}.xml</target>
     419                                </instr>
     420                                }
     421                                {
     422                                                for $id in $grps//row/id return
     423                                <instr>
     424                                        <type>xslt2</type>
     425                                        <operand>ffcpl:/isocat/rest/group/{string($id)}.html+method@data:text/plain,GET</operand>
     426                                        <operator>
     427                                                <xsl:stylesheet
     428                                                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     429                                                        version="2.0"
     430                                                        xpath-default-namespace="http://www.w3.org/1999/xhtml"
     431                                                        xmlns="http://www.w3.org/1999/xhtml">
     432                                                        <xsl:output method="xml" encoding="utf-8"/>
     433                                                       
     434                                                        <xsl:template match="@*|node()">
     435                                                                <xsl:copy>
     436                                                                        <xsl:apply-templates select="@*|node()"/>
     437                                                                </xsl:copy>
     438                                                        </xsl:template>
     439                                                       
     440                                                        <xsl:template match="@href" priority="1">
     441                                                                <xsl:attribute name="href">
     442                                                                        <xsl:choose>
     443                                                                                <xsl:when test="matches(.,'.^*/interface/.*$')">
     444                                                                                        <xsl:value-of select="replace(.,'^.*(/interface/.*)$','$1')"/>
     445                                                                                </xsl:when>
     446                                                                                <xsl:otherwise>
     447                                                                                        <xsl:value-of select="."/>
     448                                                                                </xsl:otherwise>
     449                                                                        </xsl:choose>
     450                                                                </xsl:attribute>
     451                                                        </xsl:template>
     452
     453                                                        <xsl:template match="@src" priority="1">
     454                                                                <xsl:attribute name="src">
     455                                                                        <xsl:choose>
     456                                                                                <xsl:when test="matches(.,'.^*/interface/.*$')">
     457                                                                                        <xsl:value-of select="replace(.,'^.*(/interface/.*)$','$1')"/>
     458                                                                                </xsl:when>
     459                                                                                <xsl:otherwise>
     460                                                                                        <xsl:value-of select="."/>
     461                                                                                </xsl:otherwise>
     462                                                                        </xsl:choose>
     463                                                                </xsl:attribute>
     464                                                        </xsl:template>
     465                                                       
     466                                                        <xsl:template match="tr[td='View']"/>
     467                                                       
     468                                                        <xsl:template match="a[@target='forum']" priority="1">
     469                                                                <span>
     470                                                                        <xsl:value-of select="."/>
     471                                                                </span>
     472                                                        </xsl:template>
     473                                                </xsl:stylesheet>
     474                                        </operator>
     475                                        <target>file://{string($dir)}/rest/group/{string($id)}.html</target>
     476                                </instr>
     477                                }
     478                        </idoc>
     479                </operator>
     480                <dir>var:dir</dir>
     481                <grps>var:grps</grps>
     482                <target>var:dpml</target>
     483        </instr>
     484        <accessor-debug>
     485                <instr>
     486                        <type>log</type>
     487                        <operand>var:dpml</operand>
     488                </instr>
     489        </accessor-debug>
     490        <instr>
     491                <type>dpml</type>
     492                <operand>var:dpml</operand>
     493                <target>var:void</target>
     494        </instr>
     495        <!-- Guest workspace -->
     496        <instr>
     497                <type>sloot.xquery</type>
     498                <operator>
     499                        <idoc>
     500                                {
     501                                        for $ext in ('.html','.xml') return
     502                                <instr>
     503                                        <type>copy</type>
     504                                        <operand>ffcpl:/rest/user/guest/workspace{$ext}</operand>
     505                                        <target>file://{string($dir)}/rest/user/guest/workspace{$ext}</target>
     506                                </instr>
     507                                }
     508                        </idoc>
     509                </operator>
     510                <dir>var:dir</dir>
    250511                <target>var:dpml</target>
    251512        </instr>
     
    305566        </instr>
    306567    </idoc>
    307     <response>
    308         <mime>text/html</mime>
    309     </response>
     568        <exception>
     569                <debug/>
     570                <trace>ffcpl:/trace/dump.exception.xml</trace>
     571                <throw/>
     572        </exception>
     573        <response>
     574                <debug>ffcpl:/trace/dump.response.xml</debug>
     575                <mime>text/html</mime>
     576        </response>
    310577</accessor>
Note: See TracChangeset for help on using the changeset viewer.