Tech Blog

Jay's Technical blog

CodeCamp Tampa 2006... Talk summary (and code)

16 July 2006
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[out of date post... this deals with MS Atlas CTP... which has been change drastically and is now MS Ajax Extensions]

So I went to Code Camp Tampa this year and 2 sessions really stood out to me (probably because I had to prepare for them for about 1 month).  They were the Atlas Island Survival Kit and the PageMethods with Atlas talk.  <sarcasm>IMO, these were the 2 best talks.. probably because they were given by the best new presenter of 2006 in any CodeCamp… me</sarcasm>

This post is mainly about giving away the code and my slides to the attendees.  I’m thinking about speaking at the Jacksonville  Code Camp next month… I had fun.

Attached to this message you’ll find a zip file with the code and powerpoint slides.

[tags:Code Camp Tampa, Code Camp, Atlas, ASP.Net]


How Joe Healy and I Changed the World!

16 July 2006
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

Yesterday, I have come full circle and realized how I have been apart of something really cool!  If you go all the way back to my second post back in March of 2004, you will see that the MS Dev Evangelist for the SW (Joe Healy) at gave me my nickname.  We met again for the first time but this time it was face to face.  We were talking about how we had changed the world. 

Basically I had been thinking about blogging but I wanted a gimmick.  For instance, everyone knows the Marcie Robillard, the Datagrid Girl (also now the GridView Girl), and I wanted a nickname before I started blogging.  [Hey Joe, you think I need a second nickname?  I could be the Dev Monk… or the Bishop of Dev… or well… the PageMethods Guy… nahh…]

Read the post referenced if you don’t know… Joe named me and begat a blog.  Later he thought it seemed like a good idea and he started DevFish (already referenced).  So I had to one up him… I got my co-workers, Rob Teixeira and d.code (he likes to remain anonymous), but neither of these had the success I desired in a Blog Child… and then I got my buddy Dave Balzer to start blogging… Dave ended up starting DevAuthority.com which is a whole blogging site.  Who did it?  Me and Healy!

And we’re not done.  I guess there’s this new site - devhammer.com (actually started by G. Andrew Duthie).  We claim that one as our progerny, too… I mean look at the evidence…

Dev Theologian
DevFish
DevPrime (Rob Teixeira’s blog’s name)
DevAuthority
d.code (Ok, he had to be different… but the ‘d’ stands for ‘dev’)

Simply put, anyone who puts ‘dev’ at the front of their name is doing it because of Joe and me.  You can bet on it… We claim all such domains in the past and in the future as progeny of our efforts to affect the world… that is unless you are a Java or Linux site then we claim you as an evil copy and the Microsoft legal dept will be speaking with you soon (they are helping us… OK, not really, but you get the idea… Don’t screw with us!  It might be Rory and his pet poodle showing up at your place or if we really want to get mean then we might beg Rory to bribe his Dad to come over… So… you really do not want to screw with us!)

[tags: blogging, ASP.Net]


Atlas Sample: In-Place Editing

11 July 2006
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[Sadly this post is out of date... someday I may get around to updating it for the MS Ajax Extensions...] 

As I’m preparing demos for my “Islands” presentation (whose concept was stolen from Don Box… I hope he doesn’t mind), I came across this old sample created by Nikhil K. from the Atlas team.  I decided to check it out (at this stage of the game I need a couple good demos, and I’m not above stealing them as long as I understand them… the problem is coming up with the concept).

Anyway, at the end of last year/beginning of this year, Nikhil had a series of posts here, here, and here. These posts had to do with showing you how to create an extender (this is perfect for my demo).  The posts showed how to create an in-place editor which is a form that comes alive when you click on it (in FireFox and I assume Safari) and when you tab into the fields in IE. 

This demo is really cool but it was created with the December release of Atlas (which I’m mnot sure had a Go-live license).  There were definitely some differences between the 2 client libraries that I was able to clear up quickly (NameSpaces were a little different as well as he does a direct check on IE with application object which is no longer available).

Anyway, I updated his InPlaceEditing behavior, so that it works again with the June release (I’m sure he doesn’t have the time to go back and revisit this stuff all the time).  So attached to this message (or it will be) is an update of his project.  I’m not sure I’ll be using this code in my “Islands” demo or not, yet.

[BTW, the only changes I made were to the namespaces (very minor change) and I changed the IE check to do a check for the existence of the onfocus event on the element... it works flawlessly in IE and FireFox]

