Browse files

dont use Cache in extensions list

  • Loading branch information...
1 parent 80e3958 commit 2f10324c6b878230ea1b6c9b6e351ccf5dc7018f @jbrekle jbrekle committed Apr 2, 2012
View
14 application/classes/OntoWiki/Model/Instances.php
@@ -81,13 +81,19 @@ class OntoWiki_Model_Instances extends OntoWiki_Model
*/
protected $_valueQuery = null;
protected $_valueQueryResourceFilter = null;
+
+ protected $_useCache = true;
/**
* Constructor
*/
public function __construct (Erfurt_Store $store, Erfurt_Rdf_Model $model, $options = array())
{
parent::__construct($store, $model);
+
+ if(isset($options[STORE_USE_CACHE])){
+ $this->_useCache = $options[STORE_USE_CACHE];
+ }
$this->_defaultUrl['resource'] = new OntoWiki_Url(array('route' => 'properties'), array());
$this->_defaultUrlParam['resource'] = 'r';
@@ -328,7 +334,7 @@ public function getResults ()
if (!$this->_resultsUptodate) {
$this->_results = $this->_store->sparqlQuery(
$this->_valueQuery,
- array('result_format' => 'extended')
+ array(STORE_RESULTFORMAT => STORE_RESULTFORMAT_EXTENDED, STORE_USE_CACHE => $this->_useCache)
);
$this->_resultsUptodate = true;
}
@@ -1202,7 +1208,7 @@ public function getAllProperties ($inverse = false)
$results = $this->_store->sparqlQuery(
$query,
- array('result_format' => 'extended')
+ array(STORE_RESULTFORMAT => STORE_RESULTFORMAT_EXTENDED, STORE_USE_CACHE => $this->_useCache)
);
$properties = array();
@@ -1261,7 +1267,7 @@ public function getPossibleValues ($property, $distinct = true, $inverse = false
$query->addProjectionVar($valueVar);
$results = $this->_store->sparqlQuery(
$query,
- array(STORE_RESULTFORMAT => STORE_RESULTFORMAT_EXTENDED)
+ array(STORE_RESULTFORMAT => STORE_RESULTFORMAT_EXTENDED, STORE_USE_CACHE => $this->_useCache)
);
$values = array();
@@ -1386,7 +1392,7 @@ public function getShownResources ()
if (!$this->_resourcesUptodate) {
$result = $this->_store->sparqlQuery(
$this->_resourceQuery,
- array(STORE_RESULTFORMAT => STORE_RESULTFORMAT_EXTENDED)
+ array(STORE_RESULTFORMAT => STORE_RESULTFORMAT_EXTENDED, STORE_USE_CACHE => $this->_useCache)
);
$this->_resources = array();
foreach ($result['results']['bindings'] as $row) {
View
2 extensions/exconf/ExconfController.php
@@ -289,7 +289,7 @@ public function explorerepoAction(){
$adapter = new Erfurt_Store_Adapter_Sparql(array('serviceurl'=>$repoUrl, 'graphs'=>array($graph)));
$store = new Erfurt_Store(array('adapterInstance'=>$adapter), 'sparql');
$rdfGraphObj = new Erfurt_Rdf_Model($graph);
- $list = new OntoWiki_Model_Instances($store, $rdfGraphObj, array());
+ $list = new OntoWiki_Model_Instances($store, $rdfGraphObj, array(STORE_USE_CACHE => false));
$list->addTypeFilter(self::EXTENSION_CLASS, null, array('withChilds'=>false));
$list->addShownProperty(self::EXTENSION_NAME_PROPERTY, 'name'); //internal name (folder name)
$list->addShownProperty(self::EXTENSION_TITLE_PROPERTY, 'title'); //pretty name (label)
View
13 extensions/exconf/templates/partials/list_extensions_element.phtml
@@ -1,6 +1,6 @@
<li class="<?php echo $this->odd ? 'odd' : 'even'; ?>">
<?php
- if($this->instance['type'] == 'uri'){
+ if($this->instance['type'] == 'uri'){
if(isset($this->instanceData[$this->instanceUri]['name'])){
$name = $this->instanceData[$this->instanceUri]['name'][0]['origvalue'];
} else {
@@ -74,14 +74,18 @@
?>
<div class="extension has-contextmenu-area" id="<?php echo $name; ?>">
<h3><span class="name">
- <?php if($page!=null){?><a href="<?php echo $page; ?>"><?php }
+ <?php if($page!=null){ ?><a href="<?php echo $page; ?>"><?php }
echo $title;
if($page!=null){ ?></a><?php } ?>
</span></h3>
- <span class="author">by <?php if($authorPage !== null){?><a href="<?php echo $authorPage;?>"><?php echo $authorLabel;?></a> <?php } else echo $authorLabel;
+ <span class="author">by
+ <?php if($authorPage !== null) { ?>
+ <a href="<?php echo $authorPage;?>">
+ <?php echo $authorLabel;?>
+ </a> <?php } else echo $authorLabel;
if($authorMail != null){
?><a href="<?php echo $authorMail; ?>">mail</a>
- } ?></span>
+ <?php } ?></span>
<p class="description"><?php echo $description; ?></p>
<?php
if($location !== null){
@@ -110,4 +114,5 @@
}
?>
</div>
+ <?php } ?>
</li>

0 comments on commit 2f10324

Please sign in to comment.