Chaos Theory is out!

by Erik Lane 31. March 2005 07:11
The new Splinter Cell has hit the shelves.  Jason has given me my first info on it and now I'm excited.  With my current work schedule I will have to wait but it will be worth it.
Tags:
Categories: General Musings

Plumtree Portlet Alignement

by Erik Lane 31. March 2005 04:15

Ok, more Plumtree.  In displaying dynamic content in a Plumtree portlet we sometimes need to know if the portlet is wide or narrow so we don't mess up the display of the whole portal.  Searching and searching didn't bring me anything..so here is the code for it.

Code:

using Plumtree.Remote.Portlet;

IPortletContext portletContext = PortletContextFactory.CreatePortletContext(Request, Response);
IPortletRequest portletRequest = portletContext.GetRequest();
IRemoteSession portletRS = portletContext.GetRemotePortalSession();

IPortletManager portletMan = portletRS.GetPortletManager();
IPortlet portlet = portletMan.GetPortletInstance(portletRequest.GetPortletID());

if(portlet.GetAlignment() == Alignment.Narrow)
	Response.Write("I'm a narrow portlet!");
else if(portlet.GetAlignment() == Alignment.Wide)
	Response.Write("I'm a wide portlet!");
Tags:

Plumtree PEI - OnBeforeDeleteObject

by Erik Lane 30. March 2005 09:44

So coding .NET in the world of Plumtree is a unique animal..I'm finding out.  The Plumtree devcenter is a pretty good place for help, although there's not much in the discussions going on, and they do have a significant amount of documentation for their EDK/APIs.  I guess like most things you eventually get beyond what's in the documentation and are off on your own.  I found myself there yesterday.

I was needing to use a PEI.  Most Plumtree installs use the OnAfterLogin PEI so there can be some custom things done after the user logs into the portal.  We're using one too and there are examples for them.  I was now needing to know when a Plumtree object was being deleted so we could also delete some supporting data from our database.  So looking in the Plumtree documentation I found that they have an OnBeforeDeleteObject PEI.  Golden?  Well, sorta.  That is the PEI I need to use but now I've got to get to the object being deleted to find out if it is the type of object I'm looking for and if so, if it has supporting data to delete.  Sounds straight forward to me.  I've done similar things with their EDK but now that I'm in a PEI I need to use the Server API which is less friendly...so I'm sharing for anyone else who cares.

I'm checking to see if it is a Portlet (Plumtree classID = 43) and then check its Admin Preferences for a HTMLCodeID.  If it has one then I know that there is data in our database to delete.

Code:

