May 2012
M T W T F S S
« Nov    
 123456
78910111213
14151617181920
21222324252627
28293031  

Visitor Stats

13 today
720 to this page
3385 total

OScript : Custom Attributes

Here’s a brief guide on creating your own custom attribute types for Open Text Content Server (Livelink). If you know OScript this will be a breeze, but hopefully I’ve been succinct enough for it to serve as a useful memory jogger. I should say this is based on 9.7.1 but CS10 will give you the same. We’ll just create a new text attribute type which you can extend for your needs.

Assuming you have a new custom module you first need to orphan in the 2 main objects you will be using. Like Livelink objects with their LLNodes and WebNodes, there are two aspects to an Attribute – LLAttribute and WebAttribute. The former is implementing the attribute’s logic, the latter is its UI. Unlike nodes, the UI has 2 modes – the definition UI and the runtime UI.

So first, orphan LLIAPI:LLIAPI Root:LLAttribute into your module and call it MyModule LLAttributes

Orphan WebAttribute:WebAttribute Root:WebAttribute into your module and call it MyModule WebAttributes

Register a new Attribute Type ID with Open Text on their Knowledge Centre or risk just grabbing one of your own – if you ever install a 3rd party or Open Text module which uses the same ID you have a serious conflict problem.

Lets do the LLAttribute first …

If you look in the Documentation object for the LLAttribute there are a bunch of features you need to set. I find it easiest to add a setup script to populate all of these.

Create a new Child of your LLAttribute called, say, TextCustom
Add a new script called 0 setup

Populate the script as follows:


.fContainer = FALSE
.fDataType = $TypeString \\ storage type
.fDefaultShowInSearch = TRUE \\ up to you
.fEnabled = TRUE \\ ofc
.fInRootSetOnly = FALSE \\ if you want to use the attribute in Sets
.fName = "Text: Custom Text Attr"
.fSearchable = TRUE \\ if you want
.fSearchDisplayType = 0 \\ see Documentation object
.fType = 99999 \\ the unique ID you got from Open Text
.fUseRequired = TRUE // if this attribute uses the 'required' value during input
.fUseRows = TRUE // for Multi-Value Attributes
.fUseShowInSearch = TRUE // if the attribute uses the show in search option when editing


Now run it to populate the features.

So now we have a new LLAttribute. What about the UI? Create a new Child of your WebAttribute called the same as your LLAttribute (for sanity). This time there is already a WebAttribute 0 setup, but it needs filling in and a few more features added.



.fEnabled = TRUE
.fType = 99999 // like your LLAttribute
.fAttrCreateHTML = ''
.fAttrEditHTML = 'attreditstringcustom.html'
.fAttrPainterHTML = ''
.fAttrRunTimeHTML = 'attrstringcustom.html'
.fLabelValignTop = FALSE
// you can specify additional definition fields here, but that's for another post
.fPrototypeSubclassAttrCreate = { }
.fPrototypeSubclassAttrCreate2 = { $WebDsp.kCheckPost }
.fPrototypeSubclassAttrEdit = { }
.fPrototypeSubclassAttrEdit2 = { $WebDsp.kCheckPost }

At a minimum add the following to GetValueFromRequest to get the values from the attribute when it is submitted. Of course, depending on what it’s for, you may want to add all sorts of server-side validation or processing.


if IsFeature( request, fieldName )
    value = request.( fieldName )
    if Length( value ) == 0
        value = UNDEFINED
    end
end

We’re nearly there. Now you need the weblingo in place to create your attribute and to use it. I would suggest copying the attreditstring.html and attrstring.html from the Web Attribute module’s /html folder. Name them as set in your fAttrEditHTML and fAttrRunTimeHTML. Edit these 2 files to your heart’s content to give the UI you want. If you want the Runtime one to behave differently while in “Painter” mode (rather than use fAttrPainterHTML) you can always put conditional logic around if ( request.Painter )

Finally, you need to tell the system where this new attribute can be used. In the Startup script for your module add:

$lliapi.LLAttributeSubsystem.AssociateTypesByCustomID ( 0, { $AttrTypeTextCustom } )

0 = Categories
2 = Workflows
3 = Forms

This is done from memory and looking at a vanilla Builder. Expect tweaks and clarity. Feedback welcome to make the article better or to fix broken bits ;-) You will get credit and links back … Greg!

Android : Setting up for Android Development