[tags:Atlas, ASP.Net, Ajax]


Membership API - Database Roles

09 July 2006
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

So I’m doing a little preparation for my Membership talk next weekend (this is going to be more of a chalk talk, btw… more Q&A, hopefully).

I just realized that after creating the database and adding a user that I wasn’t really sure what each database role meant so (I always choose the 4 “full” roles and move on).  So I decided to tear apart the various roles (and throw the SP exec permissions here).  At the end I’ll tell you what I think it all means (I’m sure there’s an MS Whitepaper with this stuff buried in it… I’d just rather dig in and figure it out myself)

Membership Basic Access
   SP Exec Access -
      CheckSchemaVersion
      RegisterSchemaVersion
      UnRegisterSchemaVersion
      Membership GetNumberOfUsersOnline
      Membership GetPassword
      Membership GetPasswordWithFormat
      Membership GetUserByEmail
      Membership GetUserByName
      Membership GetUserByUserId
      Membership UpdateUserInfo
Membership Reporting Access 
   SP Exec Access -
      CheckSchemaVersion
      RegisterSchemaVersion
      UnRegisterSchemaVersion
      Membership FindUsersByEmail
      Membership FindUsersByName
      Membership GetAllUsers
      Membership GetAllUsers
      Membership GetNumberOfUsersOnline
      Membership GetUserByEmail
      Membership GetUserByName
      Membership GetUserByUserId
      Membership GetUserByUserId
Membership Full Access (all of Membership Basic and Reporting permissions)
   SP Exec Access -
      Membership ChangePasswordQuestionAndAnswer
      Membership CreateUser
      Membership ResetPassword
      Membership SetPassword
      Membership UnlockUser
      Membership UpdateUser
      Users DeleteUser
Personalization Basic Access
   SP Exec Access -
      CheckSchemaVersion
      RegisterSchemaVersion
      UnRegisterSchemaVersion
      Paths CreatePath
      Personalization GetApplication
      PersonalizationAllUsers GetPageSettings
      PersonalizationAllUsers ResetPageSettings
      PersonalizationAllUsers SetPageSettings
      PersonalizationPerUser GetPageSettings
      PersonalizationPerUser ResetPageSettings
      PersonalizationPerUser SetPageSettings
Personalization Reporting  Access 
   SP Exec Access -
      CheckSchemaVersion
      RegisterSchemaVersion
      UnRegisterSchemaVersion
      PersonalizationAdministration FindState
      PersonalizationAdministration GetCountOfState
Personalization Full Access (all of Personalization Basic and Reporting permissions)
   SP Exec Access -
      PersonalizationAdministration DeleteAllState
      PersonalizationAdministration ResetSharedState
      PersonalizationAdministration ResetUserState
Profile Basic Access 
   SP Exec Access -
      CheckSchemaVersion
      RegisterSchemaVersion
      UnRegisterSchemaVersion
      Profile GetProperties
      Profile SetProperties
Profile Reporting Access
   SP Exec Access -
      CheckSchemaVersion
      RegisterSchemaVersion
      UnRegisterSchemaVersion
      Profile GetNumberOfInactiveProfiles
      Profile GetProfiles
Profile Full Access (all of Profile Basic and Reporting permissions)
      SP Exec Access -
      Profile DeleteInactiveProfiles
      Profile DeleteProfiles
      Profile DeleteProfiles
Role Basic Access
   SP Exec Access -
      CheckSchemaVersion
      RegisterSchemaVersion
      UnRegisterSchemaVersion
      UsersInRoles GetRolesForUser
      UsersInRoles IsUserInRole
Role Full Access (all of Role Basic and Reporting permissions)
  SP Exec Access -
    Roles CreateRole
    Roles DeleteRole
    UsersInRoles AddUsersToRoles
    UsersInRoles RemoveUsersToRoles
Role Reporting Access 
  SP Exec Access -
    CheckSchemaVersion
    RegisterSchemaVersion
    UnRegisterSchemaVersion
    Roles GetAllRoles
    Roles RoleExists
    UsersInRoles FindUsersInRole
    UsersInRoles GetRolesForUser
    UsersInRoles GetUsersInRoles
    UsersInRoles IsUserInRole
