Re: About URL Routing

2009-02-11 Thread Jimmy Shimizu
you need to name the params in your route to the same thing as what you pass on to the UrlHelper, like this: rules.Add(new PatternRoute(/controller/name/productId/ action.ashx) I guess you need to skip the action aswell, since you define a default, that's not needed: rules.Add(new

Re: Field not found: 'NVelocity.Runtime.Directive.Directive.runtimeServices' exception after moving from RC3 to trunk build 1040

2009-02-11 Thread Alexandra Tikhonova
The problem was resolved! :) The update of NVelocity.dll to the latest one from the build really helps. The reason of our error was that we did not notice, that we also use NVelocity in a dependent project for mail message generation, and after move to trunk we did not change NVelocity.dll

Re: Natural key

2009-02-11 Thread Ken Egozi
off the top of my head: 1. you can set it as a readonly property, and have the DB initiate the value (in SQL server use IDENTITY(1000, 1) ). I think you'd need to set the field as int? so it won't try to save 0 to the DB 2. call the DB when inserting to get the highest OrderNumber and plus 1 it

Convert String to Url Format

2009-02-11 Thread eyal
Hi All, I need to convert a string into url compatible format. For example, Product cost $24.00 higher/lower.- original string product-cost-24-00-higher-lower - url format I know that I can use string.Replace() but there are alot of characters that I may have to replace to

Re: Convert String to Url Format

2009-02-11 Thread Ken Egozi
you can use a regex say (notepad code): var cleanedUrl = new Regex([^-a-z0-9], RegexOptions.IgnoreCase).Replace(url, -); maybe then I'd add a new regex(-+).Replace(cleanedUrl, -) to avoid double '-' characters On Wed, Feb 11, 2009 at 6:38 PM, eyal ebarda...@gmail.com wrote: Hi All, I

How to inject WCF WebOperationContex into an ErrorHandler

2009-02-11 Thread Craig G
Does anyone know if it is possible to inject the current WCF WebOperationContext into a class that implements IErrorHandler? My ErrorHandler is instantiated via a WebHttpBehavior that is instantiated via new DefaultServiceModel().AddExtensions(new MyWebHttpBehavior()). Therefore my ErrorHandler

Re: How to integrate Castle ActiveRecord and WCF using Windsor?

2009-02-11 Thread Craig Neuwirt
It needs to be an IContractBehavior to ensure that it is propertly applied to the operations at the right time during channel or service host initialization On Wed, Feb 11, 2009 at 4:28 AM, Tavo gustavo.rin...@gmail.com wrote: Craig talking about this, i have seen that you set the UnitOfWork

Re: Convert String to Url Format

2009-02-11 Thread Patrick Steele
HttpUtility.UrlEncode() On Wed, Feb 11, 2009 at 11:38 AM, eyal ebarda...@gmail.com wrote: Hi All, I need to convert a string into url compatible format. For example, Product cost $24.00 higher/lower.- original string product-cost-24-00-higher-lower - url format I know

[Windsor] Passing a custom argument to a sub-dependency

2009-02-11 Thread Daniel Hölbling
Hello, I am currently facing a interesting problem with my Windsor object creation. I have a service that calculates something and then calls a Writer service to save this calculation. So I have Calculator depend on IWriter through it's ctor. This all works. But now I have a special case where

hyperlink Wrap around

2009-02-11 Thread eyal
Hi All, I am using $Url.For( )and $Url.Link(). How can I use them to wrap around images and divs. In pure html I can do this very easily using the closing /a tag: a href=... img name=... src=... / /a thanks eyal --~--~-~--~~~---~--~~ You received this message

Re: hyperlink Wrap around

2009-02-11 Thread Victor Kornov
a href=Url.For( ) img name=... src=... / /a --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from

Re: [Windsor] Passing a custom argument to a sub-dependency

2009-02-11 Thread Germán Schuager
Acording to this post: http://groups.google.com/group/castle-project-devel/browse_thread/thread/296dd82d5decd226/e5106c9ef7671710?hl=enlnk=gstq=MicroKernel+additionalArgs+behavior+definition#e5106c9ef7671710 This should work: var sender = container.ResolveCalculator(new {parameterNameOfIWriter =

Re: Convert String to Url Format

2009-02-11 Thread eyal
Thank you all for the quick reply. Ken your suggestion works like a charm. On Feb 11, 8:53 am, Ken Egozi egoz...@gmail.com wrote: you can use a regex say (notepad code): var cleanedUrl = new Regex([^-a-z0-9], RegexOptions.IgnoreCase).Replace(url, -); maybe then I'd add a   new

WizardStepPage Issue with Reset and IsPreConditionSatisfied funcs