This is a distillation of the excellent Installing the SDK on http://developers.android.com. It’s adapted to my own installation paths and I’ve stripped it down to what you are actually doing – I’m sure you can work out exactly when to press Next, Next, OK etc.

I’ll not going tell you how to arrange your hard disk. For my part I put all Android related files in one place, so I started by creating an ..\android folder and an \installers sub-folder of that. It should be noted that Eclipse is highly configurable and doesn’t have an installer as such. It is highly advisable to keep your Eclipse folder separate from other users or other uses. For the record, all my Android stuff is in My Documents.

Preparation

Download the following to ..\android\installers:

Java SE Development Kit
Eclipse IDE
Android Software Development Kit (Android SDK)

Obviously, you could delete or archive the \installers folder once you are up and running, but I like to keep them about for reference. I also gradually download other tools to this location. It’s also useful to be able to maintain your own private installation suite if you want to re-install, to another system, maybe.

Install Java

Run the Java SE Development Kit installer. Default paths are fine.

Install Android SDK

Install the Android SDK. I installed to ..\android\sdk, but wherever you put it remember the path as you need it to set up the Android Development Toolkit (ADT) Plugin for Eclipse.

Install Eclipse

Create an ..\android\eclipse folder. Unzip Eclipse to this folder. There is no installer, you just run Eclipse.exe to use it. You may of course, want to create a shortcut somewhere.

Create an ..\android\workspace folder.

By now, if you did stuff my way you will have:

..\android
..\android\installers – where you put your downloads
..\android\sdk – where you installed the Android SDK
..\android\eclipse – where you unpacked Eclipse
..\android\workspace – we will make Eclipse store our applications here when prompted

Configure Eclipse

Start Eclipse

  • Set the workspace folder to your ..\android\workspace
  • Choose Help > Install New Software…
  • Click Add
  • Enter https://dl-ssl.google.com/android/eclipse/

Next is to tell the ADT plugin where you installed the Android SDK.

  • Choose Window > Preferences …
  • Select Android
  • Proceed after expressing your preferences about sending usage statistics
  • Now browse and set the Android SDK location

Configure Android SDK

You need to download Android SDK packages for the environments you want to target development. At the moment I’m sticking with 2.3 as all this is driven from me buying a Samsung Galaxy S2 … which runs 2.3. You may also want to take Android 4 as it is imminent.

Run the SDK Manager.exe found in the Android SDK folder. This can also be run from the Eclipse Window menu. Choose your target platforms.

Create Android Virtual Device

Finally, let’s create an Android Virtual Device (AVD) on which to run our applications. Start the AVD Manager.exe either from the Android SDK folder or from the Window menu in Eclipse. I’m creating 2.3 devices with HVGA screens at the moment.

Gadgets : Samsung Galaxy S2 and Android 2.3

Choosing a mobile phone is never easy. Choosing a smart phone is even harder. To make matters worse, there is more to lose if you get it wrong, with the best phones now costing several hundred pounds unlocked or binding you into lengthy contracts. You really want to get it right. To make matters more difficult there is rampant tribalism between iOS and Android fans which bring more heat than light to the debates and the reviews.

samsung_galaxy_sii
That said, is this going to be a Samsung Galaxy S2 rave? I hope not, but I hope it will help at least one person happy with their choice of new phone – whether iOS 5 or Android 2.3.3.

So some background; where I’m coming from. I’m a bit of a techy, working in IT. I am online every waking minute, one way or another. I bought by first iPod in 2005, iPod Touch in 2008 and iPhone 3GS in 2009. The latter on a 24 month contract. So this month it was time to update. I waited eagerly for the iPhone 5 last month, but the iPhone 4S made me stop in my tracks and have a think. I guess it was just bad timing for my time with Apple. I didn’t want a long binding contract if there was going to be an iPhone 5 next year, and I didn’t really want to fork out on an unlocked iPhone that was marginally different from my iPhone 3GS now running iOS 5 and iCloud etc.

I asked colleagues what was a good Android phone at the moment, and the consensus was Galaxy SII was strong competition for the iPhone 4S being dual processor, great screen and with good storage. However, the Samsung Galaxy Nexus was supposed to be imminent with the new version of Android “Ice Cream Sandwich”, which bring together the Smart Phone version of Android and the Tablet version of Android. See Wikipedia for details.

But there is also the Galaxy S3 in the pipeline – probably waiting to face up to the iPhone 5. And I got the feeling the Galaxy Nexus was little of an improvement over the Galaxy S2. The clincher was the Galaxy S2 price collapse to under £400. So time to do some research on whether I would get on with Android.