WebEvent Full Access 
   SP Exec Access -
    CheckSchemaVersion
    RegisterSchemaVersion
    UnRegisterSchemaVersion
    WebEvent LogEvent
 SPs with no permissions for any role (only meant for maintenance purposes
    AnyDataInTables
    Applications CreateApplication
    Setup RemoveAllRoleMembers
    Setup RestorePermissions

Membership access
There are 3 membership access types.  Basic, Full, and Reporting. 

Basic seems to for providing simple authentication; this type of role doesn’t provide for creating users.  Basic seems like it would be a good fit for sites (or Windows apps) that only allow the user to login (and not create accounts).

Reporting seems to me to provide the ability to take a look at the membership.  Maybe you want to provide some way for a non-admin to look at activity on the application without giving this app full admin capabilities.  You can check to see how many users are online, look at all the users registered, etc.

Full combines the Basic and Reporting and adds a few more capabilities.  It provides a numerous additional user management features.  It would be a good choice if you want to provide the concept of letting a user come in and “join” the site (“approval” may be a separate function), or if you are providing the admin utility for an application that uses the basic role then you would need this role.

Personalization Access
There are 3 personalization access types.  Basic, Full, and Reporting (admittedly I’m a little weak in this area).

Basic access lets you provide functionality where a page can be personalized globally as well as by the specific user.

Reporting lets the application find a particular state as well as to get a particular state (not sure what this means right at the moment… by Saturday I’ll be a lot more boned up on this area).

Full adds the ability to delete/reset various states.  It gives you complete control over the user personalization features.

Profile Access
You guessed it! There are 3 access types – Basic, Reporting, and Full.

Basic access simply provides the ability to get/set properties (variables that are associated with a user).  You would use this for an application that needed no other access then to let an individual user customize there experience within the application.

Reporting access provides a way to look to see how many profiles (sets of variables) are inactive as well as to get a listing of all the profile data.  This would be useful if you wanted to create an application that reported on the user settings without providing actual administration access (to modify other users profiles.

Full adds to the other access the ability to delete inactive profiles or to reset profiles (in various ways).  This is definitely the permission to use if your app will provide

Role access
Yep, 3 types of access: Basic, Reporting, and Full.

Basic access provides simple access to see if get the roles a user is in as well as to check which roles a user is in.  Good for simple apps where the roles will be control via some other mechanism.

Reporting access provides inquiry support into the user and roles allowing the app to simply see which users have access or to see which roles exist, etc.  This role is good for those apps that are for role audit on another app (or to provide the feature).

Full access combines the Basic and Reporting roles and adds the ability to add and delete roles as well as to add/remove roles from users.  This role would be good for an app that needs to provide admin tools as well as basic role retrieval or for an admin app for an app that uses the basic role.

WebEvent access
Only one type of access here : full.  Full access let’s your app call LogEvent.  I’m not 100% sure what this is for.

Additional Stored Procs
Obviously, there are stored procs whose use is to provide DBAs (or programmers) the ability to manage the security system.  These features are for the use of administrators and probably shouldn’t be used within an app (although “Create Application” could be useful).

[tags:ASP.Net,Membership Provider,.Net Provider models, .Net Security Providers]


Atlas PageMethods -- expected arguments

06 July 2006
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[out of date post... this deals with MS Atlas CTP... which has been change drastically and is now MS Ajax Extensions] 

I was browsing the Atlas source code this evening and encountered a gem that I don’t want to forget.

When you are calling a PageMethod (method in the ASPX codebehind) from JavaScript(documented in numerous places elsewhere in my blog), here are the additional arguments that appear after the actual method’s arguments – onMethodComplete, onMethodTimeout, onMethodError, onMethodAborted, userContext, timeoutInterval, priority, useGetMethod.

So if you have my infamous “add” method in a codebehind page that takes 2 integers (arg1 and arg2) as arguments then the javascript add PageMethod will accept the following arguments (in this order): arg1, arg2, onMethodComplete, onMethodTimeout, onMethodError, onMethodAborted, userContext, timeoutInterval, priority, useGetMethod.

BTW, onMethodComplete, onMethodTimeout, onMethodError, onMethodAborted are all callback functions. userContext can be very userful as it lets you specify a parameter that will arrive back to the caller that you can use to figure out what was going on in the code when this was called.  I was studying one of the behaviors (you guess which one) which simply put a copy of the current object and a string in an array and called that context.  On complete it was able to call a method on the right object (you lose context in these types of callbacks… the same is true for WebServices).

[tags: Atlas, Ajax, ASP.Net]