More Flexy loveliness = Categorized with Summaries

>> 14 July 2009

In the last post I popped up an example of categorized views and in this we will add the additional functionality of Summaries.

To recap the last post

01. Create a GroupCollection object

02. Assign a source property of the Group Collection object to the AdvancedDataGrid's dataProvider

03. Create a New Grouping Object

04. Create a new GroupingField Object or Objects that specify the field(s) on which to group

05. Assign the Grouping property of the GroupingCollection to the Grouping Object

06. Refresh the Grouping Collection

07. Assign the GroupingCollection to the Dataprovider or the AdvancedDataGrid.

But what if you want to have some summarised .. well that is relatively easy too. Lets try for this.. With summary data at the end of each category


Ok Lets go.

01. I go to the GroupingField definitions I created yesterday
Originally it looked like this <mx:GroupingField name="cat"/>

02. I drop the / from the end and create a tag pair
<mx:GroupingField name="cat">
&lt/mx:GroupingField>

03. Inside this tag pair I create a <mx:summaries> and </mx:summaries> tag pair

04. Inside the summaries Tags i create a <mx:SummaryRow summaryPlacement="last"> tag pair.. Note the SummaryPlacement attribute. "last" will place it at the end of the category and "first" will put it and the start.

05. Inside the SummaryRow i create a <mx:fields> tag pair

06. Inside the fields tag pair i create
<mx:SummaryField dataField="qty" operation="SUM" label="summary" />
The source of the data is set in dataField which in this case is the "qty" field in the XML pulled from the domino agent.
The Operation is "SUM" (or totalise all the QTY values in the category) other options can be MIN, MAX, AVG and COUNT

07. I repeat 1-6 for the other field "subcat" that I am summarising on

08. Your code will now look like this.

<mx:Grouping>
<mx:GroupingField name="cat">
<mx:summaries>
<mx:SummaryRow summaryPlacement="last">
<mx:fields>
<mx:SummaryField
dataField="qty"
operation="SUM"
label="summary" />
</mx:fields>
</mx:SummaryRow>
</mx:summaries>
</mx:GroupingField>
<mx:GroupingField name="subcat">
<mx:summaries>
<mx:SummaryRow summaryPlacement="last">
<mx:fields>
<mx:SummaryField dataField="qty" operation="SUM" label="summary" />
</mx:fields>
</mx:SummaryRow>
</mx:summaries>
</mx:GroupingField>
</mx:Grouping>
09. Now i am going to use a flex function called a rendererProvider, which is a MXML component that is used to render a particular item in your project.

10. I create a new MXML file called SummaryText.mxml in a subdirectory called Renderers off the directory i have my main MXML file in.

11. The code looks like this and basically all it is , is a LABEL component the which will display the total that is calculated for the category. Note the {data.summary} the .summary refers back to the LABEL I used in the <mx:SummaryField> statement above

<?xml version="1.0" encoding="utf-8"?>
<mx:Label xmlns:mx="http://www.adobe.com/2006/mxml"
text="Total Quantity {data.summary}">
</mx:Label>
12. Having saved the SummaryText.mxml file I return to the AdvancedDataGrid definition in my main MXML file. Just above the closing </mx:AdvancedDataGrid> tag I create a new set of tags that attach the renderer to the AdvancedDataGrid. the code looks like this

<mx:rendererProviders>
<mx:AdvancedDataGridRendererProvider
dataField="summary"
columnIndex="1"
columnSpan="2"
renderer="Renderers.SummaryText"/>
</mx:rendererProviders>
Of note here is the the dataField attribute points at LABEL I used in the <mx:SummaryField> definition (and beware it IS case sensitive)
Also if i set the columnSpan to "0" it will span all columns in the grid. I have chosen 2 here cos it looks better in the finished application.
Also the renderer attribute is made up of [the path to the renderer MXML file].[File name without extenstion] beware this too is case sensitive.

13. Once that is done ... compile up your app and there you have it.. summary values in your view. Note this is all done by FLEX as I have NOT changed the agent that supplies the data from the Domino application.