2009-02-11 Thread eyal
Hi All, I recently upgraded my app. trunk to the latest framework ver 2.0. I found that the overridable functions Reset and IsPreConditionSatisfied are no longer supported or available for use. I'm getting the following error in the Controller.cs under RunActionAndRenderView() Object reference

Re: [Windsor] Passing a custom argument to a sub-dependency

2009-02-11 Thread Jason Meckley
you wouldn't pass the iwriter's dependency through the calculator, the calculator doesn't know the type of the iwriter. if you want to create writer at runtime, you could pass the kernel to calculator and have the calculator pull the iwriter from the kernel based on a parameter var writer =

Re: ARDataBinder and Version fields

2009-02-11 Thread Simon Laroche
After further investigation I think I might have found a possible bug when in Evict method of the ActiveRecordMediator when used within a transaction scope. The mediator calls directly to the curren scope to evict an entity. And the scope Evict method is: /// summary /// Evicts the specified

Re: Convert String to Url Format

2009-02-11 Thread eyal
Hi Alex, RegexReplace is not recognized to be a valid method. Am I missing a lib ref? (Regex is recognized) thanks eyal On Feb 11, 10:55 am, Alex Henderson bitterco...@gmail.com wrote: I have an extension method I use for this, basically the same as Kens...     public static string

Re: Convert String to Url Format

2009-02-11 Thread eyal
Also please explain if there is an advantage over Ken's method On Feb 11, 10:55 am, Alex Henderson bitterco...@gmail.com wrote: I have an extension method I use for this, basically the same as Kens...     public static string Slugify(this string text)     {       return

Re: [Windsor] Passing a custom argument to a sub-dependency

2009-02-11 Thread G. Richard Bellamy
You could look at the Castle.Facilities.Logging.LoggerResolver for an example of an implementation of the ISubDependencyResolver approach. This uses a combination of Factory and Resolver. - rb On Wed, Feb 11, 2009 at 10:29 AM, Jason Meckley jasonmeck...@gmail.comwrote: you wouldn't pass the

Re: Convert String to Url Format

2009-02-11 Thread Alex Henderson
I have an extension method I use for this, basically the same as Kens... public static string Slugify(this string text) { return text.ToLowerInvariant().RegexReplace([^a-z0-9]+, -).RegexReplace(-+$, ).RegexReplace(^-+$, ); } On Thu, Feb 12, 2009 at 5:38 AM, eyal

Re: How to integrate Castle ActiveRecord and WCF using Windsor?

2009-02-11 Thread Tavo
Thx! On Feb 11, 7:07 pm, Craig Neuwirt cneuw...@gmail.com wrote: It needs to be an IContractBehavior to ensure that it is propertly applied to the operations at the right time during channel or service host initialization On Wed, Feb 11, 2009 at 4:28 AM, Tavo gustavo.rin...@gmail.com wrote:

Re: Convert String to Url Format

2009-02-11 Thread Alex Henderson
Sorry, regex replace is another extension method.. public static string RegexReplace(this string input, string pattern, string replace) { return Regex.Replace(input, pattern, replace); } No advantage over kens implementation I could see, just adding some weight to the fact that

Lost images after Routing

2009-02-11 Thread eyal
Hi All, I recently applied url routing. However my view lost all its images. All I see on page is the image placement with marked with red X. Any idea of how to fix this? this is how I pull the image to display on page: img name=Image_$cnt alt=$Html.HtmlEncode($row.Title)

Re: Convert String to Url Format

2009-02-11 Thread Ken Egozi
I bet that RegexReplace is a simple extension method On Wed, Feb 11, 2009 at 9:12 PM, eyal ebarda...@gmail.com wrote: Also please explain if there is an advantage over Ken's method On Feb 11, 10:55 am, Alex Henderson bitterco...@gmail.com wrote: I have an extension method I use for this,

Re: hyperlink Wrap around