1. Can I get my favourite apps?

Checking out the Android Market, everything was there – Facebook, DropBox, bank stuff, etc. Gmail built-in.

2. Could I sync my iTunes library, playlists, podcasts and album cover art?

Certainly some options. Easy Phones Tunes and iSyncr looked promising

3. Some games to pass the time at airports?

Most of the same options as AppStore as far as I could tell. Maybe a few high-end graphics games more favoured on AppStore. Possibly because the iPhone features a slightly better GPU.

4. My 8GB iPhone was stuffed full; what cost more storage?

The Galaxy S2 takes a Micro SDHC card which is available up to and including 32GB. The newer format Micro SDXC (32GB and upwards) is not compatible – careful, don’t muddle the 32GB cards. At only £24 the 32GB card is good value. Media and most apps can be stored on the Micro SDHC. The internal “USB” storage and the external Micro SDHC card are mountable in Windows via USB.

So, time to get hands on in the store to see how the hardware feels.

Display
Beautiful display. Bigger than iPhone, but slightly lower resolution. Little in it between them.

Size
Larger (to take that screen), thinner. Feels less industrial in the hand. I’m getting used to holding a mini-tablets to the side of my head as phones.

Weight
Lighter the the iPhone 4S. Sits nicely in the jacket pocket. I wonder if I’ll be less conscious of it and forget it’s there?

Build
The plastic body and back make it feel less robust than an iPhone, but I know too many people that have cracked the backs of their iPhones. Again down to preference I think.

Takes the plunge. £400 online, next-day delivery.

First Impressions

Looks and feels gorgeous. Response is nice. Screens flick sideways like the iPhone. It’s going to be ok.

Main Differences in Use

You move icons by holding then dragging them. Nice touch is you can re-order the screens as a whole, rather have to move all the icons around.

You don’t have to have all your apps on the screens – they can be access through the Applications button.

You can have “widgets” on the screens. These can update with information or access phone features or launch apps. I particularly like to be able to create widgets to toggle Airplane Mode or toggle Bluetooth. Clocks, Stocks, Weather and Facebook widgets all fun to set up and play with. Useful Media Player and News widgets.

Alongside the “Home” button at the bottom centre on the phone are “Menu” and “Back” soft buttons.

I have a vague feeling that the sensitivity of the iPhone screen to touch is slightly lighter, but is marginal.

The Samsung recommended (and free) Easy Phone Tunes was a bit of a faff as you had to mount the USB drives. The iSyncr application worked seamlessly – allowing me to choose whether to sync playlists to built-in storage or the card. The free version limits you to sync one playlist and no podcasts. For a few pence extra I can now sync to iTune over WiFi.

Big Likes

  • The built-in web server that allows me to manage my phone from a desktop over WiFi
  • The flexibility of the User Interface – widgets, icon management, custom launchers (User Interface), skins, themes, animated backgrounds, etc
  • The fact that you can un-purchase apps for 15 minutes via the Android Market software if you don’t like them. You can Report a Problem with iTunes apps through Account Management too, but it’s not as easy to use.
  • That I can fit a 32GB Micros SDHC card
  • That I can mount the built-in and card storage in Windows
  • The web browsing experience is more like the performance on a PC. Note: this is with the same SIM moved from my iPhone – there’s something seriously wrong with web browsing on an iPhone.
  • WiFi iTunes sync
  • I get my WiFi scanner functionality back. Apple iOS 5 blocked this. In fact, it’s better (WiFi Analyzer – nice graphs of signal over time and signal per channel)

Any Dislikes?

Well there is no such thing as a perfect phone! So I’ll do my best.

  • The GMail app needs to come a long way. I suspect it will. I might look for a better email app in the meantime.
  • Mounting and unmounting the storage needs to be simpler. If I was using it a lot it would get tedious. Just as well iSyncr is over WiFi.

Conclusion

  • I have a slight feeling of release from Apple – I was getting increasingly nervous of how ring-fenced the iOS world is.
  • Technically, there is little to choose between the 2 phones.
  • If I was not a technical user I think I would find the Apple phone easier to use, but there is little in it. It’s more that you can fiddle more with Android – if you want.
  • Good value, and with loads more storage.
  • iTunes now easier to use – ironic