I have Popped this into a NSF and zipped it up with the Flex Builder 3 project files if you want to have a look see.. This is the same file as yesterday.. except the summarised page is FlexView2 ad the SWF is called CategoryView2.swf.. you can get it here .. Same provisio as yesterday, This will NOT work on your server as you need to change the URL for the HTTPService object and recompile the SWF for it to work!!! Enjoy and again if you have any questions drop me an email :-)

Read more...

Categorised Views in Flex - It's really easy

OK .. a Flex Post for youse in Domino land.

First some stuff about the what I used.

Flex 3 SDK
Notepad ++
Domino 8.5.0 server
Domino 8.5.0 DDE

I was asked recently how I would FLEX a multi-category expand/collapsible view which is admittedly dead easy in the Notes Client. Well it is almost as easy in Flex.

This is what I did to illustrate the method.

01. I created a form that looks like this


02. I created a view that looks like this

03. I created an agent that does this
04. I opened Notepad++ and created a file called CategoryView1.mxml and typed up these 47 lines of code

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="myData.send()">
<mx:HTTPService id="myData"
url="http://www.unseenuni.com:81/flexview.nsf/getdata?openagent"
result="dataResult(event)"/>
<mx:Script>
<![CDATA[
import mx.controls.Text;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent
import mx.collections.ArrayCollection
[Bindable]
private var items:ArrayCollection = new ArrayCollection
private var msg:String
private function dataResult(event:ResultEvent):void
{
items= event.result.items.item;
myGroup.refresh(true)
}
private function dostuff(event:MouseEvent):void
{
if(event.target.data.key)
{
msg = event.target.data.key
mx.controls.Alert.show(msg)
}
}
]]>
</mx:Script>

<mx:AdvancedDataGrid x="10" y="10" id="Grid1" designViewDataType="tree" width="719" height="343" creationComplete="myGroup.refresh()">
<mx:dataProvider>
<mx:GroupingCollection id="myGroup" source="{items}">
<mx:Grouping>
<mx:GroupingField name="cat"/>
<mx:GroupingField name="subcat"/>
</mx:Grouping>
</mx:GroupingCollection>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn headerText="Item" dataField="item"/>
<mx:AdvancedDataGridColumn headerText="Qty" dataField="qty"/>
<mx:AdvancedDataGridColumn headerText="Price" dataField="price"/>
</mx:columns>
</mx:AdvancedDataGrid>

</mx:Application>

05. I compiled up the mxml to a SWF using the SDK (a lot easier if you use FLEX BUILDER!)

06. I Imported the resulting file CategoryView1.swf as a File Resource in my NSF

07. I created a Page in my NSF with this Passthru HTML
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="CategoryView1" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="CategoryView1.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="CategoryView1.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="CategoryView1" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>

08. I fired up a browser and went to the page's I just created URL and this is what appeared.



It really is that easy... So lets look at this in detail.

The Domino agent returns nice simple XML - have a look at ../flexdata.nsf/getdata?openagent and you will see it in "raw" form, althought the parent view is sorted it is not categorised it is an ordinary flat view. We will let Flex do the sorting and grouping once it gets the data.

The MXML is only 47 lines long and was created as follows :-
(replace [] with < adn >)
01. I created an application

[mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"]

[/mx:Application]


This defines the application and it is always like this, note the tag pair is closed!


02. Inside the application tags I place a definition of the HTTPService I am going to use to provide the data to the application


[mx:HTTPService id="myData"
url="http://www.unseenuni.com:81/flexview.nsf/getdata?openagent"
result="dataResult(event)"/]


This breaks down into
id this is the id by which I will refer to the service later in the code
url this is the URL which will provide the data
result this is the actionscript code that will run when data is recieved from the url

03. The next section is the Actionscript code that my flex application will use

<mx:Script>
<![CDATA[
import mx.controls.Text;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent
import mx.collections.ArrayCollection
[Bindable]
private var items:ArrayCollection = new ArrayCollection
private var msg:String
private function dataResult(event:ResultEvent):void
{
items= event.result.items.item;
myGroup.refresh(true)
}
]]>
</mx:Script>


Firstly I import the various Adobe Supplied libaries that i will need
Then I create a Bindable ArrayCollection object call items, this will store the returned data.
Then I define the dataResult() function that I attached to the HTTPService object. Remember this code gets executed when the URL in the HTTPService recieves data from the URL. In this instance the items ArrayCollection is loaded with the data returned from the URL. FLEX will see it as XML and I can access it through the event.result object by name.

04. Now I define my on screen objects

<mx:AdvancedDataGrid x="10" y="10" id="Grid1" designViewDataType="tree" width="719" height="343" creationComplete="myGroup.refresh()">
<mx:dataProvider>
<mx:GroupingCollection id="myGroup" source="{items}">
<mx:Grouping>
<mx:GroupingField name="cat"/>
<mx:GroupingField name="subcat"/>
</mx:Grouping>
</mx:GroupingCollection>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn headerText="Item" dataField="item"/>
<mx:AdvancedDataGridColumn headerText="Qty" dataField="qty"/>
<mx:AdvancedDataGridColumn headerText="Price" dataField="price"/>
</mx:columns>
</mx:AdvancedDataGrid>


I use the AdvancedDataGrid because it has support for Grouped (read Categorised Objects) you will not I do not ascribe a datasource to the AdvancedDataGrid Object. Instead I create a DataProvider object INSIDE the AdvancedDataGrid Tag pair! very important than!

Inside the DataProvider Object I create first a GroupingCollection object, I would do this even if I had only one category. Inside that I define a Grouping object and then as manu GroupingField objects as I need. In this instance the Fields Cat and SubCat.

I then define the Columns I want to display. Note i do NOT include the columns that will be my groups!

And that is it... compile it up, stick it in your NSF and Robert is your mother's brother.

I have uploaded the NSF and FLEX BUILDER PROJECT here.. but the NSF will not work on your server unless you change the URL in the MXML from my server to your own, recompile the SWF and delete the orginal SWF from the NSF and attach the new one as a new file resource.. i include it only so you can see the code not run it :-)

If you have any questions just drop me a line ... enjoy

Read more...

Tinariwen - New Album Companions - 5 Star wonderful!

>> 12 July 2009

I discovered the Tuareg Poet / Guitarist legends Tinariwen last year and YIPEE a new album is out.. This is Lulla from the new album "Companions" If you like new exciting sounds give it a listen close your eyes and think desert ... enjoy

Read more...

Some thoughts on Tradition

I have recently returned from a business trip to the far east and arrived back just in time for the annual tradition of the 12th of July. The "Glorious Twelfth" as it is known in some circles is the traditional celebration of the The Battle of Boyne in 1690 when the Protestant King William of Orange gave the Catholic King James a bloody nose. Now it was far from the simple matter of two denominations of Christianity being belligerent, it was more about the power of the royal families in Europe at the time. In fact Pope Alexander VIII lent King William troops for the war against King James. King William and the Pope and several other countries were in the League of Ausburg which was set up to defend the Palatinate of the Rhine from the French. A fact sadly lacking from the history expounded by organisations like the Orange Order who much prefer the world view that the Battle of the Boyne was a "Protestant Victory for a Protestant People" which is in fact a load of revisionist knob cheese, but what is a bit of revisionism when it is the absolute right given by God and justified by Luther, Calvin, Knox and the tooth fairy to be a raving bigot at the drop of a bowler hat each July.

I overheard a conversation at the airport where a grandmother was telling her grandchildren of the "good old days" when her grandfather paid her 1 old penny each time she sat on his knee and shouted "To hell and the flames with the pope and all Catholics". Ah yes the good old days of vitriol and hatred ... such a fine gift to pass on to one's children!

When I was a teenager if you travelled outside the streets where you were known it was inevitable that you would be asked "What are you?". Now for other traditional forms of hatred like racism it is easy to pick your targets by visual cues alone. Picking which person to abuse is harder when based on religion hence the blunt interrogative method. It became second nature for most to quickly work out who was doing the asking and switch sides accordingly, this whilst being ethically suspect was a sure fire way to avoid getting a black eye or worse. Needless to say one had to learn the responses to the follow up questions of "Well sing the Sash" or "Say the hail Mary" but that was a small price to pay.

