Re: function "exists" ?

"Xavier Grehant" <[email protected]> Wed, 19 Jul 2006 19:46:37 +0200
Newsgroups gmane.comp.java.smartfrog.devel
Message-ID <[email protected]>
Julio -

I think it checks if sfSchema is true, not if it exists because when it does
not exist the parser fails at link resolution...

sfSchema true;

//Prim with any schema
Prim extends NULL {
    sfPrimSchema extends ifThenElse {
        if sfSchema;
        then extends PrimSchema;
        else NULL;
    }

Indeed It would be nice to use ifThenElse but with something like this:

LoopBackDomain extends Compound {
   backend extends LoopbackStorageBackend {
       //...
       swapSize extends ifThenElse {
            if DEF PARENT:PARENT:swapSize;
            then PARENT:PARENT:swapSize;
            else NULL;
        }
    }
    //...
}

LoopbackDomainSchema extends Schema {
   swapSize extends OptionalInteger;
}
sfConfig extends LoopbackDomain {
        //swapSize not here because it's optional
}

So I was wondering if there was such a DEF function?


Thank you,
Xavier

On 7/19/06, Guijarro, Julio <[email protected]> wrote:
>
>  An example used in  prim.sf
>
>
>
>     sfPrimSchema extends ifThenElse {
>
>         if sfSchema;
>
>         then extends PrimSchema;
>
>         else NULL;
>
>     }
>
>
>
> This creates an attribute called sfPrimSchema if sfSchema is exists if
> not, it makes it NULL.
>
>
>
> Julio
>
>
>   ------------------------------
>
> *From:* smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:
> smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] *On Behalf Of *Xavier
> Grehant
> *Sent:* 19 July 2006 15:38
> *To:* smartfrog-developer
> *Subject:* [Smartfrog-developer] function "exists" ?
>
>
>
>
> Hi -
>
> Is there a way to check if an attribute exists in a smartfrog description?
> The idea is to be able to have an optional attribute
> attr2 PARENT:attr1
> when attr1 is optional in the parent.
>
> Thank you,
> Xavier
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Smartfrog-developer mailing list
Smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/smartfrog-developer