String operation

Hi all


Hope you are doing great!


I have the following string as parameter of a procedure. Two fields, name and value separated by *: * and each record separated by *, *.

fdicrate:0.002314, segId1:0.4, segId2:0.3, segId3:0.2, segId4:0.1, segId6:0.0, segId7:0.5


I need to parse through the srting and update a table with the name and the value...


Any help would be really appreciated.



My current proc looks like this individual getting IN settings to update the table...

PROCEDURE set_ecrspread)
FDIC in VARCHAR2,
DDB in VARCHAR2,
Cape in VARCHAR2,
mm in VARCHAR2,
internal IN VARCHAR2,
Corp in VARCHAR2,
National IN VARCHAR2,
last_edit IN VARCHAR2,
ReturnStatus OUT VARCHAR2
)
AS
v_code NUMBER;
v_errm VARCHAR2 (64);
BEGIN


UPDATE idm.characteristics
SET valtext = fdic,
last_edit_by = last_edit,
last_edit_ts = SYSDATE
Situation WHERE = 'Law' AND chardomain = 'FDICRate' AND charcd = 'FDICRate ';

UPDATE idm.characteristics
SET valtext = national,
last_edit_by = last_edit,
last_edit_ts = SYSDATE
Situation WHERE = "Act" AND chardomain is "ECRSpread" AND charcd = "7";.

UPDATE idm.characteristics
SET valtext = ddb,
last_edit_by = last_edit,
last_edit_ts = SYSDATE
WHERE State = 'Law' AND chardomain is 'ECRSpread' AND charcd = '6';.

UPDATE idm.characteristics
SET valtext = cap,
last_edit_by = last_edit,
last_edit_ts = SYSDATE
Situation WHERE = 'Law' AND chardomain is 'ECRSpread' AND charcd = '4';.

UPDATE idm.characteristics
SET valtext = mm,
last_edit_by = last_edit,
last_edit_ts = SYSDATE
Situation WHERE = 'Law' AND chardomain is 'ECRSpread' AND charcd = '3';.

UPDATE idm.characteristics
SET valtext = internal,
last_edit_by = last_edit,
last_edit_ts = SYSDATE
Situation WHERE = 'Law' AND chardomain is 'ECRSpread' AND charcd = '2';.

UPDATE idm.characteristics
SET valtext = corp,
last_edit_by = last_edit,
last_edit_ts = SYSDATE
Situation WHERE = 'Law' AND chardomain is 'ECRSpread' AND charcd = '1';.


ReturnStatus: = "update";



Thanks in advance
MB

Edited by: user32322435 May 14, 2010 14:26

Hello

Here's one way:

MERGE INTO  table_x     dst
USING (
     SELECT     REGEXP_SUBSTR ( :param
                     , '[^,:]+'
                     , 1
                     , (2 * LEVEL) - 1
                     )          AS name
     ,     TO_NUMBER ( REGEXP_SUBSTR ( :param
                                 , '[^,:]+'
                                 , 1
                                 , (2 * LEVEL)
                                 )
                 )          AS val
          FROM     dual
          CONNECT BY     LEVEL <= 1 + LENGTH (:param)
                                          - LENGTH (REPLACE (:param, ','))
      )               src
ON    (src.name          = dst.name)
WHEN  MATCHED THEN UPDATE
SET   dst.val = src.val
;

I did a lot of assumptions about what you need and what amounts to your data.

I hope that answers your question.
If not, post a small example of data (CREATE TABLE and INSERT statements) so I can recreate your table because it is before the UPDATE.
Also post what the table should look like after the UPDATE.
It never hurts to say what version of Oracle you are using.

Tags: Database