You could not answer "neither", that was not an option, you could not sit on the fence. You had to plant yourself firmly on one side or the other and be prepared to defend that position from all comers, needless to say expressions of distrust or outright hatred of the "other" side were mandatory if you were to be believed.

As a callow youth the painful experience of having to fight off both sides soon lead to the my questionable position of variable allegiance, although in hindsight I was put in the position of having to repeat parrot like the vitriol of one side or the other, something I could not and hopefully would not allow myself to do now.

Now do not get me wrong, tradition can be a wonderful thing. The traditions of openness, friendship, philanthropy and generosity of spirit are fine things to pass on to the next generation. Such traditions are the glue that holds societies together and makes them work. However on the other side of the coin are the traditions that are divisive, that are driven by the sure and certain knowledge that your tradition is the ONLY one that is right, the only one that is useful and in this case that it is the only one that is God Given to you and your side only.

Traditions are dangerous when they are the only thing that defines who you are. I do not define myself by the country that I live in, nor do I wrap myself in the dubious comfort of a flag, as this only succeeds in hiding me from others. If I was holding that tightly onto a flag how could I hug a stranger or extend them the hand of friendship?.. and there is the rub ... i do not think that is part of the traditions I see unfolding each July. There are no hands of friendship, no hugs expect for those in your tribe. It is all inward looking, incestuous, foetid reinforcement of generationally transmitted regligious hatred and distrust.

Tomorrow, tens of thousands of bowler hatted, white gloved men will march behind banners that display their commitment to the British monarch (but ONLY with the strict condition that the monarch is Protestant, or more exactly, not Catholic) and commitment to the Bible (the protestant one not the catholic one). The banners they march behind will be flanked by men carrying swords and pikestaffs in rememberance of those that were killed and the fact that they needed to be killed to protect the faith. There will be marching bands playing military marching tunes mixed with sectarian anthems, some of which will have words that call the listener to arms to defend with violence the God given right to be Protestant. There will be acts of worship in which ministers will pillory the "church of rome" and declaimed it as the worst evil in the world. There will be speeches where the leaders of the Orange tribes will extole their members to stick together for God and Country at all and any cost.

This is not a tradition I want any part of.

Read more...

