13 Replies Latest reply: Oct 24, 2012 8:33 AM by 967036 RSS

    Custom transformation provider for OIM GTC connector example?

    967036
      Hello experts,

      I'm facing a rather nasty task right now, and that is the development of a custom transformation provider for OIM GTC connector for OIM 11g R2.I read the documentation on the official site but there are only guidelines and no example.However i found this example which i consider rather incomplete but helpfull.

      Can anyone provide a more elaborate and complete example based on the documentation found on the official site?(it can be a very simple and trivial example but with all the steps included)

      Thanks in advance and best regards!

      Carol
        • 1. Re: Custom transformation provider for OIM GTC connector example?
          Nishith Nayan
          Find the below link if helps

          http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/icf_conn_conf.htm#BABEGFFG
          Re: Issue with Custom transformation provider for DBAT GTC connector in OIM

          --nayan                                                                                                                                                                                                                                                                                                                                                                                                       
          • 2. Re: Custom transformation provider for OIM GTC connector example?
            Gyanprakash Pandey
            Refer few more here:
            http://fusionsecurity.blogspot.com/2012/04/custom-transformation-provider-for-oim.html
            http://docs.oracle.com/cd/E10391_01/doc.910/e10360/custom_prov.htm

            regards,
            GP
            • 3. Re: Custom transformation provider for OIM GTC connector example?
              967036
              Hi

              the codes are the following:

              The java class:

              public class CustomTransformationProvider implements TransformationProvider {

                   private static String providerType = "TransformationProvider";
                   private static String providerName = "CustomTransformationProvider";
                   private static String errorRespNullInput = "REMSQUAREBRACKETS_INPUTSTR_MISSING";


                   public CustomTransformationProvider() {
                   }

                   @Override
                   public String transformData(Hashtable input, Hashtable utils)
                             throws ProviderException {
                        try {
                             String wholeString = (String) input.get("Input");
                             return transformString(wholeString);
                        }

                        catch (Exception ex) {

                             StringBuffer responseCode = new StringBuffer();
                             responseCode.append(providerType);
                             responseCode.append(".");
                             responseCode.append(providerName);
                             responseCode.append(".");
                             responseCode.append(errorRespNullInput);

                             throw new ProviderException(responseCode.toString(), "message");
                        }
                   }

                   public static String transformString(String stringToTransform) {
                        StringBuilder builder = new StringBuilder();
                        String regex = "\\d+";
                        Matcher matcher = Pattern.compile(regex).matcher(stringToTransform);
                        try {
                             String temp = StringUtils.substringBetween(stringToTransform, "[",
                                       "]");
                             if (temp.length() > 0) {
                                  while (matcher.find()) {
                                       builder.append(matcher.group());
                                  }
                                  if (builder.toString().equals("")) {
                                       return null;
                                  }
                                  return builder.toString();

                             } else
                                  return null;
                        } catch (NullPointerException npe) {
                             return null;
                        }
                   }

              }

              The xml code:

              <?xml version='1.0' encoding='UTF-8'?>
              <Provider>
              <Transformation>
              <TransformationProvider class="com.package.CustomTransformationProvider" name="CustomTransformationProvider">
              <Configuration>
              <Parameter type="Runtime" datatype="String" required="YES" encrypted="NO" name="Input"/>
              <Response code="REMSQUAREBRACKETS_INPUTSTR_MISSING" description="Input String is Missing"/>
              </Configuration>
              </TransformationProvider>
              </Transformation>
              </Provider>

              The .properties file:

              ###### Transformation Provider ######
              gc.provider.TransformationProvider.CustomTransformationProvider=CustomTransformationProvider
              GC.GCPROV.TransformationProvider.CustomTransformationProvider.REMQUOTES_INPUTSTR_MISSING=Input String Missing
              GC.GCPROV.TransformationProvider.CustomTransformationProvider.REMQUOTES_INPUTSTR_MISSING.description=The input string is missing

              Please give me a hint on what i should do further.The thing is that i can't see the option in the drop-down list.
              I think the problem is with the .properties file, but this remains to be seen.

              Any help would be much appreciated!

              Thanks in advance and best regards!

              Carol
              • 4. Re: Custom transformation provider for OIM GTC connector example?
                Dhananjay Neeraj2
                You have almost reached there...
                And yes, the issue is with the properties file..

                Just one small thing will solve your issue..
                Enter 2 lines for Input as well...
                And notice that the last 2 lines which I added do NOT start with gc AND the label and description are NOT Label or Description i.e. they begin with lowercase...

                ###### Transformation Provider ######
                gc.provider.TransformationProvider.CustomTransformationProvider=CustomTransformationProvider
                GC.GCPROV.TransformationProvider.CustomTransformationProvider.REMQUOTES_INPUTSTR_MISSING=Input String Missing
                GC.GCPROV.TransformationProvider.CustomTransformationProvider.REMQUOTES_INPUTSTR_MISSING.description=The input string is missing
                TransformationProvider.CustomTransformationProvider.Input.label=Input
                TransformationProvider.CustomTransformationProvider.Input.description=Enter Input


                Do one more thing...
                Paste these lines in BOTH CustomTransformationProvider_en_US.properties (or CustomTransformationProvider_en.properties) AND customResources_en.properties......
                Upload both of them in MDS...
                Restart the scheduler...

                Your issue should be resolved...
                • 5. Re: Custom transformation provider for OIM GTC connector example?
                  Nishith Nayan
                  try above suggession and let us know the results.
                  • 6. Re: Custom transformation provider for OIM GTC connector example?
                    Kevin Pinsky
                    Nishith Nayan wrote:
                    try above suggession and let us know the results.
                    Just tried what was suggested and it worked perfectly. Oracle documentation is aweful on this.

                    -Kevin
                    • 7. Re: Custom transformation provider for OIM GTC connector example?
                      967036
                      Hello,

                      I tried inserting the two lines in CustomTransformatioProvider_en.properties and it didn't work.I saw that you mentioned something about another file customResources_en.properties.In this entire flow i never encountered this file.What is it's purpose?

                      Are you sure that the java code isn't wrong?

                      Thanks in advance and best regards!

                      Carol
                      • 8. Re: Custom transformation provider for OIM GTC connector example?
                        967036
                        Hi Kevin,

                        I saw that you had success in achieving a full cycle of development.Would you please be so kind to provide my with your codes.I mean not the official ones, but some basics that have functionality.

                        Thanks in advance, best regards and happy development!

                        Carol
                        • 9. Re: Custom transformation provider for OIM GTC connector example?
                          Kevin Pinsky
                          For any single transformation adapter, it required 2 new files, and 2 updated files.

                          For a given provider name as SampleProvider you need the following new and updated files

                          new --> connectorResources/SampleProvider.properties
                          new --> connectorResources/SampleProvider_en.properties
                          updated --> customResources/customResources.properties
                          updated --> customResources/customResources_en.properties

                          Within your XML file that you have uploaded to the mds database in the location /db/GTC/ProviderDefinitions/SampleProvider.xml you have defined your parameters and your response codes:

                          Here is a sample
                          <Parameter type="Runtime" datatype="String" required="YES" encrypted="NO" name="input1"/>
                          <Parameter type="Runtime" datatype="String" required="YES" encrypted="NO" name="input2"/>
                          <Response code="INPUT_MISSING" description="Input String is Missing"/>

                          In each of the files listed above, i have the same entry as follows:
                          gc.provider.TransformationProvider.SampleProvider=SampleProvider
                          GC.GCPROV.TransformationProvider.SampleProvider.INPUT_MISSING=Input String is Missing
                          GC.GCPROV.TransformationProvider.SampleProvider.INPUT_MISSING.description=Input String is Missing
                          TransformationProvider.SampleProvider.input1.label=Input 1
                          TransformationProvider.SampleProvider.input1.description=Input 1
                          TransformationProvider.SampleProvider.input2.label=Input 2
                          TransformationProvider.SampleProvider.input2.description=Input 2

                          When you update the files and have put them in their respective folders as listed above, you will want to run the UploadResources.sh script to upload each of these 4 files to the database.

                          When done, restart your servers and it should now work.

                          -Kevin
                          • 10. Re: Custom transformation provider for OIM GTC connector example?
                            Dhananjay Neeraj2
                            I meant customResources/customResources_en.properties.
                            • 11. Re: Custom transformation provider for OIM GTC connector example?
                              967036
                              Hi Kevin,

                              I'm still facing issues in this matter.I should probably mention that i use 11g R2(the latest release) and so far ii encountered many bugs, some of those are solved by now.

                              Here is what i did untill now:
                              1.Developed java code, packed in jar, copied it in server/JavaTasks and uploaded that jar with UploadJars.sh
                              2.Developed the .xml file and copied it in ProviderDefinitions.
                              3.Developed .properties file and copied it in the server/connectorResources and uploaded it with UploadResourceBundle.sh.
                              4.Restarted the server.
                              5.Went to webconsole but could still not find the actual item in the drop-down list.
                              In my case i only want ot make a transformation of a trivial String.

                              I give you the modified .properties file:
                              ###### Transformation Provider ######
                              gc.provider.TransformationProvider.CustomTransformationProvider=CustomTransformationProvider
                              GC.GCPROV.TransformationProvider.CustomTransformationProvider.REMQUOTES_INPUTSTR_MISSING=The input string is missing
                              GC.GCPROV.TransformationProvider.CustomTransformationProvider.REMQUOTES_INPUTSTR_MISSING.description=The input string is missing
                              TransformationProvider.CustomTransformationProvider.Input.label=Input
                              TransformationProvider.CustomTransformationProvider.Input.description=Input


                              If everyting is ok from the coding point of view then this is a defect of the new release.

                              For the moment i'm still confused about the following lines of your explanation:
                              "For any single transformation adapter, it required 2 new files, and 2 updated files.

                              For a given provider name as SampleProvider you need the following new and updated files

                              new --> connectorResources/SampleProvider.properties
                              new --> connectorResources/SampleProvider_en.properties
                              updated --> customResources/customResources.properties
                              updated --> customResources/customResources_en.properties"

                              What do you mean about 2 required files, 2 updated files and with the connectorResources/SampleProvider.properties?

                              Thanks in advance and best regards!

                              Carol
                              • 12. Re: Custom transformation provider for OIM GTC connector example?
                                Kevin Pinsky
                                The folder customResources already exists in a default environment and contains the following files:

                                customDefaultResources.properties
                                customResources.properties
                                customResources_ar.properties
                                customResources_da.properties
                                customResources_de.properties
                                customResources_en.properties
                                customResources_es.properties
                                customResources_fr.properties
                                customResources_it.properties
                                customResources_ja.properties
                                customResources_ko.properties
                                customResources_pt_BR.properties
                                customResources_zh_CN.properties
                                customResources_zh_TW.properties

                                You need to update the two i mentioned with the same as you did for the connectorResource two files, and upload those resource bundles.

                                -Kevin
                                • 13. Re: Custom transformation provider for OIM GTC connector example?
                                  967036
                                  Indeed you right here, i just found those xml's about two hours ago, followed the steps you described and now i can see mu custom providers in the dropdown list.

                                  With this opportunity i want to take the chance to thank all of you guys who indeed are experts out there.

                                  I hope i won't bother you anymore from here on!

                                  Best regards!

                                  Carol