Exemplo n.º 1
1
 protected function _postDelete()
 {
     //find related docs and delete them
     $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
     $rowsetRelatedDocs = $tblRelatedItem->fetchAll("relatedGuid='{$this->guid}' AND relateAs IN ('RELATED_FILE','RELATED_IMAGE','RELATED_VIDEO')");
     if (count($rowsetRelatedDocs)) {
         foreach ($rowsetRelatedDocs as $rowRelatedDoc) {
             $tblCatalog = new App_Model_Db_Table_Catalog();
             $rowCatalog = $tblCatalog->find($rowRelatedDoc->itemGuid)->current();
             if ($rowCatalog) {
                 $rowCatalog->delete();
             }
         }
     }
     $registry = Zend_Registry::getInstance();
     $config = $registry->get(Pandamp_Keys::REGISTRY_APP_OBJECT);
     $cdn = $config->getOption('cdn');
     if ($this->profileGuid == 'kutu_doc') {
         //get parentGuid
         $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
         $rowsetRelatedItem = $tblRelatedItem->fetchAll("itemGuid='{$this->guid}' AND relateAs IN ('RELATED_FILE','RELATED_IMAGE','RELATED_VIDEO')");
         if (count($rowsetRelatedItem)) {
             foreach ($rowsetRelatedItem as $rowRelatedItem) {
                 //must delete the physical files
                 $rowsetCatAtt = $this->findDependentRowsetCatalogAttribute();
                 $systemname = $rowsetCatAtt->findByAttributeGuid('docSystemName')->value;
                 $parentGuid = $rowRelatedItem->relatedGuid;
                 $sDir1 = $cdn['static']['dir']['files'] . DIRECTORY_SEPARATOR . $systemname;
                 $sDir2 = $cdn['static']['dir']['files'] . DIRECTORY_SEPARATOR . $parentGuid . DIRECTORY_SEPARATOR . $systemname;
                 //$sDir1 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$systemname;
                 //$sDir2 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$parentGuid.DIRECTORY_SEPARATOR.$systemname;
                 if (file_exists($sDir1)) {
                     //delete file
                     unlink($sDir1);
                 } else {
                     if (file_exists($sDir2)) {
                         //delete file
                         unlink($sDir2);
                     }
                 }
             }
         }
     }
     //delete from table CatalogAttribute
     $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute();
     $tblCatalogAttribute->delete("catalogGuid='{$this->guid}'");
     //delete catalogGuid from table CatalogFolder
     $tblCatalogFolder = new App_Model_Db_Table_CatalogFolder();
     $tblCatalogFolder->delete("catalogGuid='{$this->guid}'");
     //delete guid from table AssetSetting
     $tblAssetSetting = new App_Model_Db_Table_AssetSetting();
     $tblAssetSetting->delete("guid='{$this->guid}'");
     //delete from table relatedItem
     $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
     $tblRelatedItem->delete("itemGuid='{$this->guid}'");
     $tblRelatedItem->delete("relatedGuid='{$this->guid}'");
     $indexingEngine = Pandamp_Search::manager();
     try {
         $hits = $indexingEngine->deleteCatalogFromIndex($this->guid);
     } catch (Exception $e) {
     }
     //delete physical catalog folder from uploads/files/[catalogGuid]
     $sDir = $cdn['static']['dir']['files'] . DIRECTORY_SEPARATOR . $this->guid;
     //$sDir = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$this->guid;
     try {
         if (is_dir($sDir)) {
             rmdir($sDir);
         }
     } catch (Exception $e) {
     }
     $sDir = $cdn['static']['dir']['images'];
     //$sDir = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'images';
     try {
         if (file_exists($sDir . "/" . $this->guid . ".gif")) {
             unlink($sDir . "/" . $this->guid . ".gif");
         }
         if (file_exists($sDir . "/tn_" . $this->guid . ".gif")) {
             unlink($sDir . "/tn_" . $this->guid . ".gif");
         }
         if (file_exists($sDir . "/" . $this->guid . ".jpg")) {
             unlink($sDir . "/" . $this->guid . ".jpg");
         }
         if (file_exists($sDir . "/tn_" . $this->guid . ".jpg")) {
             unlink($sDir . "/tn_" . $this->guid . ".jpg");
         }
         if (file_exists($sDir . "/" . $this->guid . ".jpeg")) {
             unlink($sDir . "/" . $this->guid . ".jpeg");
         }
         if (file_exists($sDir . "/tn_" . $this->guid . ".jpeg")) {
             unlink($sDir . "/tn_" . $this->guid . ".jpeg");
         }
         if (file_exists($sDir . "/" . $this->guid . ".png")) {
             unlink($sDir . "/" . $this->guid . ".png");
         }
         if (file_exists($sDir . "/tn_" . $this->guid . ".png")) {
             unlink($sDir . "/tn_" . $this->guid . ".png");
         }
     } catch (Exception $e) {
     }
 }