Oh Joy .. here comes July :-( or "The Joy Of Flags"

>> 22 June 2009

I am sat here in my front room watching some chaps who don't live on the estate hang flags on the lamp posts. This is because it is only a couple of weeks until that annual orgy of all things "orange" and "protestant" gets under way.

This year there are a lot less flags, mainly due to the fact that when the wee toerags whose appear to communicate in monosyllabic grunts, groin scratching and positioning of a Burberry/Rangers FC baseball cap at varying angles upon their echoingly empty heads, came to the door and asked "wannagiveussomemoneyfurdeflagseh?" I, like many of my neighbours when we had taken a moment or two to decrypt this strange request replied "Ah no". This could be because folks are a bit strapped for cash this year or it could be that being surrounded by 100's of flags all flapping in the ever present Norn Iron wind roughly level with your bedroom window was just a bit intrusive. "Tradition" or not, sleep deprivation can be a right royal pain in the arse.

Now it has to be said we have a plethora of flags and for some it is a requirement equivalent with breathing that they fly every fecking one from every lamp post in the province.

At the top of the heap the Union Jack, the flag of the "United Kingdom of Great Britain and Northern Ireland" to give it the full rather boring name.. this one
Then you have the "Government of Northern Ireland Flag" which is the sort of official flag of the six counties
Then you have the "Alternate Northern Ireland Flag" Which has no crown and a wee union jack in the top corner. This is perceived to be a UDA (Ulster Defence association - an illegal paramilitary/terrorist/drug dealing group)

Then you have the flag of the Orange order, a protestant religious organisation famed for it's bowler hats, sashes and it's unofficial war cry of "Fuck the Pope" (i am being crass here, however on the 12th july when certain songs are played at the BIG parade you will hear this with a monotonous regularity and on walls in Belfast you will see FTP scrawled on walls and it is not the work some underground group of TCP/IP graffitioso)


Then there is the King Billy Flag .. another sort of Orange order flag



Not to be left out the UVF (Ulster Volunteer Force - Another illegal paramilitary,terrorist organisation) and the YCV (Young Citizen Volunteers - Much the same as the UVF but without the moustaches)

And here are more.. including Dutch flags (King Billy was Dutch) Scottish flags and even Israeli flags (The Meyer & Cohen Hassidic Loyal Rising Sons of William temperance and Ohi Vey Battalion perhaps??) Anyway there are lots and lots and lots of flags on BOTH sides and as they fly in estates all over the north each flutter picks at the scabs of a 1000 insults both real and imagined.

So here I sit watching a plethora of flags flutter in the stiff breeze and there in the background several of young Ulster Protestantism's finest are singing along to the not terribly well played battle flute. "We are... We are... We are the billy boys! We are up to our necks in Fenian blood, surrender or you die" whilst necking a bottle of Buckfast tonic .. well after all it is traditional so it must be right... isn't it?

Read more...

The "YEC " scientific method

>> 18 June 2009

I recently had a run in with some anti-Darwin YEC (Young Earth Creationists) I am a card carrying "Grumpy Old Atheist Fart" and as I get older my capacity to put up with the tawdry dribbling of the wilful ignorant gets less and less.

In a perfect proof of Godwin's Rule of Nazi Analogies i was sent this

"However, the Western nations have not learned the lessons of the horrific wars and genocides this century. Evolution is today entrenched in our universities even more than it was in Nazi Germany. "

and a sentence later not satisfied with reductio ad hitlerum, Darwin is up to his evil ways again 150 years after his death.

.. our report of the Columbine High School massacre documents the on-going effects of evolutionary thinking in the young

This load of advanced gobshitery set me to thinking and I believe I can now reveal that YEC's have adapted the standard Scientific Method the orginal one goes like this

1. Observation and description of a phenomenon or group of phenomena.

2. Formulation of an hypothesis to explain the phenomena. In physics, the hypothesis often takes the form of a causal mechanism or a mathematical relation.

3. Use of the hypothesis to predict the existence of other phenomena, or to predict quantitatively the results of new observations.

4. Performance of experimental tests of the predictions by several independent experimenters and properly performed experiments.

And this has evolved (ooops sorry strike that) stayed the same into the YEC METHOD which goes like this

1. Observe the scientists observing Phenomena, look grumpy, pray a bit, blame Darwin for the Holocaust.

2. Start mining "The Sunday Sport" and "The National Enquirer" for phenomena that could be useful later on. "Aircraft buried under 1000 years of ice" is a good one.
The startling news that the Piltdown Man was a fake is another. Stop looking grumpy and try looking saintly for a while, grow a Moses-esque beard, pray some more, twiddle thumbs and wait for a scientist to publish something you don't like. Blame Darwin for Columbine, Pol Pot,the third world debt and the disappearance of Orange Smarties.

3. Have a good long pray, fleece some true believers of a few more quid, wonder why scientists bother with all this work since they are wrong all the time ... blame Satan ... Jesus tells you that Darwin IS Satan and he hid his horns using genetic manipulation.

4. Form a "ministry", start a web site, make a documentary about how Darwin IS actually Satan . Prove beyond doubt that Darwin's Beard is a portent of the end of times. Form a hypothesis that affirms that the Man and, consequently, the Earth, is in the centre of the creation, prove hypothesis using bible verses ,repeal Copernican celestial model because Copernicus was a Catholic and very probably a relative of Darwin and therefore the second cousin twice removed of "the beast" .. underline this by showing their beards were VERY similar.

5. Ban Science for being always wrong, co-opt the Orange Order as the NEW Protestant Inquisition, burn Richard Dawkins at the stake even if he does recant.

Read more...

Woooot I didnt know DVD's came like this?

>> 17 June 2009



Thanks to .... PshcyoChristian.org

Read more...

Shock Horror Coding Pencil High level Probe - I am speaking at UKLUG

>> 12 June 2009

Well it had to come sometime. ILUG, UKLUG, DNUG, Lotusphere all have a long and rich history of excellent speakers covering topics of interest with alacrity, elegance, wit and vigour. Well for an hour during UKLUG on the 8th or 9th of October that is all due to change, for tis on one of those days I will take the stage to deliver with my compadre in arms "Will" Bill Buchan an hours worth of fun filled romping around the world of RIAs.

So if you are coming to UKLUG in October , please stop by and heckle, we may be providing things to throw and Bill and I promise to make it more difficult by moving around a lot and filling the silence with geek chat delivered in a variety of strange accents at great speed. (Subtitles will be provided)

We will be expecting a certain amount of audience participation and if you are planning to attend you should start practising the following catchphrases now ...

"OOOOOOOH My life!"

"FECK! ARSE! DRINK! GURLS!"

"Could'nt find his arse with both hands and a Tom Tom"

"Flex? With this waistline I should cocco!"

"Warren ... I'm really an admin...honestly....please let me out"

You can find out more about what is going on here on the UKLUG SITE if you haven't made you mind up yet I would advise you to get your skates on as the books are is very nearly full which is testimony to the fact that the rest of the speakers are way way better than me!

Read more...

Panda Bear - a Boon for Quickr Users from SNAPPS

There are dozens of links to this already, however just in case you don't follow the Notes Yellow Blogs.. This is just out from those awfully nice people at SNAPPS
Panda Bear which is a nice alternative to the "Quickr Connectors" supplied with Quickr and because it is an ADOBE Air App, much less
intrusive when installed on your PC.

I was lucky enough to have been using it for a while now, the folks at SNAPPS called it "testing" .. but I managed not to break it, which for me is strange and for Panda Bear a ringing endorsement of it's stability and fragility.

If you have a mainly file share Quickr Installation and need a quick and easy method of getting files into and out of your Quickr Places, Panda bear is the tool for you.

Take a trip over to the SNAPPS site and check out and A+ Gold Star cracking app!

Read more...

Notes Client Tip - Dragging and Dropping documents into a calendar

I was asked today the following question,

Why can't we drag a customer from a customer list onto our Customer Visit Calendar and make an appointment with them that way?
Good question. We already have that functionality on the web interface. Popup a customer list, select the customer or customers from the list and drag them to the day you want to schedule the visit and it auto creates the document for that customer on the day you dragged the document(s) onto.

I sucked my pencil for a bit, scratched various bits of my anatomy that would not be misconstrued by my colleagues as offensive and hummed and ahhed. I pinged Julian Robichaux and bounced the idea off him. Can I drag docs which are not calendar docs from an embedded view on a page (or form) onto calendar view embedded on the same form and create a document or documents based on the QueryDragDrop event of the calendar based on the documents that I had dropped.

Julian confirmed my initial thoughts that this was a non-runner because when a view is embedded you can't seem to access the drag drop events - BUMMER! So I then mentioned a word not mentioned in polite society much these days and to give Julian credit it didn't finch or berate me in any way. "What about Framesets?" I said

After a bit of futtering about we discovered that yes you could accecss the Drag and Drop events from FrameA to FrameB and Joy of Joys the CurrentView in the UIWorkspace FrameB's QueryDragDrop event was the view from FrameA! _ YIPEE!

I took my leave of Julian with much thanking and promises of beer and proceeded to have a bit of a debug to see what I could do.

I created a wee test NSF with two forms CUSTOMER and CALENT
Followed by a View of just the CUSTOMER forms and a Calendar view of the CALENT forms
A Frameset was created and in the LHS frame I popped CUSTOMER view and in the RHS frame CALENT calendar view.

On the CALENT view's QueryDragDrop I entered some code and had a ferret about in
what was an what was not passed, this is what I found out.

If you grab one doc from the CUSTOMER view and drop it over the calendar, then there are no documents in the UIView.Documents collection, there is a CaretNoteID that links to the dragging document in the UIView.

If you select more than one document from the CUSTOMER view and drag it over the Calendar then the UIView.documents collection contains the documents you selected.
If you actually select (the wee tick in the gutter) one document the UIView.documents will contain that one document, but you cannot count on users doing that.

Sub Querydragdrop(Source As Notesuiview, Continue As Variant)

Dim ThisSession As New NotesSession
Dim ThisDB As notesdatabase
Dim ThisUI As New NotesUIWorkspace
Dim ThisUIV As NotesUIView
Dim ThisDC As notesdocumentcollection
Dim OldDoc As NotesDocument
Dim NewDoc As NotesDocument

Set ThisDB = ThisSession.CurrentDatabase
Set ThisUIV = ThisUI.CurrentView
' *** Test to see if the view I am dragging from is the calendar or the customer list
If ThisUIV.ViewName <> "Calendar" Then
Set ThisDC = ThisUIV.Documents
'*** Well you must have dragged SOMETHING to fire the event so get it from
'*** from the CaretNoteId
If ThisDC.Count = 0 Then
Set OldDoc = ThisDB.getDocumentById(ThisUIV.CaretNoteID)
Set NewDoc = New NotesDocument(ThisDB)
NewDoc.Form = "CalEnt"
NewDoc.Customer = OldDoc.Customer(0)
NewDoc.City = OldDoc.City(0)
NewDoc.Date = Source.CalendarDateTime
NewDoc.Time =Format(Now,"hh:mm")
NewDoc.Status = "Planned"
Call NewDoc.Save(True,False)
Else
Set OldDoc = ThisDC.GetFirstDocument
Do While Not (OldDoc Is Nothing)
Set NewDoc = New NotesDocument(ThisDB)
NewDoc.Form = "CalEnt"
NewDoc.Customer = OldDoc.Customer(0)
NewDoc.City = OldDoc.City(0)
NewDoc.Date = Source.CalendarDateTime
NewDoc.Time =Format(Now,"hh:mm")
NewDoc.Status = "Planned"
Call NewDoc.Save(True,False)
Set OldDoc = ThisDC.GetNextDocument(OldDoc)
Loop
End If
Else
'*** This is the calendar and I am moving docs around inside it
Set ThisDC = ThisUIV.Documents
If ThisDC.Count = 0 Then Exit Sub
Set OldDoc = ThisDC.GetFirstDocument()
Do While Not (OldDoc Is Nothing)
OldDoc.Date = Source.CalendarDateTime
Call OldDoc.Save(True,False)
Set OldDoc = ThisDC.GetNextDocument(OldDoc)
Loop
End If
Call ThisUI.ReloadWindow()

End Sub


This code allows the user to drag a customer (with or without tick selction) or customers from the customer list in the left hand frame onto the calendar and create a calendar entry for that customer on the dropped on date. The user can also safely drag and drop calendar entries around inside the calendar.

Useful and cool. :-)

