Use Non Class VIs within Class

I suppose this is a theory of OOP question.
Say I have 2 classes, 1 is used to set the voltage on a power supply, and another is used to update a user interface.  They are not really related at all in that there is no common parent class and there is essentially no relationship between them.
Now, I write a subVI that is some sort of specialized random number generator.  What if I want to use that VI within a method of each of the two classes I created above.  Where does this subVI belong?
I can think of the following options, but I'm not sure what the best one is.  I would really love to hear your suggestions because it's been bugging me for a while:
1) Create a method within each class that has the random number generator functionality.  I don't like this idea because I will be duplicating code.
2) Simply choose to store the VI as part of my project and not include it within the classes.  What I don't like about this is that if I decide to reuse my code/class in another project, I will need to copy VIs that are not part of my class with it.
3) Create some sort of "utilities" class that would hold all of these miscellaneous VIs and then use methods from this class.  I could pass an object of this utilities class into each class so I would have access to the methods.  But this seems to be pretty complicated.
So that's the dilemma.  I'm wondering how all of you have chosen to solve this problem.  Thanks!
Solved!
Go to Solution.

Create a reuse library.  I recommend looking at VI Package Manager.  You can create "packages" of reuse code and "install" them into each version of LabVIEW.  Then anybody can use them since they are in one nice location.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Can I use non-US Visa to buy US gift card?

    I want to purchase a US Gift Card to my friend in US. Can I use Hong Kong visa card in US Apple Store?

    You may. The only way to know for sure is to try.
    What we know for sure is that the only credit card that you can use in the US iTunes and Mac App Store is a US credit card.

  • RE: [iPlanet-JATO] Re: Use Of models in utility classes

    Hi all,
    if you add the following to your spider2jato.xml
    It will automatically map your CSpDataObject.executeImmediate to use
    ExecuteImmediateUtil.executeImmediateSelect with the arguments mapped as
    well.
    Kostas
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[ExecuteImmediateUtil.executeImmediateSelect($1,$2,
    getRequestContext())]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    -----Original Message-----
    From: Matthew Stevens
    Cc: vnamboori@y...
    Sent: 11/29/01 11:23 AM
    Subject: RE: [iPlanet-JATO] Re: Use Of models in utility classes
    Namburi,
    I have included an example in the file ExecuteImmediateUtil.java
    The Yahoo Group will not handle the attached file we will put it in the
    Files section shortly.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100253094145066046167121181">vnamboori@y...</a>]
    Sent: Thursday, November 29, 2001 12:29 PM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes
    Matt,
    For CSpSelect.executeImmediate() I have an example of custom helpermethod as a replacement which uses JDBC results instead of
    CSpDBResult.
    Can you send me this example.
    Thanks
    Namburi
    --- In iPlanet-JATO@y..., "Matthew Stevens" <matthew.stevens@E...>
    wrote:
    Namburi,
    I will post a document to the group site this evening which has thedetails
    on various tactics of migrating these type of utilities.Essentially, you
    either need to convert these utilities to Models themselves or keepthe
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of custom helpermethod
    as a replacement whicch uses JDBC results instead of CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes. These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do the
    manipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion for these
    utilities we have to do manually.
    My question is Can we access the the models in the post migration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObject intensive.Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    [Non-text portions of this message have been removed]
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    [Non-text portions of this message have been removed]

    Hi all,
    if you add the following to your spider2jato.xml
    It will automatically map your CSpDataObject.executeImmediate to use
    ExecuteImmediateUtil.executeImmediateSelect with the arguments mapped as
    well.
    Kostas
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[ExecuteImmediateUtil.executeImmediateSelect($1,$2,
    getRequestContext())]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    -----Original Message-----
    From: Matthew Stevens
    Cc: vnamboori@y...
    Sent: 11/29/01 11:23 AM
    Subject: RE: [iPlanet-JATO] Re: Use Of models in utility classes
    Namburi,
    I have included an example in the file ExecuteImmediateUtil.java
    The Yahoo Group will not handle the attached file we will put it in the
    Files section shortly.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100253094145066046167121181">vnamboori@y...</a>]
    Sent: Thursday, November 29, 2001 12:29 PM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes
    Matt,
    For CSpSelect.executeImmediate() I have an example of custom helpermethod as a replacement which uses JDBC results instead of
    CSpDBResult.
    Can you send me this example.
    Thanks
    Namburi
    --- In iPlanet-JATO@y..., "Matthew Stevens" <matthew.stevens@E...>
    wrote:
    Namburi,
    I will post a document to the group site this evening which has thedetails
    on various tactics of migrating these type of utilities.Essentially, you
    either need to convert these utilities to Models themselves or keepthe
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of custom helpermethod
    as a replacement whicch uses JDBC results instead of CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes. These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do the
    manipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion for these
    utilities we have to do manually.
    My question is Can we access the the models in the post migration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObject intensive.Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    [Non-text portions of this message have been removed]
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    [Non-text portions of this message have been removed]

  • Preventing Child Class Dependency when using conditional disable to specify Class in Development Environment

    Hello
    I am developing an application which I would like to execute on both normal and real-time systems using LabVIEW Proffesional Development System 2012 SP1
    To control how the application interacts with the user, I have created a class which defines the type of user-interface behaviour which should allow me to have nice dialog boxes when the system is executing on a windows machine and have no dialog boxes (or other non-Real-Time friendly code) when operating on a real-time target.
    The parent class is the code that is suitable for Real-Time and the child class is the one with dialog boxes.
    To control which class is loaded, I have a conditional disable structure. This will work fine when the application is built into a executable or real-time executable but the problem arises when I want to use the code during development on the real-time target.
    I find that with the application under a real-time target (RT PXI), the correct conditional-disable case is activated so the parent class is used, but the child classes are also listed under the dependancies - I pressume this is because they exist on the block diagram in the disabled case of the conditional disable diagram.
    This means that I cannot deploy the code to the Real-Time target as it is unhappy with the child class code - even though this will never be run.
    To save posting my real project, I have created an example with a Parent and Child class and a Conditional Disable Flag called "CLASS" to demonstrate the problem.
    If you run Test.vi you will see that the Child class still gets locked (i.e. is a dependancy) during execution even though it is not called.
    So - basically my question is: Is there anything I can do about this or will I just have to do-away with the conditional disable and just put the correct Class constant on the block diagram during testing?
    Thanks in advance
    John.
    Solved!
    Go to Solution.
    Attachments:
    Example Proj.zip ‏18 KB

    I feel your pain.  I ran into a similar problem a short time back.
    Apparently Official NI stance is that you need to put a conditional Disable structure IN EVERY ONE OF YOUR CLASS VIs.  In the Windows VIs, you simply have an empty conditional disable case with the windows code in an appropriate other case and vise versa on the RT.
    I too would much prefer the method you describe...
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • Re: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't forget about the regular expression potential

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

  • Calling a method within a class form another class(ViewController)

    I am creating an SQL project in XCODE. I have one view. My main view controller is loading the database to a table/array. I want to add another class (with no NIB) just to handle the display of the table in a UITableView. So, I added a skeleton cocoa touch class file to my classes folder to handle this function when parameters change.
    So, in my app delegate, the "applicationdidFinishLaunchingWithOptions" method loads my mainViewController and NIB.  On the "viewDidLoad" method in my mainViewController, I read a URL into an SQLite database and close the database.  Herein lies the problem: I want to call my new class (TableViewHandler) and pass it the array created in the mainViewController and use the array to populate the UITable.
    How do I call a class from within another class (which has no NIB) to populate the table?  Especially if my TableViewHandler has no "viewDidLoad", "viewDidAppear", etc.
    Regads,
    -Kevin

    This is what my exact problem.
    i've created a bean (DataBean) to access the database. i'm having a servlet program (ShopBook). now to check some details over there in the database from the servlet i'm in need to use a method in the DataBean.
    both ShopBook.java and DataBean.java lies in the package shoppack.
    in ShopBook i tried to instantiate the object to DataBean as
    DataBean db = new DataBean();
    it shows the compiler error, unable to resolve symbol DataBean.
    note:
    first i compiled DataBean.java, it got compiled perfectly and the class file resides inside the shoppack.
    when i'm trying to compile the ShopBook its telling this error.
    hope i'm clear in explaining my problem. can u please help me?
    thank u in advance.
    regards,
    Fazli

  • QoS: Multiple acl entries cannot be used in match-any in class Match_XY

    Hello All,
    I'm getting below error while trying to add the two extended ACL in the class-map for classifying the traffic. Is there any way I can add two extenteded ACL in the same class-map for classifying the traffic.
    Error log: "QoS: Multiple acl entries cannot be used in match-any in class Tag_AF13"
    device details: cisco WS-C6506-E with Supervisor Engine 2T
    IOS version -s2t54-adventerprisek9-mz.SPA.150-1.SY1.bin
    R1(config)#class-map match-any Tag_AF13
    #match access-group name XX
    #match access-group name XY
    QoS: Multiple acl entries cannot be used in match-any in class Tag_AF13
    Regards,
    Thiyagu

    Hi Rajan,
    Thats because of the logic used for ACl operations, as per your config you are class-map match-any. The match any argument says that the class map must match either of the two arguments supplied.So lets take a look at how the sequence of operations of how this will be interpreted by your class map.
    1> Any particular packet will be first matched against the first ACL "XX".
    2> Suppose there are 10 entries there if it matches any of those entries the appropriate action will be talen.
    3> If none of those entried match the packet there will be an implicit deny at the end of the ACL( default behaviour of ACL's)
    4> In that case the packet will match the implicit deny and will get dropped.
    5> The packet will under no circumstances go to the next ACL "XY"
    Thats the reason multiple ACL's aren't allowed by the IOS.
    You can try to collate both ACL's and put them in just one ACL that should work well. If you need help please pots both the ACL's.
    Please do let me know if you have any further questions
    HTH
    Regards
    Umesh

  • Why do we need a Self Reference "me" to use the components of a class

    Hi
    I am not clear why do we need a self reference variable "me" to call the components of its own class? when it can be accessed directly as in the following examples?
    In my first example below i can call the method display_name directly without creating a reference object or instance of the class within the class.
    In the second example i am using the self refernce Write me->name to access the component of a class.
    My question is why do we need "me" when i can use the components directly as shown in my first example.
    CLASS egocentric DEFINITION.
      PUBLIC SECTION.
        DATA:
         name(10) TYPE c READ-ONLY.
        METHODS set_name.
        METHODS display_name.
    ENDCLASS.                    "egocentric DEFINITION
    *       CLASS egocentric IMPLEMENTATION
    CLASS egocentric IMPLEMENTATION.
      METHOD set_name.
        MOVE 'Abap Objects' TO name.
        CALL method display_name.
      ENDMETHOD.                    "write_name
      METHOD display_name.
        write: name.
      ENDMETHOD.                    "display_name
    ENDCLASS.                    "egocentric IMPLEMENTATION
    *Global Data
    DATA oref TYPE REF TO egocentric.
    START-OF-SELECTION.
      CREATE OBJECT oref.
      CALL METHOD oref->set_name.
    CLASS egocentric DEFINITION.
            PUBLIC SECTION.
                DATA:
                 name(10) TYPE c VALUE u2018Instructoru2019
    READ-ONLY.
                 METHODS write_name.
    ENDCLASS.
    CLASS egocentric IMPLEMENTATION.
            METHOD write_name.
                WRITE me->name.
            ENDMETHOD.
    ENDCLASS.
    *Global Data
    DATA oref TYPE REF TO egocentric.
    START-OF-SELECTION.
            CREATE OBJECT oref.
            CALL METHOD oref->write_name.

    You can go WIKI and search with ABAP Objects.
    Or do the same in 'advanced search'  and select a search area. You are bound to find something.
    Or this link perhaps:
    [abap objects|http://help.sap.com/saphelp_nw70/helpdata/EN/ce/b518b6513611d194a50000e8353423/content.htm]

  • Application builder and dynamic class VIs name collision

    I'm, using LabView 8.6 and I'm trying to make executable file. 
    The application builder returns warning:  
    "LabVIEW prevented a file name collision during the build. Duplicate file names cannot be copied to the same destination. You can rename files as part of the build process to avoid name conflicts."
    ...and no executable is created.
    I'm pretty sure the warning comes from the fact that I use dynamic class member VIs, that are by definition have to have same names in both parent and children.    
    The following link (http://zone.ni.com/reference/en-XX/help/371361E-01/lvhowto/caveats_apps_dlls/) says " If you don't rename the files, Application Builder moves the files to different folders for you to avoid a filename collision.", but no folders are created.
    Any help here? 

    Hi,
    If you have a parent class and one or more child classes, during the build LV will create a folder for each class with a conflicting VI.  The offending VIs will be dumped in their respective folders, resolving the conflict.  For what it's worth, I've used dynamic dispatch VIs several times in executables in LV 8.6 without seeing the issue you're reporting.
    My only advice would be to:
    1) make sure that you haven't somehow put two VIs of the same name in the same class (not even sure that's possible).
    2) make sure you aren't renaming a VI during the build and creating a conflict
    JasonP - CLD

  • Using and loading newer java classes...

    Hi,
    I am trying to use a feature from the newest release of java in my application.
    Is it possible to find the exact class files within the jre and just put them amongst
    my application's classes?
    For example if I were to take the new transparency feature
    from the latest release and use it on a computer that is not running the latest release of the java runtime?
    Any ideas or help would be so great...
    Thanx in advance!

    BigDaddyLoveHandles wrote:
    >
    Also, what if i wrote a class that uses the new features, and catch a class not found exception
    just on loading that class? so I could inform the user the latest jre needs to be downloaded to use transparency...In my mind, a cleaner approach is the following.
    Right off the bat (main?) you can find out the version:
    String version = System.getProperty("java.version");And decide what to do based on that. You even could have two versions of your app and chose the one that works with that version of the JRE!Thanx BigDaddyLoveHandles! :)
    this is a great idea, i still hope i could find some kind of solution to using classes from a jre that is not installed some how...

  • Error on Calling Methods Using an Object of a Class

    I keep getting the error cannot resolve variable addStud . I can't figure out why. I've created objects of classes before this way, then called methods within that class like this and it worked fine. I can't discern any difference between the syntax of the program that worked successfully and this one. I commented the parts where the error is when I tried to send a variable to a method in the class Recieve of which addStud is an object of. If you can see something that I can't I'd appreciate it. I've checked the obvious things like making sure the class name and method name is spelled the same way in both my frame and the class file.
    import java.awt.event.*;
    import java.awt.*;     /* Used by IntroTest3.java. */
    import javax.swing.*;
    public class RegFrame extends JInternalFrame
    {   // Begin class RegFrame
    static final int xOffset = 30, yOffset = 30;
         private JLabel nameLabel, displayLabel;  
         private JTextField nameField;
         private JTextArea displayText;
         private JButton addButton;
         private String name;
         private int numStu;
    public RegFrame() {     // Begin RegFrame constructor  
                  super(" Register a New Student ",
                  true, //resizable
                  true, //closable
                  true, //maximizable
                  true);//iconifiable
            //...Create the GUI and put it in the window...
            //...Then set the window size or call pack...
            setSize(400,300);        //Set the window's location.
            setLocation(xOffset, yOffset);
            Container content = getContentPane();
            setBackground(Color.white);
            content.setBackground(Color.white);
            content.setLayout( new FlowLayout());
      //*   CREATE LABELS AND TEST ENTRY FIELDS FOR REGISTERING A NEW STUDENT       *
            *  HERE IS WHERE OBJECT OF RECIEVE IS CREATED *
         Recieve addStud = new Recieve();
         nameLabel = new JLabel(" Enter student name: ");
         nameField = new JTextField(20);
         content.add ( nameLabel );
         content.add ( nameField );
         addButton = new JButton( "Add Student" );
         content.add( addButton );
         addButton.addActionListener(
              new ActionListener()
         { // Open ActionListener
              public void actionPerformed (ActionEvent e)
                   getInput();
         } // Close ActionListener
        }   // End RegFrame Constructor
    // get input
        private void getInput()
              numStu++;
              name = nameField.getText();
              JOptionPane.showMessageDialog( null, "NAME: "  + name + "\n"
                    + "Student number:"+ numStu );
                    addStud.addName( name );   /** <--- HERE IS ERROR **/
    } // End class RegFrame;This is the class:
    public class Recieve
    { // Begin class Recieve
        private double stAssign[];
        private double stLab[];   
        private double stProject[];
        private double stQuiz[];
        private double stTest[];
        private String stNames[];       
        int snc;  
    public Recieve ()
            stAssign = new double[10];
            stLab = new double[10];
            stProject = new double[10];
            stQuiz = new double[10];
            stTest = new double[10];
            stNames = new String[10];
            snc = 0;    // Student Name Counter      
    public void addName (String stName)
            stNames[snc] = stName;
            snc++;
    } // End class Recieve

    1- Add the following class variable declaration for RegFrame:
    private Recieve addStud;2- Change in the RegFrame constructor:
    addStud = new Recieve();

  • Is it possible to call methods from another class from within an abstract c

    Is it possible to call methods from another class from within an abstract class ?

    I found an example in teh JDK 131 JFC that may help you. I t is using swing interface and JTable
    If you can not use Swing, then you may want to do digging or try out with the idea presented here in example 3
    Notice that one should refine the abstract table model and you may want to create a method for something like
    public Object getValuesAtRow(int row) { return data[row;}
    to give the desired row and leave the method for
    getValuesAt alone for getting valued of particaular row and column.
    So Once you got the seelcted row index, idxSelctd, from your table
    you can get the row or set the row in your table model
    public TableExample3() {
    JFrame frame = new JFrame("Table");
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}});
    // Take the dummy data from SwingSet.
    final String[] names = {"First Name", "Last Name", "Favorite Color",
    "Favorite Number", "Vegetarian"};
    final Object[][] data = {
         {"Mark", "Andrews", "Red", new Integer(2), new Boolean(true)},
         {"Tom", "Ball", "Blue", new Integer(99), new Boolean(false)},
         {"Alan", "Chung", "Green", new Integer(838), new Boolean(false)},
         {"Jeff", "Dinkins", "Turquois", new Integer(8), new Boolean(true)},
         {"Amy", "Fowler", "Yellow", new Integer(3), new Boolean(false)},
         {"Brian", "Gerhold", "Green", new Integer(0), new Boolean(false)},
         {"James", "Gosling", "Pink", new Integer(21), new Boolean(false)},
         {"David", "Karlton", "Red", new Integer(1), new Boolean(false)},
         {"Dave", "Kloba", "Yellow", new Integer(14), new Boolean(false)},
         {"Peter", "Korn", "Purple", new Integer(12), new Boolean(false)},
         {"Phil", "Milne", "Purple", new Integer(3), new Boolean(false)},
         {"Dave", "Moore", "Green", new Integer(88), new Boolean(false)},
         {"Hans", "Muller", "Maroon", new Integer(5), new Boolean(false)},
         {"Rick", "Levenson", "Blue", new Integer(2), new Boolean(false)},
         {"Tim", "Prinzing", "Blue", new Integer(22), new Boolean(false)},
         {"Chester", "Rose", "Black", new Integer(0), new Boolean(false)},
         {"Ray", "Ryan", "Gray", new Integer(77), new Boolean(false)},
         {"Georges", "Saab", "Red", new Integer(4), new Boolean(false)},
         {"Willie", "Walker", "Phthalo Blue", new Integer(4), new Boolean(false)},
         {"Kathy", "Walrath", "Blue", new Integer(8), new Boolean(false)},
         {"Arnaud", "Weber", "Green", new Integer(44), new Boolean(false)}
    // Create a model of the data.
    TableModel dataModel = new AbstractTableModel() {
    // These methods always need to be implemented.
    public int getColumnCount() { return names.length; }
    public int getRowCount() { return data.length;}
    public Object getValueAt(int row, int col) {return data[row][col];}
    // The default implementations of these methods in
    // AbstractTableModel would work, but we can refine them.
    public String getColumnName(int column) {return names[column];}
    public Class getColumnClass(int col) {return getValueAt(0,col).getClass();}
    public boolean isCellEditable(int row, int col) {return (col==4);}
    public void setValueAt(Object aValue, int row, int column) {
    data[row][column] = aValue;
    };

  • Using Buffered Writer In Different Classes

    Hi,
    I have 4 different classes in my program. Although the three object defining classes have accessor methods, I use print functions designed within them. I'm wondering if it is at all possible to use a single buffered reader to use all of the classes. Thanks for the help.

    Possible, yes.Wow that doesn't sound reassuring haha..
    Well I decided to stop being lazy and recreated the print function as a writing function using the accessors, but now I'm having an issue between methods. Is it possible to use the same bufferedreader easily[i] between different methods?

  • Is it possible to use mx.controls in ActionScript class?

    I am very new to Flex, with a very small amount of experience in ActionScript so forgive me if the answer to this is obvious. I've tried searching and haven't found a conclusive solution to my problem.
    I have a Flex project that I am building in Flex Builder 3. The main application is in mxml, but most of the classes I'm using are in ActionScript.
    The general purpose of the application is to create a flowchart that accepts certain inputs on the elements in the charts. The chart components are all ActionScript classes. I am attempting to add a combobox to a component, but despite not getting any errors or warnings I can't get the combobox to show up.
    Here's a simplified version of the code within the class (I've left out the stuff that doesn't directly relate to my issue):
        import mx.controls.ComboBox;
              newComboBox = new ComboBox();
              newComboBox.initialized = true;
              newComboBox.alpha = 1;
              newComboBox.dataProvider = valueArray;
              newComboBox.x = 5;
              newComboBox.y = -5;
              newComboBox.height = 20;
              newComboBox.width = width - 60;
              newComboBox.visible = true;
              addChild(newComboBox);

    Just realized I hadn't thanked anyone for the suggestions yet. I appreciate it.
    Srirangan wrote:
    Few points I can think of:
    1. Try without the ".initialized = true;" property being set
    2. Check if the x & y property values for the ComboBox are valid
    3. Check if any styles are being applied that set the top, right, bottom or left properties thru CSS
    Removing (or alternately adding) the ".initialized = true" doesn't make a difference. It was actually a last ditch effort to try to make it draw it and wasn't meant to stay in the code.
    The x and y property values are valid as far as I know. The code for the positioning and sizing of the combobox was taken from the textfield below which I ended up moving down when I decided to add the combobox. The textfield has always drawn correctly.
    I looked through the CSS and it doesn't appear to set top, right, bottom or left anywhere. The only CSS in the project is from the Degrafa library that I'm using to draw components.
    Michael Borbor wrote:
    What's the val of the variable  width?
    Width is set to 150, which is the width of the Constant component.
    ATIF FAROOQ wrote:
    can you show the hierarchy of your flowchart component
    I'm not 100% sure this is what you mean, but it's:
    Sprite > Graphic (Degrafa class) > GeometryGroup (Degrafa class) > ComponentGroup > Constant
    and just for reference the component's being drawn onto:
    UIComponent > Surface (Degrafa class) > SurfaceComponent

  • Adding custom css classes from within edge animate

    is it possible to add  CSS classes from within Edge Animate, im not talking about adding your own stylesheet by ex. manually editing the .html document, but rather adding classes via ex. the code window ?, it would be immensely helpful to have everything in one place.
    any suggestions on this one ?

    Yes - you can use addclass() and you can use UI.
    1- UI
    Select elements in elements panel. Click the C button in the property panel.
    Use this for example
    sym.$('.classname').css({'color':'red'});
    2- addclaas()
    sym.$("name').addclass('classname');
    Use same as above.
    On Sat, Apr 25, 2015 at 8:56 AM mads18950258 <[email protected]>

Maybe you are looking for

  • A flash of white before animation plays on iPad in Adobe Content Viewer

    Hi Everyone, I'm creating Edge animations and importing the .OAM files into my layout in InDesign CS6 for the Mac, then using the Digital Publishing Suite to publish to iPads. On an InDesign page where I have solid color background, the frame where I

  • My  24" iMac can't update to 10.7

    hey guys i have a a problem, hope you can help me. My  24" iMac (2007) can't update to 10.7. everytime i start the download, there comes this pop up saying missing data in the package.Is my iMac too old for lion or is can the problem be the store ? p

  • Problem with Object removal...

    Greetings, In a game I'm working on, I have two levels so far. Level0 is the menu, Level1 is the first game level. I wrote a custom class that calls lots of other custom classes to manage all the MovieClips (and their children, and operate on global

  • Help required in getting the header details.

    Hi All , In my first WDA , I am showing the header details of Purchase Order for a input parameter  in table and now I want to show the items details for that particular PO on lead selection of the the PO details in my second application . How can I

  • Measuring Point characteristics Unit

    We have characteristic "KK_pressure" with measuring unit of Pascal. Currently DCS interfacing system is sending the measurement data in form of Kilopascal for pressure gauge. Is it necessarily required to create new characteristic with measuring unit