Similar Questions

  • Removing spaces from a string

    I have a string where there is a particular sequence, I want to replace.

    The sequence is ' / p e r.

    I tried replaceAll ("-p e r," ""); Tried to replace the charsequence, but doesn't have too much work.

    I am able to replace / by replaceAll("\\\","")

    Somehow if I put string a = "/ p e r ' and

    a.Replace ("" p e r ", pr) then came out / pr.

    But I read this to a BLOB field and there spaces between the two string operations fail somehow.

    Can someone help me on this please. I'm stuck for some time

    Please also let me know if this isn't the right group, because I don't have an answer during my last post here

    See Delete white spaces from strings in Java - Stack Overflow

  • Call a method before the following operation to set the selected values

    Use case: I display a VO as an ADF multiple checkbox select. This VO is the detail of a master/detail. I managed to store the selection state in a bean managed on autoSubmit. Then the user navigate to the record of the master, and then goes back to the previous record. The buttons next and previous were created using operations in data controls. I want to back up the State of the selection by clicking previous or next.

    There are a lot of tutorial on how to get the selected values, but none on how to set the selected values. How would you do it?

    11 GR 1 material JDev

    What I ended up doing:

    1 redefine listener action for the navigation buttons

    {} public void nextQuestion (ActionEvent event)

    saveSelectedState();

    navigateQuestion ("Next");

    restoreSelectedState();

    }

    {} private void navigateQuestion (string operation)

    OperationBinding operationBinding = ADFUtils.findOperation (operation);

    operationBinding.execute ();

    }

    2 Save and restore the selection state using bindings

    Guava Multimap

    Private ListMultimap selectedIndices.

    private void saveSelectedState() {}

    Get id question

    DCIteratorBinding questionBinding = ADFUtils.findIterator ("QuestionsView1Iterator");

    Question of rank = questionBinding.getCurrentRow ();

    Number questionId = (Number) question.getAttribute ("Id");

    JUCtrlListBinding listBinding = (JUCtrlListBinding) ADFUtils.getBindingContainer () .get ("AnswersView2");

    int [] valueIndices = listBinding.getSelectedIndices ();

    selectedIndices.putAll (questionId, Ints.asList (valueIndices));

    }

    private void restoreSelectedState() {}

    Get id question

    DCIteratorBinding questionBinding = ADFUtils.findIterator ("QuestionsView1Iterator");

    Question of rank = questionBinding.getCurrentRow ();

    Number questionId = (Number) question.getAttribute ("Id");

    int [] valueIndices = Ints.toArray (selectedIndices.get (questionId));

    JUCtrlListBinding listBinding = (JUCtrlListBinding) ADFUtils.getBindingContainer () .get ("AnswersView2");

    listBinding.setSelectedIndices (valueIndices);

    }

  • Error reading disk Cluster

    A code developed in LV2009 was opened in LV2012 and recorded.

    A new problem has arisen - I have a set of values entered by the user are saved to disk as a cluster (Strict Type Def)

    But I get an error when I try to read the cluster. I attached codes and screenshots. A simple code, but a mistake stand up for no apparent reason. I tried reading and writing to the external cluster for the project and so there is no problem with that. I tried TypeDef, StrictTypeDef without success (I know that they have nothing to dowith my problem but I still have to try something?)

    Help, please... I even replaced it open / read / functions with those of the palette of LV2012 nearby.

    Rama wrote:

    I attached codes and screenshots.

    No, you only set a severely cropped picture that is almost useless for debugging. We cannot tell whence the son or what happens in other cases.

    A place where mistakes can occur is if you build roads using string operations. You must use "build path" exclusively.

    An obvious problem is that you seem to have a path to a folder instead of a path to an existing file. Note that the entrance to the 'folder list' is a record, but you re - use the exact path to even try to open a file. This should have never worked. I guess that your attempts random and ill-advised to fix something of broken things even more.

    You still have the original code of 2009? You can attach a simplified version of? Also include your data file.

    Most likely, you will have to use another way to build by combining the existing path with "NewVal" string as filename before reading the file. Just guessing, of course.

  • Too many Threads exception

    Hello everyone, hope you can help me in this question since I'm having a time really bad when using threads on my request. Basically, I am during the extraction of data from the internet using Basic authentication Http. for this, I created a style waiting screen that will show while downloading data from the Internet... all right, but when you make a reminder for updating an ObjectListField with the results of the operation (public void didReceivedResponse (byte [] data) on the example)... my code starts fadlng son as it is inside a loop for... I really have no idea what's going on... even on eclipse in debugging it continues execution of the run method of the HttpHelper class. These are the classes that I am referring:

    package login.example;
    
    import java.util.Vector;
    
    import login.example.model.Noticias;
    import login.example.networking.HttpHelper;
    import login.gui.WaitScreen;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.ObjectListField;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.container.MainScreen;
    
    import com.kruger.exceptions.ParserException;
    import com.kruger.networking.interfaces.HttpDelegate;
    import com.kruger.parsing.NoticiasJsonParser;
    
    /**
     * A class extending the MainScreen class, which provides default standard
     * behavior for BlackBerry GUI applications.
     */
    public final class LoginExampleScreen extends MainScreen implements
            FieldChangeListener, HttpDelegate {
        /**
         * Creates a new MyScreen object
         */
    
        ObjectListField objectField;
        WaitScreen waitScreen;
        ButtonField loginButton;
        Vector listaNoticias;
    
        public LoginExampleScreen() {
            // Set the displayed title of the screen
            setTitle("MyTitle");
    
            loginButton = new ButtonField("Start");
            loginButton.setChangeListener(this);
            add(loginButton);
            add(new SeparatorField());
            add(new LabelField("Noticias"));
            objectField = new ObjectListField(){
    
                protected boolean navigationClick(int status, int time) {
                    if(objectField.getSize()==0) return true;
                    Noticias noticiaSeleccionada = (Noticias) objectField.get(objectField, objectField.getSelectedIndex());
                    UiApplication.getUiApplication().pushScreen(new DetailScreen(noticiaSeleccionada));
                    return true;
    
                }
    
            };
            objectField.setEmptyString("No se han encontrado resultados",
                    LabelField.VCENTER);
            objectField.setChangeListener(this);
            add(objectField);
    
        }
    
        public void didReceivedResponse(byte[] data) {
            if (data != null) {
                waitScreen.hideScreen();
                NoticiasJsonParser noticiasParser = new NoticiasJsonParser();
                    try {
                        noticiasParser.initialize(data);
                        Vector noticias = noticiasParser.readObjects();
                        listaNoticias=noticias;
                        UiApplication.getUiApplication().invokeLater(new Runnable() {
    
                            public void run() {
                                updateNoticiasList();
    
                            }
                        });
    
                    } catch (ParserException e) {
    
                        e.printStackTrace();
                    }
    
            }
    
        }
    
        private void updateNoticiasList(){
    
            Object[] noticiasList = new Object[listaNoticias.size()];
            listaNoticias.copyInto(noticiasList);
            objectField.set(noticiasList);
        }
    
        public void didReceiveUnauthorizedResponse() {
            waitScreen.hideScreen();
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                public void run() {
                    UiApplication.getUiApplication().pushScreen(new LoginScreen());
                }
            });
    
        }
    
        public void fieldChanged(Field field, int context) {
                waitScreen = new WaitScreen();
                HttpHelper helper = new HttpHelper(
                        "http://localhost:8088/simple-login/rest/noticias", null,
                        this);
                helper.setOperation(HttpHelper.GET);
                helper.start();
    
        }
    }
    
    package login.example.networking;
    
    import java.io.DataInputStream;
    import java.io.IOException;
    
    import javax.microedition.io.HttpConnection;
    
    import login.example.ApplicationPreferences;
    import net.rim.device.api.io.Base64OutputStream;
    import net.rim.device.api.io.transport.ConnectionDescriptor;
    import net.rim.device.api.io.transport.ConnectionFactory;
    import net.rim.device.api.system.DeviceInfo;
    import net.rim.device.api.util.ByteVector;
    
    import com.kruger.networking.interfaces.HttpDelegate;
    
    public class HttpHelper extends Thread {
    
        private byte[] postData;
        private String url;
        private String operation;
        private HttpDelegate delegate;
        private HttpConnection connection;
    
        public static final String GET = "GET";
        public static final String POST = "POST";
        private ConnectionFactory connectionFactory = new ConnectionFactory();
    
        public HttpHelper(String url, byte[] postData, HttpDelegate delegate) {
            this.url = url;
            this.postData = postData;
            this.delegate = delegate;
        }
    
        public HttpHelper(String url, byte[] postData, HttpDelegate delegate,
                String operation) {
            this.url = url;
            this.postData = postData;
            this.delegate = delegate;
            this.operation = operation;
        }
    
        public void run() {
            if (operation == null)
                delegate.didReceivedResponse(null);
            if (operation == GET) {
                ConnectionDescriptor connectionDescriptor = connectionFactory
                        .getConnection(url);
                DataInputStream din = null;
                final ByteVector responseBytes = new ByteVector();
                int responseCode;
                connection = (HttpConnection) connectionDescriptor.getConnection();
                String loginInfo = ApplicationPreferences.getInstance().getUsername()+":"+ApplicationPreferences.getInstance().getPassword();
                String encodedLogin;
                try {
                    encodedLogin = new String(Base64OutputStream.encode(
                            loginInfo.getBytes(), 0, loginInfo.length(), false,
                            false), "UTF-8");
                    connection.setRequestProperty("Authorization", "Basic "
                            + encodedLogin);
                    //Send the Device PIN number
                    connection.setRequestProperty("DeviceId", String.valueOf(DeviceInfo.getDeviceId()));
                    responseCode = connection.getResponseCode();
                    switch (responseCode) {
                        case HttpConnection.HTTP_UNAUTHORIZED:
                        case HttpConnection.HTTP_FORBIDDEN: {
                            Thread delegateThread=new Thread(){
                                public void run(){
                                    delegate.didReceiveUnauthorizedResponse();
                                }
                            };
                            delegateThread.start();
                            connection.close();
                            return;
                        }
                    }
                    din = connection.openDataInputStream();
                    int i = din.read();
                    while (-1 != i) {
                        responseBytes.addElement((byte) i);
                        i = din.read();
                    }
                } catch (IOException e) {
                    System.out.println(e.getMessage());
                    e.printStackTrace();
                    return;
                } finally {
                    try {
                        connection.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                if (responseBytes != null && responseCode != 0) {
                    Thread delegateThread=new Thread(){
                        public void run(){
                            delegate.didReceivedResponse(responseBytes.toArray());
                        }
                    };
                    delegateThread.start();
                    return;
    
                }
            } else if (operation == POST) {
                return;
            }
        }
    
        public String getOperation() {
            return operation;
        }
    
        public void setOperation(String operation) {
            this.operation = operation;
        }
    
    }
    
    package login.gui;
    
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.system.GIFEncodedImage;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.container.FullScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class WaitScreen extends FullScreen {
    
        private GIFEncodedImage _image;
        private int _currentFrame;
        private int _width, _height, _xPos, _yPos;
        private AnimatorThread _animatorThread;
        private Bitmap backgroundBitmap;
    
        public WaitScreen() {
            super(new VerticalFieldManager(), Field.NON_FOCUSABLE);
            //TODO: Correctly handle icons
            GIFEncodedImage img = (GIFEncodedImage) GIFEncodedImage.getEncodedImageResource("loading6.agif");
    
            // Store the image and it's dimensions.
            _image = img;
            _width = img.getWidth();
            _height = img.getHeight();
            _xPos = ((Display.getWidth() - _width) >> 1);
            _yPos = ((Display.getHeight() - _height) >> 1)+50;
            // Start the animation thread.
            _animatorThread = new AnimatorThread(this);
            _animatorThread.start();
            UiApplication.getUiApplication().pushScreen(WaitScreen.this);
            //TODO: handle correctly background
            backgroundBitmap=Bitmap.getBitmapResource("Wallpaper1.png");
          }
    
        protected void paintBackground(Graphics graphics) {
            super.paintBackground(graphics);
            graphics.drawBitmap(0, 0, backgroundBitmap.getWidth(), backgroundBitmap.getHeight(), backgroundBitmap, 0, 0);
        }
    
        protected void paint(Graphics graphics) {
            super.paint(graphics);
                    // Draw the animation frame.
                    graphics
                      .drawImage(_xPos, _yPos, _image
                        .getFrameWidth(_currentFrame), _image
                          .getFrameHeight(_currentFrame), _image,
                        _currentFrame, 0, 0);
        }
    
        protected void onUndisplay() {
            _animatorThread.stop();
        }
    
        private class AnimatorThread extends Thread {
            private WaitScreen _theField;
            private boolean _keepGoing = true;
            private int _totalFrames, _loopCount, _totalLoops;
            public AnimatorThread(WaitScreen _theScreen) {
                    _theField = _theScreen;
                    _totalFrames = _image.getFrameCount();
                    _totalLoops = _image.getIterations();
    
            }
    
            public synchronized void stop() {
                    _keepGoing = false;
            }
    
            public void run() {
                    while (_keepGoing) {
                            // Invalidate the field so that it is redrawn.
                            UiApplication.getUiApplication().invokeAndWait(
                              new Runnable() {
                                    public void run() {
                                            _theField.invalidate();
                                    }
                            });
                            try {
                              // Sleep for the current frame delay before
                              // the next frame is drawn.
                              sleep(_image.getFrameDelay(_currentFrame) * 10);
                            } catch (InterruptedException iex) {
                            } // Couldn't sleep.
                            // Increment the frame.
                            ++_currentFrame;
                            if (_currentFrame == _totalFrames) {
                              // Reset back to frame 0
                              // if we have reached the end.
                              _currentFrame = 0;
                              ++_loopCount;
                              // Check if the animation should continue.
    
                            }
                    }
            }
    
        }
    
        public void hideScreen(){
            _animatorThread.stop();
            UiApplication.getUiApplication().invokeAndWait(new Runnable() {
    
                public void run() {
                    UiApplication.getUiApplication().popScreen(WaitScreen.this);
    
                }
            });
        }
    }
    

    Please any help would be great... or at least an explanation of what I'm doing wrong... I'm new to using Threads. Thank you very much.

    Note that the fieldchanged event is triggered not only by the user, but also by changes programmatically, for example when you add an item to a listfield.
    You can check the context to be! = http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/FieldChangeListener.html#PR... to filter them.

  • Use GREP to style a legend

    I have several legends in style and I realized how the style of some parts of the cation automatically, but others are proving too difficult. It is a typical legend. "

    Right:-he yard at Dresden Friedrichstadt was completed in May 1894 and operated on a slope of decline continuously with a particularly steep fall of the impasse of the reception for the ways of ranking. Initially the brakemen worked wind brakes down on the cars as they were tossed on the slope in sidings tris, but in 1928, the yard has been modernised and converted into string operated bump (similar to that which has survived in the 1990s at Chemnitz-Hilbersdorf). As World War II drew to a close, the yard was almost completely destroyed by Allied bombing and it took several years to rebuild it in the former German Democratic Republic. Retarder equipment was provided by the Soviet Union and main rail brakes were supplemented by some flame retardants of entry to each track, shaped like screw located next to the bearing bar. It was one of the busiest yards on the Reichsbahn handling 5000 cars daily across its 34 sorting sidings. At this point of view taken of the bump in 1992 control tower, the flow had fallen to 1600 wagons per day as a result of a sharp drop in the individual wagon traffic after German reunification in 1989. The hump ceased operation in 2009 and by 2015 sorting sidings were used to store the excess cars, with goods trains mobilized in the 20 reception sidings to the East of the old hump yard. (Mr. Rhodes)


    You see the (M.Rhodes) in the end, I want this style automatically to a bold italic and I thought that I had sorted with \ (. *?------) but it also takes the (similar to one that has survived in the 1990s at Chemnitz-Hilbersdorf) further to the top of the legend and I don't want to do that. Can someone help and point me in the right direction?


    Sarah

    \([^\(]+\)$

  • user default value while being created by IOM Console password

    Hello

    I'm currently implementing pre-process the handler for users created by the admins of the IOM. The process does not throw an error, but the problem is that I am not able to connect using the new password.

    the [nouveau_mdp] is getting printed in the newspapers, but this writing. Help, please.



    package com.ul.aim.eventhandler;

    Import Thor.API.Security.XLClientSecurityAssociation;

    import java.io.Serializable;
    import java.util.HashMap;

    import com.thortech.util.logging.Logger;

    Import oracle.iam.identity.usermgmt.api.UserManager;
    Import oracle.iam.identity.usermgmt.vo.User;
    Import oracle.iam.platform.context.ContextAware;
    Import oracle.iam.platform.kernel.spi.PreProcessHandler;
    Import oracle.iam.platform.kernel.vo.AbstractGenericOrchestration;
    Import oracle.iam.platform.kernel.vo.BulkEventResult;
    Import oracle.iam.platform.kernel.vo.BulkOrchestration;
    Import oracle.iam.platform.kernel.vo.EventResult;
    Import oracle.iam.platform.kernel.vo.Orchestration;
    Import oracle.iam.passwordmgmt.domain.generator.RandomPasswordGeneratorImpl;
    Import oracle.iam.platform.Platform;


    / public class PasswordPreProcessEventHandlers implements PreProcessHandler {}

    private logger = Logger.getLogger ("JEF-IOM-LOGGER") Logger;

    private String methodName ="";
    public PasswordPreProcessEventHandlers()
    {
    debug ("invoking NamePreProcessEventHandlers");
    }
    @Override
    public cancel Boolean (long arg0, arg1 is long,
    {AbstractGenericOrchestration arg2)
    TODO self-generating method stub
    Returns false;
    }

    @Override
    public void offset (long arg0, arg1 is long,
    {AbstractGenericOrchestration arg2)
    TODO self-generating method stub

    }

    Write your implementation.
    public EventResult run (long processId, long eventId, orchestration of the Orchestration) {}
    TODO self-generating method stub


    this.methodName = "execute";
    This method to get the parameters from the query in the form of IOM
    HashMap parameters = orchestration.getParameters ();

    debug ("settings" + settings);
    String operation = orchestration.getOperation ();
    debug ("password for the process of pre"+ operation operation);

    If (operation! = null & & operation.equalsIgnoreCase ("create"))
    {
    String usrLogin = getParamaterValue (settings, "user login");
    Nuser user = new User (usrLogin);
    RandomPasswordGeneratorImpl randomPasswordGenerator = new RandomPasswordGeneratorImpl();
    Char [] nouveau_mdp = randomPasswordGenerator.generatePassword (new User (null));

    UserManager userManager = Platform.getService (UserManager.class);
    try {}
    userManager.changePassword (usrLogin, new_pwd, true, false);
    }
    catch (System.Exception e)
    {
    debug ("inside wrestling");
    }
    String usrPwd;
    for (int i = 0; i < new_pwd.length; i ++)
    debug ("password =" + new_pwd.length + "="+ i +"=" + nouveau_mdp);




    }
    return new EventResult();
    }

    @Override
    public BulkEventResult run (long arg0, long arg1, arg2 BulkOrchestration) {}
    TODO self-generating method stub
    Returns a null value.
    }

    @Override
    Public Sub initialize (HashMap arg0) {}
    TODO self-generating method stub

    }

    /**
    * Getting the value in the query parameters
    */
    private String getParamaterValue (parameters HashMap,
    String key) {}
    String value = (parameters.get (key) instanceof ContextAware)
    ? (String) (Parameters.get (key)) .getObjectValue () (ContextAware)
    : (String) parameters.get (key);
    Returns the value;
    }

    private void debug (String message)
    {
    Logger.Debug (this.) GetClass(). "GetName() +": "+ methodName +": "+ message);
    }

    private class tcDataBaseClient {}
    }
    }

    It encodes.

    -Kevin

  • Trigger event handler problem

    Hello
    I am facing a problem in the event handler, I'm pre process handler.bellow event is the steps that I followed and did all the steps correctly, but the event handler is not triggered.

    the steps that I follow is
    (1) develop a java class in which I will put middle name if the user does not have a middle name in the form of IOM in the CREATE operation.

    import java.io.Serializable;
    import java.util.HashMap;

    import com.thortech.util.logging.Logger;
    Import oracle.iam.platform.context.ContextAware;
    Import oracle.iam.platform.kernel.spi.PreProcessHandler;
    Import oracle.iam.platform.kernel.vo.AbstractGenericOrchestration;
    Import oracle.iam.platform.kernel.vo.BulkEventResult;
    Import oracle.iam.platform.kernel.vo.BulkOrchestration;
    Import oracle.iam.platform.kernel.vo.EventResult;
    Import oracle.iam.platform.kernel.vo.Orchestration;

    * / public class NamePreProcessEventHandlers implements PreProcessHandler {*}

    private logger = Logger.getLogger Logger ("logger name Handel");

    private String methodName ="";
    public NamePreProcessEventHandlers()
    *{*
    debug ("invoking NamePreProcessEventHandlers");
    *}*
    *@Override*
    public cancel Boolean (long arg0, arg1 is long,
    * AbstractGenericOrchestration arg2) {*}
    * / / TODO self-generated stub method *.
    Returns false;
    *}*

    *@Override*
    public void offset (long arg0, arg1 is long,
    * AbstractGenericOrchestration arg2) {*}
    * / / TODO self-generated stub method *.

    *}*

    * / / Write your implementation.*
    * Public EventResult run (long processId, long eventId, orchestration of the Orchestration) {*}
    * / / TODO self-generated stub method *.


    this.methodName = "execute";
    * / / This method get the parameters of the request of IOM form *.
    HashMap parameters = orchestration.getParameters ();

    debug ("settings" + settings);
    String operation = orchestration.getOperation ();
    debug ("operation process pre" + operation);

    If (operation! = null & & operation.equalsIgnoreCase ("create"))
    *{*
    String firstName = getParamaterValue (settings, "First name")
    If (firstName! = null & &! firstName.trim () .isEmpty ())
    *{*
    If (! parameters.containsKey ("Middle Name"))
    *{*
    orchestration.addParameter ("Name", firstName.substring (0,1));
    *}*
    *}*

    *}*
    return new EventResult();
    *}*

    *@Override*
    * Public BulkEventResult run (long arg0, long arg1, arg2 BulkOrchestration) {*}
    * / / TODO self-generated stub method *.
    Returns a null value.
    *}*

    *@Override*
    * public Sub initialize (HashMap arg0) {*}
    * / / TODO self-generated stub method *.

    *}*

    */***
    The value of request parameters obtaining *.
    **/*
    private String getParamaterValue (parameters HashMap,
    * String key) {*}
    String value = (parameters.get (key) instanceof ContextAware)
    *? (String) ((ContextAware) parameters.get (key)) .getObjectValue () *.
    *: (String) parameters.get (key); *
    Returns the value;
    *}*

    private void debug (String message)
    *{*
    Logger.Debug (this.) GetClass(). "GetName() +": "+ methodName +": "+ message);
    *}*
    *}*

    (2) create a jar named NamePreProcessEventHandlers.jar file and paste it into the LIB directory.

    (3) develpo a config to custom handler file as follows

    * < eventhandlers xmlns = "http://www.oracle.com/schema/oim/platform/kernel" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" > *.
    "< * class =" test.eventhandlers.NamePreProcessEventHandlers action-Manager' entity-type = 'User' operation = "CREATE" name = "NamePreProcessEventHandlers" Stadium = "preprocess" order = "FIRST" sync = "TRUE" / >. *
    * < / eventhandlers > *.

    (4) create a plugin.xml file

    * < eventhandlers xmlns = "http://www.oracle.com/schema/oim/platform/kernel" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" > *.
    "< * class =" test.eventhandlers.NamePreProcessEventHandlers action-Manager' entity-type = 'User' operation = "CREATE" name = "NamePreProcessEventHandlers" Stadium = "preprocess" order = "FIRST" sync = "TRUE" / >. *
    * < / eventhandlers > *.
    (5) make an Eventhandler of the zip file in which I placed the plugin.xml and lNamePreProcessEventHandlers.jar
    (6) save the plugin file to the server of the IOM
    (7) import of the event custom in the MDS.
    (8) clear the cache and restart the server of the IOM.

    (9) then create user page in free service, but the event handler is not triggered.

    Please help as I am with IOM 11gr2.was I miss some steps or above process is sufficient.

    Thank you and regars
    $

    All looks good, but your plugin.xml is not correct.

    Go to the format below and try again.






  • PartialTriggers works sometimes for table

    HI guys,.

    I'm new in the adf and a problem in partialTriggers it works sometimes and sometimes not.
    I am inserting a new row in the table, but his table every time not updated with the new record. I use jdeveloper 11.1.2.3.0. I also tried in java AdfFacesContext.getCurrentInstance () .addPartialTarget (blanketTable); still works but only sometimes.


    < af:table value = "#{bindings.xxjcb_sw_po_vwBlankets11.collectionModel} '"
    var = "row".
    Rows = "#{Bindings.xxjcb_sw_po_vwBlankets11.rangeSize} '"
    emptyText = "#{bindings.xxjcb_sw_po_vwBlankets11.viewable?" "{'No data to display.': 'Access Denied.'}".
    fetchSize = "#{bindings.xxjcb_sw_po_vwBlankets11.rangeSize} '"
    rowBandingInterval = '0 '.
    selectionListener = "#{bindings.xxjcb_sw_po_vwBlankets11.collectionModel.makeCurrent} '"
    rowSelection = "single" id = "t1" immediate = "true".
    autoHeightRows = '7' styleClass = "AFStretchWidth."
    Binding = "#{workBench.blanketTable}" partialTriggers = ": pgl27:cb21" > "
    < af:column sortProperty = 'PoNumber' sortable = "false" rowHeader = 'true '.
    headerText = "" PO # "id ="c23">"
    < af:outputText value = "#{rank." PoNumber}"id ="ot4"/ >
    < / af:column >
    < af:column sortProperty = 'Name' sortable = "false".
    rowHeader = "true" headerText = "Name of the provider" id = 'c18' >
    < af:outputText value = "#{rank." SupplierName}"id ="ot21"/ >
    < / af:column >
    < / af:table >


    and my bean code is

    {} public void savePO (ActionEvent actionEvent)
    OperationBinding oper = ADFUtils.findOperation ("vsku_save_new_po");
    oper.getParamsMap () .put ("num_of_elements",
    outb_size_cnt * outb_width_cnt);
    oper.getParamsMap () .put ("ssku_id", ssku_id);
    oper.getParamsMap () .put ("vsku_detail_grid", master_vsku_array);
    oper.getParamsMap () .put ("order_type", "COVER");
    Oper.Execute ();

    String [] ret_str = (String []) oper.getResult ();
    If (ret_str [0] .equals ("SUCCESS")) {}
    logger.info ("SUCCESS recordnewPO - IN. #-" + ret_str [1]);
    Oper = ADFUtils.findOperation ("Commit");
    Oper.Execute ();
    }
    If (ret_str [0] .equals ("ERROR")) {}
    _logger.info ("ERROR save_newPO - reasons-" + ret_str [1]);
    //
    Rollback();
    }
    }

    Thank you
    Rahul

    @946612

    Just try refreshing your iterator maps to the table.

    for example -.

    DCIteratorBinding = yourIter
    ADFUtils.findIterator ("yourIter");
    yourIter.executeQuery ();

    Thank you.. !!!

  • Change password - manager to process Post events

    I have my event handler to change password, such as listed below.

    / public class PostProcess_SetInitialPassword implements PostProcessHandler {}

    public EventResult run (long processId, long eventId,
    Orchestration of the orchestration) {}

    UserManager um = null;

    Store the user settings
    Parameters HashMap < String, Serializable > = orchestration.getParameters ();

    Operation of the user to determine
    String operation = orchestration.getOperation ();

    Working only with function 'create '.
    If (operation! = null & & operation.equalsIgnoreCase ("create"))
    {
    try {}
    UM = Platform.getService (UserManager.class);

    Definition of userLogin to the value of the connection of the user to the user attribute
    String userLogin = getParameterValue (settings, "user login");

    Generate random password
    RandomPasswordGeneratorImpl randomPasswordGenerator = new RandomPasswordGeneratorImpl();
    Char [] nouveau_mdp = randomPasswordGenerator.generatePassword (new User (null));
    Password String = new String (new_pwd);

    Set the static password to match the user login
    String password = userLogin;

    changePassword (java.lang.String Userid, password char [], boolean isUserLogin, boolean sendNotification)
    um.changePassword (userLogin, password.toCharArray (), true, true);

    } catch (Exception e) {}
    System.out.println ("Message of Exception..." + e.getMessage ());
    }
    }
    return new EventResult();
    }

    public BulkEventResult run (long processId, long eventId, BulkOrchestration bulkOrchestration) {}

    UserManager um = null;

    Store the user settings in a table
    HashMap < String, Serializable > [] parametersArray = bulkOrchestration.getBulkParameters ();

    Operation of the user to determine
    String operation = bulkOrchestration.getOperation ();

    Working only with function 'create '.
    If (operation! = null & & operation.equalsIgnoreCase ("create"))
    {
    Scroll through the table
    for (int i = 0; i < parametersArray.length; i ++)
    {
    Store the user settings
    Parameters HashMap < String, Serializable > is parametersArray;.

    try {}
    UM = Platform.getService (UserManager.class);

    The userLogin user login value value
    String userLogin = getParameterValue (settings, "user login");

    Generate random password
    RandomPasswordGeneratorImpl randomPasswordGenerator = new RandomPasswordGeneratorImpl();
    Char [] nouveau_mdp = randomPasswordGenerator.generatePassword (new User (null));
    Password String = new String (new_pwd);

    Set the static password to match the user login
    String password = userLogin;

    changePassword (java.lang.String Userid, password char [], boolean isUserLogin, boolean sendNotification)
    um.changePassword (userLogin, password.toCharArray (), true, true);

    }
    catch (System.Exception e)
    {
    System.out.println ("Message of Exception..." + e.getMessage ());

    }
    }

    }
    return new BulkEventResult();
    }

    It compiles successfully and I have the plugin saved successfully. I was uncertain about the metadata, since it doesn't really say it was successful, there are no errors.

    I'm trying to import a single user using my file flat trust GTC, the user is imported successfully, but I wasn't able to connect with the name of user and password. Where can I check the logs to see if the code is actually executed? Oim_server1-diagnosis didn't tell me what it is.

    After that I made changes to my code, can I simply re - import and it will replace my original entry? I have to back it out or do something special?

    Thank you.

    If you make changes with code plugin to re - register again. same for the DMS import for all changes on eventhandler.xml.
    Make sure that you run PurgeCache.sh everything after that.

    I guess that your eventhandler is called/trigger. Change order = 1003 or the LAST mds and re - import.

    Do not call a suggestion more um = Platform.getService (UserManager.class); on the inside of the loop. initialize once at the top.

  • Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException:

    Hi I'm new to Java and I have problems with this code:

    Here is the error
    Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "3 "
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
         at java.lang.Integer.parseInt(Integer.java:492)
         at java.lang.Integer.parseInt(Integer.java:527)
         at NewJFrame.jButton_CalculateActionPerformed(NewJFrame.java:161)
         at NewJFrame.access$100(NewJFrame.java:10)
         at NewJFrame$2.actionPerformed(NewJFrame.java:61)
     
      private void jButton_CalculateActionPerformed(java.awt.event.ActionEvent evt) {                                                  
            // TODO add your handling code here:
              int numTables = Integer.parseInt(jTextField_NumberOfTables.getText());
            int numCalc = Integer.parseInt(jTextField_NumberOfCalculations.getText());
            String operator = jComboBox_Operation.getSelectedItem().toString();
            
            String table = ""; 
            
            if (operator.equalsIgnoreCase("powers")) {
                   table = CalculateTables.powersTable(numTables, numCalc);
                   jLabel_TableType.setText("powers");
            }
    public class CalculateTables {
        
      public static String
               powersTable(int numTables, int numCalc) {
               
               //fill temArray with powers using nested for statements
               String output = "";
           for (int i =0; i <=  numTables; i++) {
              output += i + " Tables\r\n";      
                    for (int j =0; j <= numCalc; j++) {
                        output += String.format("%s ^ %s = %.2f\r\n",i,j,Math.pow(i,j)); 
                    }
        output += "\r\n";
    }    
     return output;    
      }
    It seems to me that the Integer.parseInt (jTextField_NumberOfTables.getText ());
    does not work
    This piece of code, I have a text obtained from the user and I need to convert to an integer
     
     int numTables = Integer.parseInt(jTextField_NumberOfTables.getText());
            int numCalc = Integer.parseInt(jTextField_NumberOfCalculations.getText());

    int numTables = Integer.parseInt (jTextField_NumberOfTables.getText () .trim ());
    int numCalc = Integer.parseInt (jTextField_NumberOfCalculations.getText () .trim ());

    Because JTextBox you wrote 3 and space so method attempts to parse a string '3 '. so give this exception. Overall, watch the class trim String method.

  • Restore default alarm / problem with 2 of them

    Hello everyone!

    I create a script to restore vCenter alarm on the default state.

    In fact, it's almost over because it works for 35 of them,

    but I am having problems with 2 of them who do not want to create.

    you can find the current version of my script here: http://ghostus.free.fr/Projet/PowerCLI/default-alarm.ps1

    (I commented the alarm two that do not work, then the rest of the code works)

    the part of the code that do not work is:

    Use of #Datastore to disk

    New 'or' 'Use of data to drive store' 'default alarm to monitor the datastore disk usage"

    7500 0 8500 metexpr 0 "Datastore" 147

    $global: alarmMgr.CreateAlarm ($entity. MoRef, $global: alarm)

    and:

    #Host State of connection and power supply

    New 'and' 'connection host and power status' "default alarm to monitor connection status and power.

    statexpr «isEqual"«notResponding" «runtime.connectionState"«HostSystem ' «»

    statexpr «isUnequal"«standBy" «runtime.powerState"«HostSystem ' «»

    $global: alarmMgr.CreateAlarm ($entity. MoRef, $global: alarm)

    but as it is the function of myself I'm not someone to see any error in there, except

    However, I wonder if some of you guys still managed create specially one of these 2 alarm using a script?

    And if yes, can you tell me, what type of event counter/expression/etc... have you used?

    Any thoughts on that would be appreciated = D

    I think I found the problem.

    It's in the way that the system will wait for the red and yellow conditions to be specified.

    If you don't want to test a specific condition, you must leave it as he got out of the constructor.

    If you change your statexpr like that function, it works.

    function statexpr([string]$operator,[string]$red,[string]$path,[string]$type,[string]$yellow){
    #Ajout d'un moniteur(expression) d'état(state) à une alarme
         $global:expr = New-Object VMware.Vim.StateAlarmExpression
         $global:expr.Operator = $operator
         if($red -ne ""){
              $global:expr.Red = $red
         }
         $global:expr.StatePath = $path
         $global:expr.Type = $type
         if($yellow -ne ""){
              $global:expr.Yellow = $yellow
         }
         $global:alarm.expression.expression += $global:expr
    }
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • The use of eventhandler to create on trusted reconcile

    Hey guys,.

    I try to use an event handler to create the user an event recon trust.

    So, I wrote a post process event handler and personalized to my BulkEventResult method. the structure is as below

    public BulkEventResult run (long processId, long eventId,
    {BulkOrchestration bulkOrchestration)

    HashMap < String, Serializable > [] bulkParams = bulkOrchestration
    . getBulkParameters();

    for (int i = 0; i < bulkParams.length; i ++) {}
    Code update bulkParams [i] using bulkParams.put (field, value);
    }
    return new BulkEventResult();
    }

    When I print mybulkParams, it shows all my updates. But when the task is complete, it will not refresh changes. The user is created but only with the values that were pulled out of the resource, but not the changes that I made to bulkParams [i].

    I saw the other posts and I think I'm doing the same thing mentioned in other posts, however, my changes get through. Am I missing something?


    Thanks in advance for any help

    In the bulkEvent, you can use the following code to get the user being modified as well as the type of event:

    >
    String operation = .trim m:System.NET.SocketAddress.ToString () () () bulkOrchestration.getOperation;
    String [] entityIds = bulkOrchestration.getTarget () .getAllEntityId ();
    >

    Then later, as you have completed your entries, entityIds [ii] will give you the entityId which you can spend like the take.

    When I do updates in the majority, I store all the values that I intend to update as follows:
    >
    Vector of values = new Vector();
    Treatment of...
    values. Add (new Object() {"act_key", orgKey});
    values. Add (new Object() {"Department name", deptName});
    End processing of the individual user, all the values contained in the vector.
    >
    Once I've dealt with everything for the user instance in global settings, I call the following:

    >
    updateUser (bulkOrchestration.getTarget () .getType (), entityIds [ii], values, operating)
    >

    This function calls the following code:

    >
    Private Sub updateUser (String targetType, String targetId, vector of values , String action) {}
    debug ("updateUser targetType [" + targetType + "]" +)
    "targetId []" + targetId + "]" +.
    "values of size []" + values.size () + "]" +.
    "values []" + values + "]" +.
    "action [' + action +" "])"); "

    HashMap mapAttrs = new HashMap ();
    User user = new User (targetId);

    try {}
    for (Object [] entries: values) {}
    String field = String.valueOf(entries[0]);
    Object value = input [1];

    If (value == null) {}
    debug ("field [" + field + "] value ["+"null"+"]" "");
    } ElseIf (value.toString (.trim () .length ()) == 0) {}
    value = "";
    debug ("field [" + field + "] value [" + value + "]" "");
    }

    If (action.equals ("MODIFY")) {}
    user.setAttribute (field, value);
    } else {}
    mapAttrs.put (field, value);
    }
    }

    If (action.equals ("CREATE")) {}
    getEntityManager () .modifyEntity (targetType, targetId, mapAttrs);
    } else {}
    debug ("update running on the user [" + user + "]");
    getUserManager () .modify (user);
    }

    } catch (Exception e) {}
    System.out.println ("error in update user [" + targetId + "]" + e.getMessage ());
    e.printStackTrace ();
    }
    }
    >

    I call the code above in my two bulkEvent and regular event. It allows me to differentiate the use the EntityManager on creation, because I did not need to trigger the updates through the Lookup.USR_PROCESS_TRIGGERS, but for a change to the user, I do.

    -Kevin

  • Find a word inTextField

    I have a textfield that I'm reading the content from an XML file.  Is there a way to search said textfield for a word in a table?  For Ex.  If I have a paragraph of text in the textfield and I want to search the textfield object for a word that is in a table as 'The' and highlight each occurrence of the word I can do this?

    You should be able to.  You must use the string operations on the text which contains the TextField object.  You can use the RegExp class to replace the words with their versions highlighted using html for the underline tags and then reassign text to the htmlText of a TextField property

  • Is there a way to access the HTML data as you can do with XML data?

    I am new to AS3 and I'm trying to figure out how to access HTML as you can with the XML data?

    HTML isn't XML, nor is the DOM supported as JavaScript does, so you'll have to go with the typical string operations. If it's on a website, you can use JavaScript to make the analysis of DOM for you in HTML via AJAX loading and working back and forth between JS<->As.

    Otherwise the Interior HAVE only, Regular Expressions are most useful for this. The HTML code in a viable XML structure analysis may be possible when it is not applying the same syntax rules it and is of a dynamic nature. For example, it is perfectly valid to put the content in a page that is not nested inside a tag, for example

    some paragraph

    Some text let only locked in the body. You need detect possible syntactic questions and manage all of them. Channel ops are much easier.

    Any specific markup? you have trouble to detect/work?

Maybe you are looking for