I have popped the NSF up here so if you are interested in seeing it in action you can have a go.

Enjoy ...

Read more...

Be sure to tell your Flash Drives you love them

>> 08 June 2009



In September 1956 IBM launched the 305 RAMAC, the first computer with a hard disk drive and that beauty is it The HDD weighed over a ton and stored 5 MB of data.
So send some love to your 32gb Memory stick right now!

Read more...

International "NotesBeer'n'Tweetup" Invite Hong Kong

I am off on my travels again this month, and I will be in Hong Kong (well Kowloon to be exact) from the 25th June until the 3rd July. So if any local Notesgeeks or allied trades from the Hong Kong/Kowloon area want to get together for a few beers and a bit of a laugh during that time leave a comment here or drop me an email to mcdonaghs[at]utvinternet[dot]com and we can arrange something.

Read more...

An Alternate way of embedding a configurable Video player in an NSF

>> 04 June 2009

I recently came across a nice open source video player that is dead easy to build into your Notes Applications. The player is called FLOWPLAYER and has been released under a GPL license. There are commercial and multi-domain versions which you have to pay for, but the base app is free to build into your apps.

You can download it here and once you have the zip file unzipped you have two SWFs and an example directory. I embedded it in my app like this.

01. I embedded FlowPlayer-3.1.1.swf into the RESOURCES / FILES section of the nsf