using com.plumtree.debug;
using com.plumtree.server;
using com.plumtree.openfoundation.util;
using com.plumtree.uiinfrastructure.activityspace;
using com.plumtree.portalpages.pei;
 
 
namespace Company.Pei.Object
 {
 
///
 
/// Implementation of IObjectActions.
 
///
 
public class ObjectActions : IObjectActions
 {
 
private const int _portletClassID = 43;
 
public ObjectActions() : base()
 {
 }
 
#region IObjectActions Members
 public string OnBeforeDeleteObject(AActivitySpace _asCurrentSpace, IPTSession _ptUserSession,
 
int _nClassID, int _nObjectID)
 {
 
try
  {
 
if(_nClassID != _portletClassID)
  {
 
return null;
  }
  IPTGadget gadget = (IPTGadget)_ptUserSession.GetGadgets().Open(_nObjectID,
false);
  IPTAdminSettings settings = (IPTAdminSettings)gadget.GetInterfaces(
"IPTAdminSettings");
 
object[][] arr = settings.LookupAdminGadgetSettings("HTMLCodeID");
  PTDebug.Trace(Component.Portal_Admin,TraceType.Info,
"Got arr.  Checking arr");
 
if(arr[0][0] == null)
  {
  PTDebug.Trace(Component.Portal_Portlets,TraceType.Info,
"HTMLCode IsNull - returning null");
  }
 
else
  {
  PTDebug.Trace(Component.Portal_Admin,TraceType.Info,
"Deleting Freeform HTML Portlet: "
  + gadget.GetName() + " HTMLCodeID: " + arr[1][0].ToString());
  RemoveData(Convert.ToInt32(arr[1][0].ToString());
  }
  }
 
catch(Exception e)
  {
  PTDebug.Trace(Component.Portal_Admin, TraceType.Error, e.Message +
"\n" + e.StackTrace);
  }
 
 
return null;
 }
 
#endregion
 }
 }
Tags:

Baseball, Congress, and Mr. Bonds

by Erik Lane 25. March 2005 04:17

I'm a baseball guy through and through.  I've not blogged it before and probably won't much I guess but I can't wait for the season to begin!

Anyway, I watched the last 3 hour or so of the congress trials last week and was very surprised at how harsh congress was being to both the players rep and the commissioner.  I'm glad they were because the drug and steroids policy that baseball has is joke.  It's all about money, they now it and we know it, but this was the first time they had to answer the difficult questions that we've all wanted to ask them.  I really enjoyed the question pointed the players lawyer about the policy and having 5 chances.  The statement was basically this:  Five times?  If a guy in my district gets caught once they are most likely going to jail and you guys just fine them the equivalent of $25 of an average persons salary.

Back to my subject of Mr. Bonds.  Prediction - we'll never see him in baseball again.  Why?  Because he's been on 'roids the last few years and now that congress is pushing for a "real" drug policy he might get caught or have to stop taking them.  If he gets caught then he'll be in a world of hurt and if he stops taking them he'll have to explain why he's smaller, not as ripped, and not producing at the same level.  If, that's a big if, he does return he'll blame it on his knee surgeries as to the reason he's smaller (unable to workout as hard) and not producing because the knee is limiting him.  Look at these pictures.  Ok, he's working out and training harder but so was Mark McGwire and Jason Giambi and they've both admitted (McGwire in a 5th amendment type way) to using steroids.


Tags:
Categories: General Musings

Having no style...

by Erik Lane 24. March 2005 03:36

I'm not one for style when it comes to web design.  I'll be the first to tell you that you I can make things happen behind the scenes but you'll need to get a designer to make it look good.

I'm getting better at styles (graphics are so far outside my skillset it's not funny) but still only use the basics or something pre-made.  Today I was reading ASP.NET Resources and he brought up editing styles outside of the .NET IDE.  Hrm..I've not found a big issue with it since I don't do much in that area anyway.  I'll take his advice and start using and external editor...topSTYLE.  TBH, I've not used nor heard of it before but I've downloaded and messed around with the free version and I'm hoping it will help me in the style department.

Any other style help is appreciated.

Tags:

Returning Home from Iraq

by Erik Lane 17. March 2005 17:33

Yesterday was a good day for our family.  My cousin, Capt. Rex Blair, finally returned home after being in Iraq for the past 12 months or so.  I wasn't able to make the trip down to welcome him home but my in-laws took our two oldest ones with them.

We've all being praying for him and his men and it's great to see him home.  We will continue to pray for all of the men and women who are fighting for our country.

Welcome home RJ!

Tags:
Categories: Faith and Family

TiVo inks Partnership Deal with Comcast

by Erik Lane 15. March 2005 06:27
TiVo

Back in January I had heard that TiVo almost had a deal with Comcast (link) and I was pretty upset with the news that DirecTV will only continue support for their TiVo customers as long as your box is working.

Today TiVo has announced a strategic partnership with Comcast that will make the TiVo service available to Comcast customers.

"This long-term, non-exclusive partnership will provide millions of Comcast customers with the opportunity to choose the TiVo service, including TiVo's award-winning user interface and features like Season Pass(TM) and WishList(TM), as an additional option. In addition, the service will showcase TiVo's home networking, multimedia, and broadband capabilities."

Nothing is said about their box being a dual-tuner but Comcast does realize that they will now be offering the best-in-class DVR service to their customers.  Good for them.  Although I would like to see what Comcast will charge its customers for this great new service.  With DirecTV I pay $5/month no matter how many TiVo's I have.  So I get 130+ digital channels and TiVo for about $50/month.  The last I checked Comcast isn't close to this but I've got to be honest, I'm a TiVo customer and not a DirecTV customer so if it "fits" then I would consider the move.

