Changeset 38431
- Timestamp:
- 2023-11-25T19:06:30+13:00 (6 months ago)
- Location:
- main/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cgiactions/modmetadataaction.pm
r38395 r38431 83 83 "set-metadata-array" => { 84 84 'compulsory-args' => [ "where", "json" ], 85 'optional-args' => [ ],85 'optional-args' => [ "metamode" ], 86 86 'help-string' => [ 87 87 'A simple example: metadata-server.pl?a=set-metadata-array&where=archives|index|import&c=demo&json=[{"docid":"HASHc5bce2d6d3e5b04e470ec9","metaname":"Title","metavalue":"Tralalala","metamode":"accumulate"},{"docid":"HASHbe483fa4df4e096335d1c8","metaname":"Title","metavalue":"Lala was here","metapos":0, "metamode":"override"}]', … … 97 97 "set-archives-metadata-array" => { 98 98 'compulsory-args' => [ "json" ], 99 'optional-args' => [ ] },99 'optional-args' => [ "metamode" ] }, 100 100 101 101 "set-import-metadata-array" => { 102 102 'compulsory-args' => [ "json" ], 103 'optional-args' => [ ] },103 'optional-args' => [ "metamode" ] }, 104 104 105 105 "set-index-metadata-array" => { 106 106 'compulsory-args' => [ "json" ], 107 'optional-args' => [ ] },107 'optional-args' => [ "metamode" ] }, 108 108 109 109 "set-live-metadata-array" => { -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java
r38338 r38431 907 907 908 908 constructor.setQueryString(querystring.toString()); 909 //logger.info("@@@@ perl querystring: " + querystring.toString()); 909 910 } 910 911 … … 1176 1177 } 1177 1178 } 1179 } else { 1180 // can also have set-metadatat-array without metatable field, like 1181 // json=[{"docid":"HASHc5bce2d6d3e5b04e470ec9","metaname":"Title","metavalue":"Tralalala","metamode":"accumulate"},{"docid":"HASHbe483fa4df4e096335d1c8","metaname":"Title","metavalue":"Lala was here","metapos":0, "metamode":"override"}] 1182 // though we use the metatable way for setting user comments meta. 1183 // The alternative way is described as example usage in perllib/cgiactions/modmetadataaction.pm 1184 // and also the way it's already coded up there, so we need to allow it here. 1185 docids[index] = docInfo.getString("docid"); 1186 String metaname = docInfo.getString("metaname"); 1187 if(!isAllowedToModifyMeta(metaname, filterFields)) { 1188 return null; 1189 } 1178 1190 } 1179 1191 } … … 1187 1199 // meaning that the setmeta operation was a valid user comment operation. 1188 1200 // In that case, we have a docid for which we need to add a user comment 1189 // set-metadata-array can take more docids, but doesn't happen for a user comment. And one comment 1190 // is added at a time, but 3 meta fields are set for each comment: username, usercomment and timestamp 1191 // hence the use of set-meta-array. 1201 // set-metadata-array can take more docids, but that doesn't happen when creating a user 1202 // comment (though it now happens when editing existing user comments). And one comment is 1203 // added at a time, but 3 meta fields are set for each comment: username, usercomment and 1204 // timestamp, hence the use of set-meta-array. 1192 1205 return docids; 1193 1206 -
main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts_usercomments.js
r38426 r38431 68 68 docArray.push({ 69 69 docid:docid, 70 metatable:metatable, 71 metamode:"override" 70 metatable:metatable/*, 71 metamode:"override"*/ // metamode set universally to override in 72 // documentedit_scripts_util.js::processChangesLoop when change.type=editUserComments 72 73 }); 73 74 }
Note:
See TracChangeset
for help on using the changeset viewer.