XmlConfigValidatorFactoryBase

Hello

What DLLs do I need to use the class XmlConfigValidtorFactoryBase of reference?

Thank you!

Hi Mike,.

Please user ProdikaLib.dll

Thank you

Wensong

Tags: Oracle Applications

Similar Questions

  • Infrastructure of validation for the issue of

    Hello

    We already use the validation infrastructure to record the action. We now have a new requirement to send email notification when a specification is issue upward. I realized that we can achieve by using the validation framework using problem event

    We use the version 6.1.0.1 and extensibility Pack 2.5

    I need the following information:

    1. question is Up event is supported in the Ext 2.5 pack?

    2. I tried my sample code with the configuration below but the code had not pulled

    < rule type "1004" = >
    < event condition 'question' = >
    < if type = "MaterialValidator" / >
    < / condition >

    < / rule >

    Private bool DoValidate (IValidationContext ctx)

    {

    code here

    }

    I don't know what context object to use for the question until validation

    If you can provide me with an example of code that would be useful

    Thank you

    Hi Mathieu,

    I checked the document and 2.5 ep should support the cause an event.

    Although I did have the chance to check it out in 6101, I have a sample which has been run in 6114 for you.

    1.SampleValidator.cs

    Imports System.Xml;

    using Xeno.Data;

    using Xeno.Prodika.Application;

    using Xeno.Prodika.Reflection;

    using Xeno.Prodika.Services;

    using Xeno.Prodika.Validation;

    using Xeno.Prodika.Validation.Validators;

    namespace Oracle.Agile.PlmProcess.Validation

    {

    ///

    Allows the instantiation of ShelfLifeValidator s.

    ///

    ShelfLifeValidator

    public class SampleValidatorFactory: XmlConfigValidatorFactoryBase

    {

    Private Shared readonly IValidatorFactory m_factory = new SampleValidatorFactory();

    public static IValidatorFactory GetInstance() {return m_factory ;}

    Private SampleValidatorFactory() End Sub

    Protected Overrides IValidator Create_Internal (XmlNode node)

    {

    back again (SampleValidator)

    );

    }

    }

    internal class SampleValidator: BaseValidator

    {

    Private readonly string m_parentToShelfLifePropertyPath;

    Private readonly int m_minimumMinimumDaysRemaining;

    Private readonly int m_maximumMinimumDaysRemaining;

    Private readonly string m_errorTranslationId;

    Public Overrides Function Validate (IValidationContext ctx)

    {

    bool verdict = true;

    ISpecSummary specSummary = (ISpecSummary) ReflectionHelper.GetPropObject (ctx. ValidationTarget, 'SpecSummary');

    IEmailService emailService = (IEmailService) AppPlatformHelper.ServiceManager [typeof (IEmailService). FullName];

    String from = "[email protected]";

    string to = "[email protected]";

    object String = 'test subject ';

    String body = "test body:"+ specSummary.FreeTextName.Name; "

    emailService.SendMessage (from, to, subject, body);

    return the verdict;

    }

    }

    }

    2.validationSettings.XML:

    Thank you

    Wensong

  • How can I check the NDP project duplicate name?


    Hi all

    I would like to know how I can check the NDP duplicate project name? I find that some NDP is initiate serveral times with the same or similar user name name. Assuming that the name of the project was "Smart Pilot". I've always found that this project can type differently as "Smart DRIVER", "smart pilot" or even "Smart drivers. Assuming I want to validate all these name before saving by using validation or custom validation infrastructure. Is this possible?

    Assuming that it was possible, can you please guide me on the way?

    Thank you very much in advance for the entire response.

    Phaithoon W.

    Here is some examples of code for a fast validator. Note that this uses a hard coded English error message, rather than a translation. If you want to use translations instead, look at a few examples in the folder ReferenceImplementations\Validation\SourceCode\ReferenceValidation of the pack of extensibility and review the training of Validation as well as (in the ReferenceImplementations\Validation\Documentation folder).

    Note that the code provided is only for demonstration purposes and is not supported by Oracle.

    Classes:

    using System;
    using System.Data;
    using System.Xml;
    using Xeno.Data.NPD;
    using Xeno.Prodika.Application;
    using Xeno.Prodika.Services;
    using Xeno.Prodika.Validation;
    using Xeno.Prodika.Validation.Validators;
    
    namespace Oracle.Agile.PlmProcess.Validation
    {
        public class NPDUniqueProjectNameValidatorFactory : XmlConfigValidatorFactoryBase
        {
            protected override IValidator Create_Internal(XmlNode configNode)
            {
                return new NPDUniqueProjectNameValidator();
            }
        }
    
        public class NPDUniqueProjectNameValidator : BaseValidator
        {
            private const string sql = @"select 1 as dup from NPDPROJECTML where UPPER(title) = UPPER ('{0}') and FKPROJECT <> '{1}' and LANGID = {2}";
    
            public override bool Validate(IValidationContext ctx)
            {
                var project = ctx.ValidationTarget as INPDProjectDO;
                bool hasDuplicate = false;
                string sqlToExecute = String.Format(sql, project.ProjectML.Title, project.PKID, UserService.UserContext.User.PreferredLanguage);
                using (IDataReader reader = AppPlatformHelper.DataManager.newQuery().execute(sqlToExecute))
                {
                    if (reader.Read())
                    {
                        hasDuplicate = true;
                    }
                }
    
                if (hasDuplicate)
                    ctx.AddError(String.Format("A project already exists with the name '{0}'.", project.ProjectML.Title));
    
                return hasDuplicate;
            }
    
            private IUserService UserService
            {
                get { return AppPlatformHelper.ServiceManager.GetServiceByType(); }
            }
        }
    }
    

    Then, add the following to the ValidationSettings.xml file in config\Extensions:

    1. Add the validator factory, with a reference name in the config:

    
            
            
    
    

    2. Add a rule for NDP project save the event:

    
                
                    
                
    
    

    Compile the example reference in a dll and add this dll in web\npd\bin

    When you try to save a project with a duplicate name, it should now give you the error message.

Maybe you are looking for

  • Cannot open my email Xfinity/comcast

    cannot break overview page e-mail "full page e-mail"; Page Xfinity freezes then second later returns to the email overview page. Can't access "preferences". ; This does not occur when using internet explore; If you can not solve this problem, I have

  • What means connection 1394?

    can you tell me what this connection is appearing in my lan or access connections section broadband internet?Mike Martin

  • Deployment utility and Labview Modules

    Hello I'm relatively new to TestStand. I created a TestStand sequence that calls a number of modules of Labivew. Everything works fine on my development computer. I'm deploying to another computer running a development basic license. I ran the utilit

  • Part number Elitebook 840 G1 docking station?

    Hello I am based in the Canada and are looking for the right manufacturer for a docking station for an Elitebook 840 G1.  Thanbks for your help

  • Task Scheduler service fails, so I am unable to defragment my hard drive.

    original title: Task Scheduler service does not start OK, I have some stability issues with my new win 7 OS and I want to remedy. to do this, I would like to solve any potential problems which can cause my system crashes. I check the logs and noticed