I’m looking forward to weighing up Apple iPhone 5 and Samsung Galaxy S3 as that will be a battle of giants. It’s great to see a strong competitor to Apple’s slick and smooth iOS. Unless Apple comes up with something major, they have a tough fight to better Samsung – especially as the S3 will be sporting the new version of Android. That said, if the Galaxy lets me down in time, I might be back to the comfortable and reliable iOS.

Updates:
13th Nov 2011 – Internet access – web browsing on the Galaxy S2 works properly. I now realise how shockingly bad iOS was. In fact, I put the phone SIM back into my 3GS to check. Maybe the 4S is better?
12th Nov 2011 – GO Keyboard and GO SMS Pro installed – both very nice. The rest of the GO Apps may need check out.
11th Nov 2011 – Have reverted to the stock Email application – so much better than the GMail one.

Can I use Sharepoint 2010 as a Document Management System?

Can I use Sharepoint 2010 as a Document Management System?

WordPress : Pagic Refresh

I had noticed recently that Pagic’s blog post Comments had self destructed – you got all of them on one post, or none. No better excuse to bring the versions of all modules up-to-date. The Atahualpa theme upgrade fixed the Comments issue.

Of course, once you start these things you see more that you should do. WordPress itself was a few versions old, so after a quick search to see if there was any “upgrade issues” noise on the web, I backed up the database and site root, then hit the “Upgrade Automatically” button … and held my breath.

WordPress never ceases to please. Within a few seconds it had ftp’d the new version into place and run its upgrade scripts and returned looking as good as new. A few more nice close-ups of plants added to the random banner image selection, too. I really should do a Pagic logo … hmm

WordPress : New Project

Last week I had the chance to put together a new WordPress site, building it from the ground up. It always amazes me how powerful, and at the same time, easy to use, WordPress is. So here are the steps:

  1. Rent space at a host (www.purplecloud.com, in this case) with PHP and mySQL
  2. Register a domain with the host
  3. Download the latest WordPress zip
  4. Unpack
  5. FTP to the host
  6. Create a database and user at host
  7. Edit the config file for WordPress for Database, User and Password
  8. Go to the install page

Bingo!

I did make the mistake of applying the new domain name after I set up WordPress. I had to use the phpMyAdmin tool provided by the host to edit a field in the WordPress tables so that I could login again. D’oh!

Next, some plugins for more functionality:

All in One SEO Pack – makes SEO simple
Enhanced Meta Widget – I don’t like the default “Tools” sidebar widget
NextGen Gallery – a great photo album tool, with loads of easy-to-use admin functions
StatPress – to keep an eye on who’s visiting and what for
Contact Form – for a simple feedback form on the About page

  1. Download, unpack and FTP to plugins folder at host
  2. Configure through the WordPress Plugins page
  3. Add the new Widgets or pages

Now a theme/skin:

  1. Download a selection from WordPress.org
  2. Unpack
  3. FTP to themes folder under wp-content at host
  4. Select each by clicking them on themes page
  5. Demo them to client until we had something close to what we wanted

Next to tweak the PHP and CSS – which can be done live on the site using the built-in editor that comes with WordPress. You need to tweak file access permissions while you make the edits.

Customer (admittedly, my brother) happy with features and ease of update and maintenance – I didn’t need to help with content at all – it’s all in the customers hands. In fact, with advanced Web Content Management tools like WordPress, people are forgetting how hard it used to be to code all this.

End result at http://www.redcoat-fineline-art.com

Builder : Installation and Launching

Once you have a Livelink server installed, you can install the OScript development environment known as Livelink Builder. You should source this from Open Text as an installation executable, which at time of writing is:

livelink_builder_9.7.1_WIN.exe

When you run this installer, you will be prompted to confirm the target Livelink instance. Builder’s documentation will be installed in a \builder\ folder in your Livelink server application root directory. You should also end up with a Start Menu shortcut to launch Builder under the Livelink Enterprise Server menu. If you lose this, it contains the following command (assuming Livelink is installed to C:\opentext\livelink):

C:\opentext\livelink\bin\llbuilder.exe webbuilder.lxe C:\opentext\livelink\config\opentext.ini

That is, the executable, followed by 2 parameters:

  • the startup script to use
  • the full path to your Livelink Server’s opentext.ini file

If, when you start Builder, the Livelink Server service is already running, you will be prompted to stop it. The Livelink Admin service can be left running, or not started. Many developers prefer not to have Livelink Admin up, unless they actually require it’s function. Mainly because it writes to the debug window which you may be using while doing development.