Exemplo n.º 2
0
 function deletehistoryAction()
 {
     $req = $this->getRequest();
     $itemGuid = $req->getParam('itemGuid') ? $req->getParam('itemGuid') : 'XXX';
     $relatedGuid = $req->getParam('relatedGuid') ? $req->getParam('relatedGuid') : 'XXX';
     $relateAs = $req->getParam('relateAs') ? $req->getParam('relateAs') : 'XXX';
     $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
     $tblRelatedItem->delete("itemGuid='{$itemGuid}' AND relatedGuid='{$relatedGuid}' AND relateAs='{$relateAs}'");
     exit;
 }
Exemplo n.º 3
0
 function delete($itemGuid, $relatedGuid, $relateAs)
 {
     if (empty($relateAs)) {
         throw new Zend_Exception('relateAs can not be empty!');
     }
     $registry = Zend_Registry::getInstance();
     $config = $registry->get(Pandamp_Keys::REGISTRY_APP_OBJECT);
     $cdn = $config->getOption('cdn');
     $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
     $rowsetRelatedDocs = $tblRelatedItem->fetchAll("itemGuid='{$itemGuid}' AND relatedGuid='{$relatedGuid}' AND relateAs='{$relateAs}'");
     if ($rowsetRelatedDocs) {
         foreach ($rowsetRelatedDocs as $rowRelatedDoc) {
             $systemname = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($rowRelatedDoc->itemGuid, 'docSystemName');
             $ext = pathinfo($systemname, PATHINFO_EXTENSION);
             $ext = strtolower($ext);
             $parentGuid = $rowRelatedDoc->relatedGuid;
             //$sDir1 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$systemname;
             $sDir1 = $cdn['static']['dir']['files'] . DIRECTORY_SEPARATOR . $systemname;
             $sDir2 = $cdn['static']['dir']['files'] . DIRECTORY_SEPARATOR . $parentGuid . DIRECTORY_SEPARATOR . $systemname;
             //$sDir2 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$parentGuid.DIRECTORY_SEPARATOR.$systemname;
             if (file_exists($sDir1)) {
                 unlink($sDir1);
             } else {
                 if (file_exists($sDir2)) {
                     unlink($sDir2);
                 }
             }
             $systemname = $rowRelatedDoc->itemGuid;
             $parentGuid = $rowRelatedDoc->relatedGuid;
             $sDir = $cdn['static']['dir']['images'];
             $sDir2 = $cdn['static']['dir']['images'] . DIRECTORY_SEPARATOR . $parentGuid;
             //$sDir = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'images';
             //$sDir2 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.$parentGuid;
             if (file_exists($sDir . "/" . $systemname . '.' . $ext)) {
                 unlink($sDir . "/" . $systemname . '.' . $ext);
             }
             if (file_exists($sDir . "/tn_" . $systemname . '.' . $ext)) {
                 unlink($sDir . "/tn_" . $systemname . '.' . $ext);
             }
             if (file_exists($sDir2 . "/" . $systemname . '.' . $ext)) {
                 unlink($sDir2 . "/" . $systemname . '.' . $ext);
             }
             if (file_exists($sDir2 . "/tn_" . $systemname . '.' . $ext)) {
                 unlink($sDir2 . "/tn_" . $systemname . '.' . $ext);
             }
             $file = new Zend_Config_Ini(APPLICATION_PATH . '/configs/image.ini', 'size');
             $keys = array_keys($file->toArray());
             foreach ($keys as $key) {
                 if (file_exists($sDir2 . '/' . $key . '_' . $systemname . '.' . $ext)) {
                     unlink($sDir2 . '/' . $key . '_' . $systemname . '.' . $ext);
                 }
             }
             $tblCatalog = new App_Model_Db_Table_Catalog();
             $rowCatalog = $tblCatalog->find($rowRelatedDoc->itemGuid)->current();
             $rowCatalog->delete();
         }
     }
     if ($tblRelatedItem->delete("itemGuid='{$itemGuid}' AND relatedGuid='{$relatedGuid}' AND relateAs='{$relateAs}'")) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 4
0
 public function save($aData)
 {
     if (empty($aData['profileGuid'])) {
         throw new Zend_Exception('Catalog Profile can not be EMPTY!');
     }
     $profileGuid = $aData['profileGuid'];
     if ($profileGuid == 'klinik') {
         $title = $aData['fixedCommentTitle'];
     } else {
         $title = $aData['fixedTitle'];
     }
     $setsticky = false;
     $sticky = isset($aData['stickyCategory']) && !empty($aData['stickyCategory']) ? $aData['stickyCategory'] : 0;
     if ($sticky == 1) {
         $setsticky = true;
     }
     $slug = Pandamp_Utility_String::removeSign($title, '-', true);
     if (isset($aData['keywordintegrasi']) && !empty($aData['keywordintegrasi'])) {
         $ckey = explode(',', $aData['fixedKeywords']);
         $mckey = array_merge($aData['keywordintegrasi'], $ckey);
         $umckey = array_intersect_key($mckey, array_unique(array_map('strtolower', $mckey)));
         $umckey = rtrim(implode(',', $umckey), ',');
         $aData['fixedKeywords'] = $umckey;
         unset($aData['keywordintegrasi']);
     }
     if (isset($aData['fixedNarsum']) && !empty($aData['fixedNarsum'])) {
         $fn = implode(',', $aData['fixedNarsum']);
         $aData['fixedNarsum'] = $fn;
     }
     $tblCatalog = new App_Model_Db_Table_Catalog();
     $gman = new Pandamp_Core_Guid();
     $catalogGuid = isset($aData['guid']) && !empty($aData['guid']) ? $aData['guid'] : $gman->generateGuid();
     $folderGuid = isset($aData['folderGuid']) && !empty($aData['folderGuid']) ? $aData['folderGuid'] : '';
     if (isset($aData['shortTitle']) && !empty($aData['shortTitle'])) {
         $slug = $aData['shortTitle'];
     }
     //if not empty, there are 2 possibilities
     $where = $tblCatalog->getAdapter()->quoteInto('guid=?', $catalogGuid);
     if ($tblCatalog->fetchRow($where)) {
         $rowCatalog = $tblCatalog->find($catalogGuid)->current();
         $rowCatalog->shortTitle = $slug;
         $rowCatalog->publishedDate = isset($aData['publishedDate']) ? $aData['publishedDate'] : $rowCatalog->publishedDate;
         $rowCatalog->expiredDate = isset($aData['expiredDate']) ? $aData['expiredDate'] : $rowCatalog->expiredDate;
         $rowCatalog->status = isset($aData['status']) ? $aData['status'] : $rowCatalog->status;
         $rowCatalog->price = isset($aData['price']) ? $aData['price'] : $rowCatalog->price;
         $rowCatalog->sticky = (int) $setsticky;
     } else {
         $rowCatalog = $tblCatalog->fetchNew();
         $rowCatalog->guid = $catalogGuid;
         $rowCatalog->shortTitle = $slug;
         $rowCatalog->profileGuid = $profileGuid;
         $rowCatalog->publishedDate = isset($aData['publishedDate']) ? $aData['publishedDate'] : '0000-00-00 00:00:00';
         $rowCatalog->expiredDate = isset($aData['expiredDate']) ? $aData['expiredDate'] : '0000-00-00 00:00:00';
         $rowCatalog->createdBy = isset($aData['username']) ? $aData['username'] : '';
         $rowCatalog->modifiedBy = $rowCatalog->createdBy;
         $rowCatalog->createdDate = date("Y-m-d H:i:s");
         $rowCatalog->modifiedDate = $rowCatalog->createdDate;
         $rowCatalog->deletedDate = '0000-00-00 00:00:00';
         $rowCatalog->status = isset($aData['status']) ? $aData['status'] : 0;
         $rowCatalog->price = isset($aData['price']) ? $aData['price'] : 0;
         $rowCatalog->sticky = (int) $setsticky;
     }
     try {
         $catalogGuid = $rowCatalog->save();
     } catch (Exception $e) {
         die($e->getMessage());
     }
     $tableProfileAttribute = new App_Model_Db_Table_ProfileAttribute();
     //$profileGuid = $rowCatalog->profileGuid;
     $where = $tableProfileAttribute->getAdapter()->quoteInto('profileGuid=?', $profileGuid);
     $rowsetProfileAttribute = $tableProfileAttribute->fetchAll($where, 'viewOrder ASC');
     $rowsetCatalogAttribute = $rowCatalog->findDependentRowsetCatalogAttribute();
     foreach ($rowsetProfileAttribute as $rowProfileAttribute) {
         /*$aid = $rowProfileAttribute->attributeGuid;
          	$rowCatalogAttribute = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue( $catalogGuid, $rowProfileAttribute->attributeGuid);
          	if ($rowCatalogAttribute)
          	{
          		$ca = new App_Model_Db_Table_CatalogAttribute();
          		$ca->update(
          			[
          				'value' => $aData[$aid]
          			], 
          			[
          				'catalogGuid = ?' => $catalogGuid,
          				'attributeGuid = ?'	=> $rowProfileAttribute->attributeGuid
          			]
          		);
          	}
          	else
          	{
          		$ca = new App_Model_Db_Table_CatalogAttribute();
          		$ca->insert([
          			'catalogGuid' => $catalogGuid,
          			'attributeGuid' => $rowProfileAttribute->attributeGuid,
          			'value'	=> $aData[$aid]
          		]);
          	}*/
         if ($rowsetCatalogAttribute->findByAttributeGuid($rowProfileAttribute->attributeGuid)) {
             $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid($rowProfileAttribute->attributeGuid);
         } else {
             $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute();
             $rowCatalogAttribute = $tblCatalogAttribute->fetchNew();
             $rowCatalogAttribute->catalogGuid = $catalogGuid;
             $rowCatalogAttribute->attributeGuid = $rowProfileAttribute->attributeGuid;
         }
         $rowCatalogAttribute->value = isset($aData[$rowProfileAttribute->attributeGuid]) ? $aData[$rowProfileAttribute->attributeGuid] : '';
         $rowCatalogAttribute->save();
     }
     //category
     if (isset($aData['selectedNode']) && !empty($aData['selectedNode'])) {
         $categories = array_map('trim', explode(',', $aData['selectedNode']));
         $tblCatalogFolder = new App_Model_Db_Table_CatalogFolder();
         $cf = $tblCatalogFolder->fetchAll("catalogGuid='{$catalogGuid}'");
         if (count($cf)) {
             foreach ($cf as $cfol) {
                 $cts[] = $cfol->folderGuid;
                 if (!in_array($cfol->folderGuid, $categories)) {
                     $tblCatalogFolder->delete("catalogGuid='{$cfol->catalogGuid}' AND folderGuid='{$cfol->folderGuid}'");
                 }
             }
         }
         foreach ($categories as $category) {
             $rowCatalog->copyToFolder($category);
         }
     }
     //save to table CatalogFolder only if folderGuid is not empty
     /*if (!empty($folderGuid))
       {
           $rowCatalog->copyToFolder($folderGuid);
       }*/
     // copy to other categories
     /*if (!empty($aData['categories'])) {
       	$tblCatalogFolder = new App_Model_Db_Table_CatalogFolder();
       	$cf = $tblCatalogFolder->fetchAll("catalogGuid='$catalogGuid'");
       	if (count($cf)) {
       		$sa="";
       		foreach ($cf as $cfol) {
       			$cts[] = $cfol->folderGuid;
       			if (!in_array($cfol->folderGuid, $aData['categories']))
       			{
       				$tblCatalogFolder->delete("catalogGuid='$cfol->catalogGuid' AND folderGuid='$cfol->folderGuid'");
       				$sa="del";
       			}
       		}
       		
       		if ($sa=="del") {
       			$auth = Zend_Auth::getInstance();
       			$group = $auth->getIdentity()->name;
       			$group = strtolower(str_replace(" ", "", $group));
       			 
       			$zl = Zend_Registry::get("Zend_Locale");
       			$lang = $zl->getLanguage();
       		
       			$cache = Pandamp_Cache::getInstance();
       			$sel = join("_", $cts);
       			$cache->remove('categoryCheckbox_'.$sel.'_'.$lang.'_'.$group);
       		}
       	}
       	
       	foreach ($aData['categories'] as $category)
       	{
       		$rowCatalog->copyToFolder($category);
       	}
       }*/
     /**
      * @todo Relasi Katalog
      */
     if (isset($aData['relIds'])) {
         $relatedItemDb = new App_Model_Db_Table_RelatedItem();
         $relatedItemDb->delete(array('relatedGuid=?' => $catalogGuid, 'relateAs IN (?)' => array('RELATED_OTHER', 'RELATED_Clinic', 'RELATED_ISSUE', 'RELATED_HISTORY', 'RELATED_BASE', 'RELATED_TRANSLATION_ID', 'RELATED_TRANSLATION_EN')));
         for ($i = 0; $i < count($aData['relIds']); $i++) {
             if ($aData['relIds'][$i] and $aData['relGuids'][$i]) {
                 $relatedItemDb->insert(array('itemGuid' => $aData['relIds'][$i], 'relatedGuid' => $catalogGuid, 'relateAs' => $aData['relGuids'][$i]));
             }
         }
     }
     /**
      * @todo Upload File
      */
     if (isset($aData['filename']) && !empty($aData['filename'])) {
         $catalogDb = new App_Model_Db_Table_Catalog();
         for ($i = 0; $i < count($aData['filename']); $i++) {
             $fileName = $aData['filename'][$i];
             $fileUrls = json_decode(stripslashes($aData['fileUrl'][$i]));
             foreach ($fileUrls as $index => $value) {
                 if ($index == "original") {
                     $title = '';
                     $slug = '';
                     if (isset($aData['attr_caption_' . $value->id]) && !empty($aData['attr_caption_' . $value->id])) {
                         $title = $aData['attr_caption_' . $value->id][0];
                         $slug = Pandamp_Utility_String::removeSign($title, '-', true);
                     }
                     if ($value->type == 'file') {
                         $relatedType = 'RELATED_FILE';
                     } elseif ($value->type == 'image') {
                         $relatedType = 'RELATED_IMAGE';
                     }
                     $rowDocCatalog = $catalogDb->fetchNew();
                     $rowDocCatalog->guid = $value->id;
                     $rowDocCatalog->shortTitle = $slug;
                     $rowDocCatalog->profileGuid = $aData['profile'];
                     $docCatalogGuid = $rowDocCatalog->save();
                     $rowsetDocCatalogAttribute = $rowDocCatalog->findDependentRowsetCatalogAttribute();
                     $this->_updateCatalogAttribute($rowsetDocCatalogAttribute, $docCatalogGuid, 'docSystemName', $value->title);
                     $this->_updateCatalogAttribute($rowsetDocCatalogAttribute, $docCatalogGuid, 'docOriginalName', $fileName);
                     $this->_updateCatalogAttribute($rowsetDocCatalogAttribute, $docCatalogGuid, 'docSize', $value->size);
                     $this->_updateCatalogAttribute($rowsetDocCatalogAttribute, $docCatalogGuid, 'docMimeType', $value->filetype);
                     $this->_updateCatalogAttribute($rowsetDocCatalogAttribute, $docCatalogGuid, 'fixedTitle', $title);
                     $this->_updateCatalogAttribute($rowsetDocCatalogAttribute, $docCatalogGuid, 'docViewOrder', 0);
                     $this->relateTo($docCatalogGuid, $catalogGuid, $relatedType);
                 }
             }
         }
     }
     /**
      * Copy|Use image
      * Untuk satu article satu image
      */
     if (isset($aData['fixedFileImage'])) {
         $fixedFileImage = $aData['fixedFileImage'];
         $fixedFileImage = basename($fixedFileImage);
         if (strpos($fixedFileImage, 'tn_') !== false) {
             $basename = str_replace('tn_', '', $fixedFileImage);
         } else {
             $basename = str_replace('thumbnail_', '', $fixedFileImage);
         }
         $guidBasename = pathinfo($basename, PATHINFO_FILENAME);
         $eiTitle = $aData['fileImage'] ? $aData['fileImage'] : '';
         $eslug = Pandamp_Utility_String::removeSign($eiTitle, '-', true);
         $rel = array();
         $relatedItemDb = new App_Model_Db_Table_RelatedItem();
         $relItems = $relatedItemDb->fetchAll("relatedGuid='" . $catalogGuid . "' AND relateAs='RELATED_IMAGE'");
         if ($relItems) {
             foreach ($relItems as $relItem) {
                 $catalogDb = new App_Model_Db_Table_Catalog();
                 $catalog = $catalogDb->fetchRow("guid='" . $relItem['itemGuid'] . "' AND status!=-1");
                 if ($catalog) {
                     $rel[] = $relItem['itemGuid'];
                 }
             }
         }
         if (isset($rel[0]) && count($rel) == 1 && $rel[0] == $guidBasename) {
             $rowEImageCatalog = $tblCatalog->find($guidBasename)->current();
             $rowEImageCatalog->shortTitle = $eslug;
         } else {
             if (isset($rel[0])) {
                 $this->delete($rel[0]);
             }
             // jika ingin mengganti gambar dari yang sudah ada
             $of = $tblCatalog->find($guidBasename)->current();
             if ($of) {
                 $cd = $of->createdDate;
                 $cb = $of->createdBy;
             } else {
                 $cb = $aData['username'];
                 $cd = date("Y-m-d H:i:s");
             }
             $rowEImageCatalog = $tblCatalog->fetchNew();
             $rowEImageCatalog->shortTitle = $eslug;
             $rowEImageCatalog->profileGuid = $aData['profile'];
             $rowEImageCatalog->createdDate = $cd;
             $rowEImageCatalog->createdBy = $cb;
         }
         $catalogEGuid = $rowEImageCatalog->save();
         $rowsetEImageCatalogAttribute = $rowEImageCatalog->findDependentRowsetCatalogAttribute();
         /**
          * @TODO docSystemName
          * digunakan sebagai inti|pemisah dari image
          * jika dia hasil copy dari catalog lain atau file original nya sendiri 
          * maka yg diambil adalah attribute ini
          */
         $this->_updateCatalogAttribute($rowsetEImageCatalogAttribute, $catalogEGuid, 'docSystemName', $basename);
         $this->_updateCatalogAttribute($rowsetEImageCatalogAttribute, $catalogEGuid, 'docOriginalName', App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($guidBasename, 'docOriginalName'));
         $this->_updateCatalogAttribute($rowsetEImageCatalogAttribute, $catalogEGuid, 'docSize', App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($guidBasename, 'docSize'));
         $this->_updateCatalogAttribute($rowsetEImageCatalogAttribute, $catalogEGuid, 'docMimeType', App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($guidBasename, 'docMimeType'));
         $this->_updateCatalogAttribute($rowsetEImageCatalogAttribute, $catalogEGuid, 'docViewOrder', App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($guidBasename, 'docViewOrder'));
         $this->_updateCatalogAttribute($rowsetEImageCatalogAttribute, $catalogEGuid, 'fixedTitle', $eiTitle);
         $this->relateTo($catalogEGuid, $catalogGuid, 'RELATED_IMAGE');
     }
     /**
      * @todo BLOCK solr core-catalog	
      */
     $indexingEngine = Pandamp_Search::manager();
     $indexingEngine->indexCatalog($catalogGuid);
     /**
     		 * @todo BLOCK New solr corehol	
             $registry = Zend_Registry::getInstance();
             $application = Zend_Registry::get(Pandamp_Keys::REGISTRY_APP_OBJECT);
             
             $res = $application->getOption('resources')['indexing']['solr']['write'];
             
             $esolr = new Pandamp_Search_Adapter_Esolr($res['host'], $res['port'], $res['dir4']);
             $esolr->indexCatalog($catalogGuid); */
     /**
     		 * @todo BLOCK solr shortenerUrl core3
             $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
             if (null === $viewRenderer->view) {
             	$viewRenderer->initView();
             }
             $view = $viewRenderer->view;
             
             
             // create shortener url
             $kopel 	= Zend_Auth::getInstance()->getIdentity()->kopel;
             
             $cfg 	= Pandamp_Config::getConfig();
             
     		$config = Pandamp_Application::getOption('resources');
     		$indexingConfig = $config['indexing']['solr']['write'];
     		$hukumn = new Pandamp_Search_Adapter_Solrh($indexingConfig['host'], $indexingConfig['port'], $indexingConfig['dir3']);
     		
     		$catalogAttributeDb = new App_Model_Db_Table_CatalogAttribute();
     		
     		$zl = Zend_Registry::get('Zend_Locale');
     		
     		if ($zl->getLanguage() == 'id') {
     			
     			if ($profileGuid == 'klinik') 
     				$url_content = $cfg->web->url->base.'/klinik/detail/'.$catalogGuid.'/'.$slug;
     			else if (in_array($profileGuid, array('kutu_peraturan','kutu_putusan','kutu_peraturan_kolonial','kutu_rancangan_peraturan')))
     				$url_content = $cfg->web->url->base.'/pusatdata/detail/'.$catalogGuid.'/'.$view->getLabelNode($folderGuid).'/'.$folderGuid.'/'.$slug;
     			else
     				$url_content = $cfg->web->url->base.'/berita/baca/'.$catalogGuid.'/'.$slug;
     		
     			
     		}
     		else if ($zl->getLanguage() == 'en')
     		{
     			$url_content = $cfg->web->en->url->base.'/pages/'.$catalogGuid.'/'.$slug(strip_tags(title));
     		}
     		
     		//$q = "url:\"".$url_content."\" kopel:".$kopel;
     		$q = "url:\"".$url_content."\"";
     		
     		$db = Zend_Registry::get('db4');
     		
     		$data = array('url' => $url_content,
     		 			  'createdate' => date("Y-m-d h:i:s"),
     					  'remoteip' => Pandamp_Lib_Formater::getHttpRealIp(),
     					  'kopel' => $kopel);
     					  
     		$hits = $hukumn->find($q,0,1);
     		if (isset($hits->response->docs[0])) 
     		{
     			$row = $hits->response->docs[0];
     			$hid = $row->id;
     			
     			$db->update('urls',$data,"id=$hid");
     		}
     		else 
     		{
     			$insert = $db->insert('urls', $data);
     			
     			$hid = $db->lastInsertId('urls', 'id');
     		}
     		
     		// indexing shortener url
     		$hukumn->indexCatalog($hid); */
     /*
     try {
     	
         $url = 'http://developers.facebook.com/tools/lint/?url={'.$url_content.'}&format=json';
         $ch = curl_init($url);
         curl_setopt($ch, CURLOPT_NOBODY, true);
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
         curl_exec($ch);
         $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
         curl_close($ch);
     	
     }
     catch (Exception $e)
     {
     	//die($e->getMessage());
     }
     */
     /**
      * Updated Dec 10, 2013 06:01
      */
     //$dir = $cfg->cdn->hol->static->url . DS . 'temp' . DS . 'cache';
     //Pandamp_Core_FileCache::clear($dir . DS . 'url');
     //Pandamp_Core_FileCache::clear($dir . DS . 'action');
     /*
     if (Pandamp_Pio::manager()->ping()) {
     	Pandamp_Pio::manager()->addEvent([
     		'guid' => $catalogGuid,
     		'category' => $profileGuid				
     	]);
     }
     */
     self::addCache($folderGuid);
     //after indexing, update isIndex and indexedDate in table KutuCatalog
     return $catalogGuid;
 }