02. I embedded FlowPlayer.controls-3.1.1.swf into the RESOURCES / FILES Section of the nsf

03. I embedded the Flowplayer-3.1.1.min.js inot the RESOURCES / FILES section of the nsf

04. I added the flowplayer-3.1.1.min.js as an external JS file to the form I wanted the player to be on

05. I added a RT field into which a Video file could be attached

06. I added this code to the form

<a href="'http://www.unseenuni.com:81/flowplay.nsf/new/[ComputedText1]/$File/[ComputedText2]?openelement' style='display:block;width:400px;height:300px' id='player'></a>

<script language="'javascript'"> flowplayer("player","http://www.unseenuni.com:81/flowplay.nsf/fp311.swf?openfileresource")</script></pre>


[ComputedText1] = @documentUniqueID and
[ComputedText2] = @attachmentnames

07. I created the form .. attached an MP4 opened it in the browser and it worked like a charm and looked like this



So if you have a need for a very clean, easy to use adaptable player for free (we like for free) then you can't go far wrong with Flowplayer ... check it out here

Read more...

Sorting out an Admin Worst Practices offender

>> 31 May 2009

 
Posted by Picasa

Read more...

Just to prove to Coatsie and Bill that the sun does shine in Norn Iron

 
Posted by Picasa

Read more...