[>>PVRblog]

Tags:
Categories: TiVo

Real World ASP.NET Best Practices

by Erik Lane 11. March 2005 05:07

Read any good books lately?  I've read pieces of this book over the past week or so.  It's not a large book like a lot of programming books, only 224 pages, but the book is a true resource for the ASP.NET developer.  The chapters are short and to the point providing you the info you need beyond the basics.  It really does like the cover says:

  • Contains the hard-won, real-world experience of veteran ASP.NET programmers
  • Exposes the truth behind advanced topics such as XML Web Services and .NET remoting.
  • Explores best practices for various features, including caching, view state, code behind, server controls, built-in controls, and user controls.  Provides workarounds for complex problems, including using the DataSet object with ASP.NET.

What had me pick up this book in the first place was getting a user control to communicate with the page it was on.  I was wanting its page to handle a click event from the user control and I knew I was missing something.  They had a 3 page example titled "Using Events to communicate between controls".  A great code sample that got mine working in a few minutes plus explained to me why it was working.
 
That was just the beginning for me.  As I continued to thumb through the book they cover the topic of managing lists.  The good, the bad, and the ugly of the DataGrid, the Repeater, and the DataList.  It covers the all important topic of performance.  It demonstrates the performance of each in different situations that gives you something to think about the next time you need to use one of these controls.
 
I'm not done with the book yet but I'm very impressed and a better programmer because of it.

Table of Contents

Chapter 1: The Age of ASP.NET
Chapter 2: Cache, Session, and View State
Chapter 3: Client-Side JavaScript: Oh, What Fun!
Chapter 4: Handling Data Effectively
Chapter 5: Using ASP.NET to Manage Lists
Chapter 6: User Controls and Server Controls
Chapter 7: Remoting and Web Services
Chapter 8: Configuring ASP.NET Applications

Detailed TOC
Index
Source Code
Sample Chapter - Cache, Session, ViewState
Tags:

Data Application Block from the Enterprise Library

by Erik Lane 8. March 2005 02:45

I've been using DAAB v2 in all of my apps that use SQL 2000.  Looks like I may give the new EntLib a look-see after Joel (he goes by his first name) pointed out Scott's article from 4Guys.  Unless I've need to use MS Access, I've yet to create ADO.NET classes by hand but now this new version gives you the flexability to create your own provider class for different database types.

"If you find yourself still accessing data by creating the ADO.NET classes by hand, consider checking out the Enterprise Library's DAAB. It's a tool I find indispensable. And if you are using an older version of the DAAB consider upgrading to the Enterprise Library. By moving toward the Enterprise Library you can also utilize the other application blocks to improve your application's functionality. " --Scott Mitchell

Tags:

TiVo and the "SAF" - Spousal Acceptance Factor

by Erik Lane 7. March 2005 06:23

Reading the PVRblog I was reminded of how important the "SAF" is with anything.  When I first discussed TiVo with my wife she understood the concept but didn't see any real value in it outside of a cool tech toy.  At the time we had been using rabbit ears for about 7 years (except for a 6 month stint with cable for $9.99/month) because we just couldn't justify the cost of something we just couldn't use.  With 4 kids we're not sure where we'll be at any given moment.

Time passed and she gave the thumbs up on the purchase.  I hooked everything up the day the TiVo box arrived.  That night was the one show we would try our best at being in front of the TV for (and having the kids in bed) so we could watch it.  We were watching it live with the TiVo and then my wife got a phone call.  I pause the show and my wife is not sure what to think about it...she hangs up and then we continue on.  She was sold at that point.  Then you (all of us) really "get it" when you start understanding the concept of "time shifting" your TV time.  I rarely watch TV before 8:30 or 9pm and I know if there was something I wanted to watch was on..TiVo got it for me no matter what time it was on...I didn't have to specifically tell it like I would a VCR or a lesser product like a digital VCR (read:  non-TiVo DVR's). 

Tags:
Categories: TiVo