Posted by Brian Dolan on Wed, Oct 07, 2009 @ 07:51 AM
Now that version 3 of Portal is out, the markup and annotations feature is available to those that upgrade. Now, that doesn't mean go out and install it immediately people! Always make sure to contact NAPC first before any upgrades and ya know what, we're here to install it for you any way! So, back to my point.
Portal 3, annotations & markups, yeah that's right!. It's a very cool feature that deserves it's own min-blog.
Let's make this easy . . . the notes below come directly from Xinet's release notes of Portal v3:
"WebNative Portal 3.0, in conjunction with WebNative 16.0, allows on-line annotations of all images,
documents, and videos. A palette allows users to add text, boxes, stamps, or sketches, and
all of the annotations can be done in black or a range of colors. When adding annotations, the
preview can be magnified for closer inspection. Individual annotations may be
saved (with or without comments), deleted, or temporarily hidden from view. The annotations are
stored in the Venture database, so any other WebNative user may access saved annotations
via mview in Portal but the annotations are not saved
to the file on the file system."
If you'd like to see a demo of this, please contact your Account Manager so we can arrange a quick demo. Just another reason to get Portal or upgrade to the latest version!
Posted by Sean Kenny on Thu, Oct 01, 2009 @ 12:37 PM
Sometimes it would be nice to know who is actively logged into your Xinet Portal Server. Unfortunately there is not a current tool offered to retrieve this information...until now!
Using a simple php script it's actually possible to scrape the current php sessions that have been created and obtain a list of users that have active php sessions in Portal.
A little background on this....
On Portal servers php stores it session data inside of th session directory /tmp, this is specified by the session.save_path ini variable. All session files start with the prefix "sess_". Inside of a session file you will find a plethora of serialized text data, that php is managing with its session functions. Although this serialized information is highly unreadable, is is still possible to pick some key data out of it, without needing to go through a deserialization process.
So basically for each user logged in via Portal, a corresponding session file will be created inside of the /tmp directory. Contained within this file will be useful information including the username. So at this point all we need to to is create a php script that will read all the php session files located on the server and displays the count of usernames that it finds!
php code that does this looks like the following:
<?php
//create an empty array to house our users in
$users = array();
//loop through all of the sesssion files found in the php session temporary directory
foreach(glob('/tmp/sess_*') as $session_file){
//get the contents of the sessions as a string
$session_data = file_get_contents($session_file);
//with a regex mine out the username contained within the session data
preg_match('/USERNAME.*?"(.*?)";/', $session_data, $matches);
//get the matched pattern out of the first grouping of the pattern
$session_user = $matches[1];
//if the found value is not empty then create the key for the array and/or increment the user count (users can be logged in multiple times)
if ($session_user) $users[$session_user]++;
}
//now that we have done the heavy lifting proceed to display the result with a simple foreach iteration over the users array that we have populated...
?>
<H1>Active Portal User Sessions</H1>
<UL>
<?php foreach($users as $username=>$count): ?>
<LI><?= $username ?>(<?= $count ?>)</LI>
<?php endforeach; ?>
</UL>
If You install this php code on your Portal Server you would get the following output.

This successfully displays all users currently logged into the Portal server.
As you can see, inspecting php sessions is a very useful technique for finding Xinet Portal user information, and using this technique it is possible to provide enhanced user tracking functionality.
Posted by Jason Palmer on Thu, Aug 20, 2009 @ 02:17 PM
Portal 3.0 Data
Interchange
Xinet is close to releasing the third iteration of their
popular platform, Portal, and with this release comes every developers dream –
an API.
Portal DI (Data Interchange), makes available all the core
functions of Portal such as:
·
Listing files/folders within a directory/volume
·
Listing volumes
·
Read and Update metadata attributes for files
·
File manager operations such as upload,
download, move, copy, etc.
·
Search
Xinet Portal 3.0 itself uses Portal DI to gather all the
information it needs to build the site interface!
How does it work?
Portal DI is a REST-based API that serves JSON formatted
data. What this means is that you
communicate with it using standard HTTP (GET or POST), and JSON formatted data
is interpretable by nearly every language known to man at this point! The simplicity of a REST-based API,
coupled with the accurate & widely accepted JSON formatting makes this API
truly a breeze to work with.
What can it do for me?
Portal DI essentially makes your DAM information
modular. Data about your assets
can be accessed from anywhere and that data can be used in a variety of
different ways. As a developer who
has been working with Portal for two years, I can’t explain how much easier integration
with third-party platforms will be with Portal DI.
Can you show me an example?
Below is a very simple example of how to retrieve a list of volumes for a particular user (in this case 'demo').
As you can see, Portal DI is both simple and powerful.