A Dog Rose

 
Posted by Picasa

Read more...

May Thorn in all of its wonderful glory

 
Posted by Picasa

Read more...

Saturday Walk in the woods

>> 30 May 2009

 
Posted by Picasa

Read more...

Famous Cousin Andy is Playing WOMAD this year

YEAH .. just got the news that my cousin Andy White is playing WOMAD again this year !!!!

KUDOS Cousin!! :-) You da Man!

From the WOMAD Site

Northern Irish songwriter Andy White plays WOMAD Charlton Park, Sunday July 26, before taking the songwriting strand of the WOMAD Summer School at Bath Spa University, July 27-31. At the festival, Andy will preview his forthcoming album 'Songwriter' (Floating World), on release this September.


It's been twenty three years since Andy burst onto the UK music scene with his debut album 'Rave On'. "Yer Man's Brilliant" proclaimed Melody Maker, and the singer the UK press called 'Belfast's Bob Dylan' or alternately 'Ireland's Billy Bragg' was born.

Since then, Andy has become very much his own man. His lyric-driven acoustic rock, which owes as much to David Gray or the Waterboys as Dylan or Bragg, has become more engaging-and his social commentary more relevant-each year.


Andy has been closely involved with WOMAD for a number of years, sharing its core values and appearing at many WOMAD festivals worldwide. In 2000, the WOMAD Select label released 'Speechless', a live performance album featuring Andy's best-known songs and poems.


Lead track on Peter Gabriel's current album 'Big Blue Ball' is 'Whole Thing', a song Andy wrote with Peter, Karl Wallinger, Geoffrey Oryema and others at a Real World recording week.


Andy's career highlights include winning Ireland's Hot Press Songwriter of the Year award, recording and touring as the A in ALT along with Liam O Maonlai and Tim Finn, and working and writing with the some of the great names in the music world-the Finn Brothers, Sinead O'Connor, Van Morrison.


Andy's new album 'Songwriter' was co-written over the past few years with a number of collaborators, and recorded live in the studio in Vancouver, with a rootsy all-star line-up. A shift from the layered textures of his current album 'Garageband' which was recorded in Andy's new home of Melbourne, Australia, and Real World, and mixed by old friend and national treasure John Leckie.

As MOJO magazine said about Andy, "From rage to sage, it's not too late to discover one of our best kept secrets."


Read more...

Blue Sky Evening in May

>> 29 May 2009


DSC00663, originally uploaded by DarkRedSpiral.

A Pretentious title for a photo i took on my phone.. and it is just.. well it is just "right" .. well i think so ;-)

Read more...

Back to TOP