If you require the java vm to be running when using builder – for dependent functionality such as “Zip & Download”, add the -loadjavavm switch after the opentext.ini parameter in the command line.

Builder can be used to write custom modules, or edit, breakpoint and single step WebLingo files, examine the content of variables and automate common development functions with lxe scripts.

WebLingo : What is Livelink WebLingo?

Livelink WebLingo is the server-side scripting component of Open Text’s Content Management Server – formerly called Livelink.

Livelink page requests are received and processed by the Livelink Server service and a response data object is constructed. This response data is applied to a WebLingo file (more usually multiple nested WebLingo files) to generate the final output for the client’s browser.

WebLingo usually looks fairly similar to HTML, but with added server-side processed elements in OScript – Livelink’s proprietary language. This language includes all the usual features such as variable declaration, control structures, function calls (to functions defined in the WebLingo; but also to functions built into Livelink itself – maybe core code, add-on module code, or custom code) and output.

OScript can be included as defined script blocks, as individual server-side script lines or as variable replacements.

Other WebLingo files can be invoked in a similar way to includes, passing data structures to the called files.

The final output of the processed WebLingo file (generally html, css and JavaScript) is sent to the browser that originally posted a request.

OScript : Assoc basics

So, finally, a beginners guide to the OScript Assoc data type. An Assoc is difficult to describe so I’m best covering it with plenty of samples. The best description I can think of is a structure of name/value pairs where the value can be any type of data type, including an Assoc! There is slightly more to it inasmuch as you can specify the “Undefined” returned value, and you can treat an Assoc as a type of Array.

So lets create one and build it up a bit. This sample is common in OScript:

function Assoc getSomething()
    Assoc retval = Assoc.CreateAssoc()
    Boolean ok = TRUE
    String sGetText = 'Hello World'
    String errMsg = ''


    if ( ... anErrorHappened ... )
        ok = FALSE
        errMsg = 'something REALLY bad happened'
    end


    retval.ok = ok
    retval.error = errMsg
    retval.data = sGetText


    return retval
end

Here’s a function that returns an Assoc with values called “ok”, “error” and “data”. “ok” is a Boolean, and “data” happens to be a string, but it could be anything.

OScript is not easy to error handle. The try/catch arrangement that most people are comfortable with doesn’t exist. So each time we call a function it’s useful to pass back a structure that informs the caller if there was a problem. We could use the above function like this;

Assoc myData
myData = getSomething()
if ( myData.ok )
    ... carry on and do something else
else
    echo ( myData.error )
end

You can take a look at the structure of your Assoc by echoing it to the debug window, or if you’re messing around in WebLingo output it to the page:

echo ( Str.ValueToString ( myData ) ) // Builder

or

`Str.ValueToString ( mydata )` // WebLingo

It makes sense, no?

So what else can you store in your Assoc. Just about anything! Here’s some more code:

Assoc aData = Assoc.CreateAssoc()
Assoc aCar = Assoc.CreateAssoc()
aCar.Make = 'Audi'
aCar.Model = 'A4 Quattro'
aCar.Color = 'Black'
aData.aNiceCar = aCar

Be careful with this, if you change aCar, you change aData.aNicecar. So you can’t change aCar, then add it to aData as another, different car.

To reference an item in the Assoc just run down the structure using dot notation:

sCarColor = aData.aNiceCar.Color

You can add a more complex structure to your Assoc. Here’s a List:

List lMakes = {'Audi','BMW','Mercedes'}
aData.AvailableMakes = lMakes
// output the list using iteration
String make
for make in aData.AvailableMakes
    echo ( make )
end
// or output the list using index
Integer iMake
for iMake = 1 to Length ( aData.AvailableMakes )
    echo aDataAvailableMakes[ iMake ]
end

Now we can get really complex, and believe me, Open Text like to – just take a look at a CategoryFrame object!

Here’s the last OScript sample on German cars:

List lCars = {{'BMW','5 Series'},{'Audi','A6'}} // a list of lists
Assoc aCars = Assoc.CreateAssoc() // create the Assoc
aCars.Models = lcars // attach the list to the Assoc
echo ( aCars.Models[ 1 ][ 2 ] ) // output an element

Enough for now!

Blog Print Preview

Added WP-Print plugin to the site and configured it in the Atahualpa theme:

  • Go to Appearance
  • Atahualpa Theme Options
  • Post/Page Info Items
  • Add %wp-print% to all the Byline sections

Gotta love WordPress :-)