Changeset 6141
- Timestamp:
- 06/02/07 21:57:06 (1 year ago)
- Files:
-
- branches/MidCOM_2_8/midcom.admin.folder/folder_management.php (modified) (2 diffs)
- branches/MidCOM_2_8/midcom.admin.folder/static/folder.css (modified) (2 diffs)
- branches/MidCOM_2_8/midcom.admin.folder/style/midcom-admin-show-component-list.php (modified) (1 diff)
- branches/MidCOM_2_8/midcom.admin.settings/locale/default.en.txt (modified) (1 diff)
- branches/MidCOM_2_8/midcom.core/midcom/core/manifest.php (modified) (2 diffs)
- branches/MidCOM_2_8/midcom.core/midcom/exec/reindex.php (modified) (2 diffs)
- branches/MidCOM_2_8/midcom.core/midcom/helper/hostconfig.php (modified) (1 diff)
- branches/MidCOM_2_8/midcom.core/midcom/services/cache/backend/flatfile.php (modified) (1 diff)
- branches/MidCOM_2_8/midcom.core/midcom/services/dbclassloader.php (modified) (1 diff)
- branches/MidCOM_2_8/midcom.core/midcom/services/indexer.php (modified) (4 diffs)
- branches/MidCOM_2_8/midcom.core/midcom/services/indexer/backend/solr.php (copied) (copied from trunk/midcom/midcom.core/midcom/services/indexer/backend/solr.php)
- branches/MidCOM_2_8/midcom.core/midcom/services/indexer/document.php (modified) (1 diff)
- branches/MidCOM_2_8/midcom.helper.search/config/manifest.inc (modified) (3 diffs)
- branches/MidCOM_2_8/midcom.helper.search/style/advanced_form.php (modified) (1 diff)
- branches/MidCOM_2_8/midcom.helper.search/style/search_form.php (modified) (1 diff)
- branches/MidCOM_2_8/midcom.helper.search/viewer.php (modified) (6 diffs)
- branches/MidCOM_2_8/midgard.webdav.styles/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nehmer.blog/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nehmer.static/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.calendar/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.discussion/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.netmon/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.organizations/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.personnel/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.quickpoll/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.registrations/event.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.updatenotification/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.wiki/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/no.odindata.quickform2/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/org.openpsa.products/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/org.routamc.photostream/viewer.php (modified) (1 diff)
- branches/MidCOM_2_8/scaffold/viewer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.admin.folder/folder_management.php
r5715 r6141 217 217 218 218 // Skip components beginning with midcom or midgard 219 if (ereg('^(midcom|midgard)\.', $manifest->name)) 219 if ( ereg('^(midcom|midgard)\.', $manifest->name) 220 && $manifest->name != 'midcom.helper.search') 220 221 { 221 222 continue; … … 237 238 $description = ''; 238 239 } 239 240 240 241 $components[$manifest->name] = array 241 242 ( 242 'name' => $manifest->get_name_translated(),243 'name' => $manifest->get_name_translated(), 243 244 'description' => $description, 245 'state' => $manifest->state, 246 'version' => $manifest->version, 244 247 ); 245 248 } branches/MidCOM_2_8/midcom.admin.folder/static/folder.css
r5715 r6141 18 18 div.midcom_admin_content_componentlist dl 19 19 { 20 height: 250px;20 height: 300px; 21 21 overflow-x: auto; 22 22 border: 1px #f0f0f0 solid; 23 23 padding: 6px; 24 24 margin-top: 0px; 25 font-size: smaller; 25 26 } 26 27 … … 28 29 { 29 30 margin-bottom: 6px; 31 margin-left: 22px; 32 margin-top: 2px; 33 } 34 35 div.midcom_admin_content_componentlist dl dt.devel, 36 div.midcom_admin_content_componentlist dl dd.devel, 37 div.midcom_admin_content_componentlist dl dt.alpha, 38 div.midcom_admin_content_componentlist dl dd.alpha 39 40 { 41 color: #c0c0c0; 30 42 } 31 43 branches/MidCOM_2_8/midcom.admin.folder/style/midcom-admin-show-component-list.php
r5074 r6141 13 13 } 14 14 ?> 15 <dt ><label><input type="radio" name="f_type" value="&(path:h);"&(selected:h); /><strong>&(information['name']:h);</strong> (&(path:h);)</label></dt>15 <dt class="&(information['state']:h);"><label><input type="radio" name="f_type" value="&(path:h);"&(selected:h); /><strong>&(information['name']:h);</strong> <span class="component">(&(path:h); <span class="version">&(information['version']:h);</span>)</span></label></dt> 16 16 <?php 17 17 if (array_key_exists('description', $information)) 18 18 { 19 19 ?> 20 <dd >&(information['description']:h);</dd>20 <dd class="&(information['state']:h);">&(information['description']:h);</dd> 21 21 <?php 22 22 } branches/MidCOM_2_8/midcom.admin.settings/locale/default.en.txt
r4604 r6141 205 205 206 206 ---STRING midcom_root_topic_guid 207 Root folder207 Root topic 208 208 ---STRINGEND 209 209 branches/MidCOM_2_8/midcom.core/midcom/core/manifest.php
r5535 r6141 233 233 234 234 /** 235 * Old version number of the components, currently specified as integer. Not really 236 * used within the system, but you may (actually should) use it for your own versioning. 237 * 238 * Note, that this is now a string (was formerly an int) since the PEAR transition. This 239 * change should not affect anything as I do not know any component actually making use 240 * of this member yet. You should now use version_compare in context with this member 241 * always. 235 * Version number of the components. 242 236 * 243 237 * @var string 244 238 */ 245 var $version = 0; 239 var $version = '0.0.1'; 240 241 /** 242 * State of the components. 243 * 244 * @var string 245 */ 246 var $state = 'devel'; 246 247 247 248 /** … … 325 326 $this->version = $this->_raw_data['version']; 326 327 } 328 if (array_key_exists('state', $this->_raw_data)) 329 { 330 $this->state = $this->_raw_data['state']; 331 } 327 332 if (array_key_exists('privileges', $this->_raw_data)) 328 333 { branches/MidCOM_2_8/midcom.core/midcom/exec/reindex.php
r5235 r6141 128 128 // returned with failure 129 129 echo "failure.\n Background processing failed, error: {$http_client->error}\n"; 130 echo "Url: " . $reindex_topic_uri . "?" . join("=", $post_variables); 130 131 $body = $http_client->_client->getResponseBody(); 131 132 if (!empty($body)) … … 139 140 // Does not end with 'Reindex complete for node...' 140 141 echo "failure.\n Background reindex returned unexpected data:\n---\n{$response}\n---\n\n"; 142 echo "Url: " . $reindex_topic_uri . "?" . join("=", $post_variables); 141 143 } 142 144 else branches/MidCOM_2_8/midcom.core/midcom/helper/hostconfig.php
r5221 r6141 179 179 180 180 $codeinit .= "\nif(!defined('MIDCOM_ROOT')) {"; 181 $codeinit .= "\n define('MIDCOM_ROOT','midcom/lib');"; 181 182 $codeinit .= "\n define('MIDCOM_ROOT','".MIDCOM_ROOT."');"; 182 183 $codeinit .= "\n}\n"; 183 184 branches/MidCOM_2_8/midcom.core/midcom/services/cache/backend/flatfile.php
r5525 r6141 53 53 } 54 54 55 debug_add("Flatfile Cache backend '{$this->_name}' initialized to directory: {$this->_dirname}");55 //debug_add("Flatfile Cache backend '{$this->_name}' initialized to directory: {$this->_dirname}"); 56 56 } 57 57 branches/MidCOM_2_8/midcom.core/midcom/services/dbclassloader.php
r5852 r6141 277 277 if ($cache_hit) 278 278 { 279 debug_add("We had a cache hit for {$component}/{$filename}.");279 //debug_add("We had a cache hit for {$component}/{$filename}."); 280 280 debug_pop(); 281 281 return true; branches/MidCOM_2_8/midcom.core/midcom/services/indexer.php
r3766 r6141 232 232 return true; 233 233 } 234 235 234 return $this->_backend->delete_all(); 236 235 } … … 245 244 * The query syntax is also dependant on the backend. Refer to its documentation 246 245 * how queries should be built. 247 *248 * Each result node is looked up in NAP/Metadata to verify its visibility.249 246 * 250 247 * @param string $query The query, which must suite the backends query syntax. It is assumed to be in the site charset. … … 293 290 } 294 291 292 // this checks acls! 295 293 if ($document->is_a('midcom')) 296 294 { … … 304 302 } 305 303 } 306 307 // For all midcom doucments, check the metadata visibility state given by the source object.308 // Do this only if MidCOM is configured to do so309 if ( $document->is_a('midcom')310 && ( $midcom_config['show_hidden_objects']311 || $midcom_config['show_unapproved_objects']))312 {313 $metadata =& midcom_helper_metadata::retrieve($document->source);314 315 if ( $metadata316 && ! $metadata->is_object_visible_onsite())317 {318 debug_add("Skipping the document {$document->title}, the metadata of the source document {$document->source} indicate no visibility.");319 continue;320 }321 322 // Drop the reference again.323 unset($metadata);324 }325 326 // Check for additional security checks by the component or a custom callback327 $component_loader =& $_MIDCOM->get_component_loader();328 $security = explode(':', $document->security, 2);329 switch ($security[0])330 {331 case 'component':332 // Component security, get the interface base class, if it exists, and333 // execute the corresponding handler.334 debug_add('Doing additional component-level security check');335 $interface =& $component_loader->get_interface_class($document->component);336 if ( $interface337 && $topic338 && ! $interface->check_document_permissions($document, $topic))339 {340 debug_add('Skipping the document, the callee returned false.');341 continue 2;342 }343 break;344 345 case 'function':346 // Execute a custom callback to ascertain visbility.347 debug_add("We are in function security mode, executing the callback {$security[1]}.");348 if (! $security[1]($document, $topic))349 {350 debug_add('Skipping the document, the callee returned false.');351 continue 2;352 }353 break;354 355 case 'class':356 die ('The class security callback is disabled, it is broken from the beginning.');357 // TODO: Fix this.358 359 // Execute a custom callback to ascertain visbility.360 debug_add("We are in function security mode, executing the callback {$security[1]}.");361 $class = $security[1];362 $instance =& $class->get_instance();363 if (! $instance->check_document_permissions($document, $topic))364 {365 debug_add('Skipping the document, the callee returned false.');366 continue 2;367 }368 break;369 }370 371 304 $result[] = $document; 372 305 } branches/MidCOM_2_8/midcom.core/midcom/services/indexer/document.php
r3766 r6141 347 347 { 348 348 // This is always UTF-8 conformant. 349 $this->_add_field($name, 'date', strftime('%Y-%m-%dT%H:%M:%S ', $timestamp), true);349 $this->_add_field($name, 'date', strftime('%Y-%m-%dT%H:%M:%SZ', $timestamp), true); 350 350 } 351 351 branches/MidCOM_2_8/midcom.helper.search/config/manifest.inc
r5819 r6141 1 2 1 'name' => 'midcom.helper.search', 3 'version' => '1.0. 3beta1',2 'version' => '1.0.4beta1', 4 3 'state' => 'beta', 5 4 'purecode' => false, … … 23 22 'active' => 'no', 24 23 ), 24 'tarjei' => 25 array ( 26 'name' => 'Tarjei Huse', 27 'email' => 'tarjei@nu.no', 28 'role' => 'lead', 29 'active' => 'yes', 30 ), 31 25 32 ), 26 33 'dependencies' => … … 29 36 array ( 30 37 ), 38 'http_request' => 39 array ( 40 'channel' => 'pear.php.net', 41 ), 31 42 ), 32 43 ), branches/MidCOM_2_8/midcom.helper.search/style/advanced_form.php
r5048 r6141 1 1 <?php 2 //$data =& $_MIDCOM->get_custom_context_data('request_data');2 $data =& $_MIDCOM->get_custom_context_data('request_data'); 3 3 $prefix = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 4 4 branches/MidCOM_2_8/midcom.helper.search/style/search_form.php
r5048 r6141 1 <?php2 //$data =& $_MIDCOM->get_custom_context_data('request_data');3 ?>4 1 <h1><?php echo $data['topic']->extra;?></h1> 5 2 branches/MidCOM_2_8/midcom.helper.search/viewer.php
r4120 r6141 58 58 case 'advanced': 59 59 $data['query'] = (array_key_exists('query', $_REQUEST) ? $_REQUEST['query'] : ''); 60 $data['topic'] = (array_key_exists('topic', $_REQUEST) ? $_REQUEST['topic'] : '');60 //$data['topic'] = (array_key_exists('topic', $_REQUEST) ? $_REQUEST['topic'] : ''); 61 61 $data['component'] = (array_key_exists('component', $_REQUEST) ? $_REQUEST['component'] : ''); 62 62 $data['lastmodified'] = (array_key_exists('lastmodified', $_REQUEST) ? ((integer) $_REQUEST['lastmodified']) : 0); … … 105 105 if ( count(explode(' ', $data['query'])) == 1 106 106 && !strstr($data['query'], '*')) 107 { 108 // Single search term, append * 109 if ($GLOBALS['midcom_config']['indexer_backend'] != 'solr') 110 { 111 $data['query'] .= '*'; 112 } 113 } 114 115 $result = $indexer->query($data['query']); 116 break; 117 118 case 'advanced': 119 $data['query'] = trim($_REQUEST['query']); 120 121 if ( count(explode(' ', $data['query'])) == 1 122 && !strstr($data['query'], '*') && $GLOBALS['midcom_config']['indexer_backend'] != 'solr' ) 107 123 { 108 124 // Single search term, append * … … 110 126 } 111 127 112 $result = $indexer->query($data['query']); 113 break; 114 115 case 'advanced': 116 $data['query'] = trim($_REQUEST['query']); 117 118 if ( count(explode(' ', $data['query'])) == 1 119 && !strstr($data['query'], '*')) 120 { 121 // Single search term, append * 122 $data['query'] .= '*'; 123 } 124 125 $data['topic'] = trim($_REQUEST['topic']); 126 // $data['topic2'] = trim($_REQUEST['topic2']); 128 $data['request_topic'] = trim($_REQUEST['topic']); 127 129 $data['component'] = trim($_REQUEST['component']); 128 130 $data['lastmodified'] = (integer) trim($_REQUEST['lastmodified']); … … 136 138 } 137 139 138 if ($data['query'] != '' )139 { 140 $final_query = "({$data['query']})";140 if ($data['query'] != '' ) 141 { 142 $final_query = ( $GLOBALS['midcom_config']['indexer_backend'] == 'solr' ) ? $data['query'] : "({$data['query']})"; 141 143 } 142 144 else … … 145 147 } 146 148 147 if ($data[' topic'] != '')149 if ($data['request_topic'] != '') 148 150 { 149 151 if ($final_query != '') … … 151 153 $final_query .= ' AND '; 152 154 } 153 $final_query .= "__TOPIC_URL:\"{$data['topic']}*\""; 154 } 155 /* 156 *This if makes able to search more than one topics 157 *You need to put in to the input value in the search form topics separated by ; 158 *no spaces 159 * / 160 if ($data['topic2'] != '') 161 { 162 if ($final_query != '') 163 { 164 $final_query .= ' AND '; 165 } 166 $topic_arrays = explode(";" ,$data['topic2']); 167 $final_tmp_query = ""; 168 169 foreach ($topic_arrays as $topic_tmp) 170 { 171 if ($final_tmp_query != '') 172 { 173 $final_tmp_query .= ' OR '; 174 } 175 else 176 { 177 $final_tmp_query .= " ( "; 178 } 179 $final_tmp_query .= "__TOPIC_URL:\"{$topic_tmp}*\""; 180 } 181 $final_tmp_query .= " )"; 182 183 184 $final_query .= $final_tmp_query; 185 } 186 */ 187 155 $final_query .= "__TOPIC_URL:\"{$data['request_topic']}*\""; 156 } 157 188 158 if ($data['component'] != '') 189 159 { branches/MidCOM_2_8/midgard.webdav.styles/viewer.php
r4767 r6141 127 127 $document->topic_guid = $topic->guid; 128 128 $document->topic_url = $node[MIDCOM_NAV_FULLURL]; 129 $document->component = $topic->component; 129 130 $document->author = $author->name; 130 131 $document->created = $dm->storage->object->created; branches/MidCOM_2_8/net.nehmer.blog/viewer.php
r5856 r6141 450 450 $document = $indexer->new_document($dm); 451 451 $document->topic_guid = $topic->guid; 452 $document->component = $topic->component; 452 453 $document->topic_url = $node[MIDCOM_NAV_FULLURL]; 453 454 $document->author = $author->name; branches/MidCOM_2_8/net.nehmer.static/viewer.php
r5797 r6141 194 194 $document->created = $dm->storage->object->created; 195 195 $document->edited = $dm->storage->object->revised; 196 $document->component = $topic->component; 196 197 $indexer->index($document); 197 198 } branches/MidCOM_2_8/net.nemein.calendar/viewer.php
r5499 r6141 357 357 $document->topic_guid = $topic->guid; 358 358 $document->topic_url = $node[MIDCOM_NAV_FULLURL]; 359 $document->component = $topic->component; 359 360 if (!empty($author)) 360 361 { branches/MidCOM_2_8/net.nemein.discussion/viewer.php
r5750 r6141 214 214 $document->created = $dm->storage->object->created; 215 215 $document->edited = $dm->storage->object->revised; 216 $document->component = $topic->component; 216 217 $indexer->index($document); 217 218 } branches/MidCOM_2_8/net.nemein.netmon/viewer.php
r6072 r6141 154 154 $document->created = $dm->storage->object->created; 155 155 $document->edited = $dm->storage->object->revised; 156 $document->component = $topic->component; 156 157 $indexer->index($document); 157 158 } branches/MidCOM_2_8/net.nemein.organizations/viewer.php
r4894 r6141 219 219 $document->created = $dm->storage->object->metadata->created; 220 220 $document->edited = $dm->storage->object->metadata->revised; 221 $document->component = $topic->component; 221 222 $indexer->index($document); 222 223 } branches/MidCOM_2_8/net.nemein.personnel/viewer.php
r6003 r6141 350 350 $document->created = $dm->storage->object->metadata->created; 351 351 $document->edited = $dm->storage->object->metadata->revised; 352 $document->component = $topic->component; 352 353 $indexer->index($document); 353 354 } branches/MidCOM_2_8/net.nemein.quickpoll/viewer.php
r5702 r6141 142 142 $document->created = $dm->storage->object->created; 143 143 $document->edited = $dm->storage->object->revised; 144 $document->component = $topic->component; 144 145 $indexer->index($document); 145 146 } branches/MidCOM_2_8/net.nemein.registrations/event.php
r6057 r6141 944 944 $document->created = $dm->storage->object->created; 945 945 $document->edited = $dm->storage->object->revised; 946 $document->component = $topic->component; 946 947 $indexer->index($document); 947 948 } branches/MidCOM_2_8/net.nemein.updatenotification/viewer.php
r5749 r6141 86 86 $document->topic_guid = $topic->guid; 87 87 $document->topic_url = $node[MIDCOM_NAV_FULLURL]; 88 $document->component = $topic->component; 88 89 $document->author = $author->name; 89 90 $document->created = $dm->storage->object->created; branches/MidCOM_2_8/net.nemein.wiki/viewer.php
r4610 r6141 271 271 $document->created = $dm->storage->object->created; 272 272 $document->edited = $dm->storage->object->revised; 273 $document->component = $topic->component; 273 274 $indexer->index($document); 274 275 } branches/MidCOM_2_8/no.odindata.quickform2/viewer.php
r4826 r6141 96 96 $document->author = $author->name; 97 97 $document->created = $dm->storage->object->created; 98 $document->component = $topic->component; 98 99 $document->edited = $dm->storage->object->revised; 99 100 $indexer->index($document); branches/MidCOM_2_8/org.openpsa.products/viewer.php
r6067 r6141 218 218 $document = $indexer->new_document($dm); 219 219 $document->topic_guid = $topic->guid; 220 $document->component = $topic->component; 220 221 $document->topic_url = $node[MIDCOM_NAV_FULLURL]; 221 222 $document->author = $author->name; branches/MidCOM_2_8/org.routamc.photostream/viewer.php
r5387 r6141 349 349 $document = $indexer->new_document($dm); 350 350 $document->topic_guid = $topic->guid; 351 $document->component = $topic->component; 351 352 $document->topic_url = $node[MIDCOM_NAV_FULLURL]; 352 353 $document->author = $author->name; branches/MidCOM_2_8/scaffold/viewer.php
r4381 r6141 79 79 $document = $indexer->new_document($dm); 80 80 $document->topic_guid = $topic->guid; 81 $document->component = $topic->component; 81 82 $document->topic_url = $node[MIDCOM_NAV_FULLURL]; 82 83 $document->author = $author->name;