2009-02-11 Thread eyal
Hi Victor, this example is not working. the html generated is: a href=$Url.For(%{controller='product', action='pageName', params= {prodId=199 On Feb 11, 10:23 am, Victor Kornov wee...@gmail.com wrote: a href=Url.For( )  img name=... src=... / /a

Partial Initialization

2009-02-11 Thread ebrire
Hi folks, I'd like your help. I'm looking to do something simple, but I have no idea how. I usually create an XML config file that contains all the settings to run the application with AR and that works fine. What I'd like to do now is a bit different. I want the XML to have ALL settings EXCEPT

Re: hyperlink Wrap around

2009-02-11 Thread Victor Kornov
You are using NVelocity viewengine, right? I've not used it can't give you exact syntax. That was just an example of where you should be looking at. On Wed, Feb 11, 2009 at 10:22 PM, eyal ebarda...@gmail.com wrote: Hi Victor, this example is not working. the html generated is: a

Re: AR Native Query - type not initialized

2009-02-11 Thread Michał Staszewski
Tyler Burd wrote: I ran into this issue not long ago. The generic type parameter on SimpleQuery MUST be an Active Record persistent class. You can't use SimpleQuery to get DTOs or integer results. If you go to a lower level and use the good ol' session.CreateQuery or

Re: Form isn't loading on grid selection

2009-02-11 Thread M Kenyon II
Clearing this up, since it seems nobody can help with what I've got so far. I create a Dictionary object, like this: Dictionaryint, Dictionaryint, decimal Details = new Dictionaryint, Dictionaryint, decimal(); I fill it and then assign it to the Property Bag like this: PropertyBag[Details] =

Re: AR Native Query - type not initialized

2009-02-11 Thread Ken Egozi
Or better yet, use one of the Result Transformers and you'll get a nice list of DTOs On Wed, Feb 11, 2009 at 11:46 PM, Ken Egozi egoz...@gmail.com wrote: The exception is quite informative.You need to specify the return types for the query, as you are not returning any NH object so NH does not

Re: hyperlink Wrap around

2009-02-11 Thread eyal
hi victor, thanks for the reply: this is what i came up with... and this works #set ($myUrl = $Url.For(%{controller='...})) a href='$myUrl' eyal On Feb 11, 12:42 pm, Victor Kornov wee...@gmail.com wrote: You are using NVelocity viewengine, right? I've not used it can't

Re: Is this possible with Routing

2009-02-11 Thread eyal
use this to extract image h and w HttpPostedFile image Bitmap sourceImage = new Bitmap(image.InputStream, false); int width = sourceImage.Width; int height = sourceImage.Height; On Feb 11, 6:20 pm, Daniel Pupek

Routing Pattern Rules Issue

2009-02-11 Thread eyal
hi all, For some reason one routing rule replaces the other. Meaning whenever I try to evoke MyView(id) func SearchResult(categoryId) is executed instead. Any ideas of how to fix this? thanks eyal I have the following routing rules: rules.Add(new

Handle Errors with Url Routing

2009-02-11 Thread eyal
Hi there, when defining routing pattern rules you can specify type of parameter as such .Restrict(Id).ValidInteger But what if someone tempers with the url and changes the parameter value to a non integer. How can you handle this? For example: mysite.com/productName/12 - correct url

Re: About URL Routing

2009-02-11 Thread Jimmy Shimizu
In order to get routing to work, you map * to Monorail, meaning all static requests also tries to get served by monorail. Personally I have all static material in a /static/ folder, which I set to it's own application, with a static file handler (no monorail- handler). On 11 feb 2009,

Re: Is this possible with Routing

2009-02-11 Thread Jimmy Shimizu
why the parentheses? I assume your url is: /someGroupName/images/Banner800x600.png just skip the parentheses and it will work I believe. On 12 feb 2009, at 03:20, Daniel Pupek wrote: Ok, I have tested this and so far it doesn't seem to work but I wanted to see if anyone had a suggestion:

Re: Add Multi Routing Rules

2009-02-11 Thread Jimmy Shimizu
You can't add multiple routes that will match the same thing, it has no idea to understand if that integer is a categoryId or a regular id. You need to combine it with some static text for example, or hardcode it per controller. rules.Add(new PatternRoute(/category/name/ categoryId/)

Re: Natural key

2009-02-11 Thread Martin Nilsson
Number 1, is that possible with AR? I can't have it as a primary key but as a normal property. Tried a little bit with the Formula parameter for PropertyAttribute but didn't had any progress there either. [ActiveRecord] public class Order { [PrimaryKey(PrimaryKeyType.GuidComb)] public Guid Id

Re: Natural key

2009-02-11 Thread Ken Egozi
you'd have to set the IDENTITY field in the DB yourself. On Thu, Feb 12, 2009 at 9:00 AM, Martin Nilsson mffmar...@gmail.com wrote: Number 1, is that possible with AR? I can't have it as a primary key but as a normal property. Tried a little bit with the Formula parameter for

Re: Routing Pattern Rules Issue

2009-02-11 Thread Ken Egozi
both rules are using the same pattern: SOME-STRING / SOME- STRING / SOME- INTEGER so the engine will match the first rule. you need to differentiate the two. say: /search/productName/categoryId/ and /product/title/id/ this way, URLs with /search/STRING/INT will match the first, and

Re: Handle Errors with Url Routing

2009-02-11 Thread Ken Egozi
it won't reach the controller since the route won't match. this should be dealt like any other 404 error On Thu, Feb 12, 2009 at 6:52 AM, eyal ebarda...@gmail.com wrote: Hi there, when defining routing pattern rules you can specify type of parameter as such .Restrict(Id).ValidInteger But