Hello Fabrik Community
Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.
Exciting times to be sure.
The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section
We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..
Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.
.png, .jpeg, .gif
// use Joomla file utils
jimport( 'joomla.filesystem.file' );
// get the original file and split it into parts
$old = ($formModel->formData['file']);
$oldParts = pathinfo($old);
// in this example we're using the id as the new filename
$sid = $formModel->formData['id'];
//create the new file (path and name)
$new = $oldParts['dirname'].'/'.$sid.'.'.$oldParts['extension'];
// update the file itself
JFile::move(JPATH_SITE.$old, JPATH_SITE.$new);
// update the data
$formModel->updateFormData('file', $new, true);
// update the db
$object = new stdClass();
// Must be a valid primary key value.
$object->id = $sid;
// new path + name
$object->file = $new;
// Update the data in the db
$result = JFactory::getDbo()->updateObject('ep_submission', $object, 'id');
/* 11/30/2014 by pastne - based on wiki form plug-in example
Plug-in to re-read submitted file from disk
then run it through apache tika to retrieve text of document
then update the form field and database with the tika
generated full text. This will cause the database to
index based on fulltext indexing. This plug-in fires
after file upload has landed on disk.
*/
// import the joomla file system
jimport( 'joomla.filesystem.file' );
//grab the filename from the form (my element name is filename)
$filePath = JPATH_ROOT . ($formModel->formData['filename']);
//set the full path to the tika-app.jar java run program (this is where I put the jar)
$tikaAppPath = '/var/www/html/tika-app.jar';
//build a command command string with expansion
$command = "((cat '" . $filePath . "' | java -jar $tikaAppPath --text) 2>&1)";
//execute the command and capture out to $execOutArray
$status = exec( $command, $execOutArray );
//convert the output array to compact space delimited trimmed string
$execOut = preg_replace('/\s\s+/', ' ', implode(' ', $execOutArray));
//grab the database record id
$sid = $formModel->formData['id'];
//update the fullText form element with the trimmed Tika text
$formModel->updateFormData('fullText', $execOut, true);
// instantiate a new database object
$object = new stdClass();
// set the key for the database record to the value of $sid
$object->id = $sid;
// set the fullText element of the object to the tika trimmed result
$object->fullText = $execOut;
//push the updated object to the database using the Joomla JFactory class (my list name is fmp_msds)
$result = JFactory::getDbo()->updateObject('fmp_msds', $object, 'id');