Search Results

Search found 1007 results on 41 pages for 'rajendra kumar uppal'.

Page 6/41 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • How to find validity of a string of parentheses, curly brackets and square brackets?

    - by Rajendra
    I recently came in contact with this interesting problem. You are given a string containing just the characters '(', ')', '{', '}', '[' and ']', for example, "[{()}]", you need to write a function which will check validity of such an input string, function may be like this: bool isValid(char* s); these brackets have to close in the correct order, for example "()" and "()[]{}" are all valid but "(]", "([)]" and "{{{{" are not! I came out with following O(n) time and O(n) space complexity solution, which works fine: Maintain a stack of characters. Whenever you find opening braces '(', '{' OR '[' push it on the stack. Whenever you find closing braces ')', '}' OR ']' , check if top of stack is corresponding opening bracket, if yes, then pop the stack, else break the loop and return false. Repeat steps 2 - 3 until end of the string. This works, but can we optimize it for space, may be constant extra space, I understand that time complexity cannot be less than O(n) as we have to look at every character. So my question is can we solve this problem in O(1) space?

    Read the article

  • How i call NSObject method in UIViewController class method?

    - by Rajendra Bhole
    Hi,I am the beginner in iphone development. I develop an application in which i calling some GPS related information(method name is getGPSInformation{}) in clsGPS{} is an pure NSObject class.The code is as follows, import "clsGPS.h" -(void)getGPSInformation { locationManager = [[CLLocationManager alloc ] init]; locationManager.delegate = self; locationManager.distanceFilter = 5.0f; locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; [locationManager startUpdatingLocation]; } I want the above method calling in UIViewController class. How i call this method in UIViewController class from that i automatically call this method at application launching time? should i calling that method in viewDidLoad event or viewWillAppear method?

    Read the article

  • How i store the images pixels in matrix form?

    - by Rajendra Bhole
    Hi, I developing an application in which the pixelize image i want to be store in matrix format. The code is as follows. struct pixel { //unsigned char r, g, b,a; Byte r, g, b; int count; }; (NSInteger) processImage1: (UIImage*) image { // Allocate a buffer big enough to hold all the pixels struct pixel* pixels = (struct pixel*) calloc(1, image.size.width * image.size.height * sizeof(struct pixel)); if (pixels != nil) { // Create a new bitmap CGContextRef context = CGBitmapContextCreate( (void*) pixels, image.size.width, image.size.height, 8, image.size.width * 4, CGImageGetColorSpace(image.CGImage), kCGImageAlphaPremultipliedLast ); NSLog(@"1=%d, 2=%d, 3=%d", CGImageGetBitsPerComponent(image), CGImageGetBitsPerPixel(image),CGImageGetBytesPerRow(image)); if (context != NULL) { // Draw the image in the bitmap CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, image.size.width, image.size.height), image.CGImage); NSUInteger numberOfPixels = image.size.width * image.size.height; I confusing about how to initialize the 2-D matrix in which the matrix store data of pixels.

    Read the article

  • Shall web services call on iphone using GPRS connectivity?

    - by Rajendra Bhole
    Hi, I am beginner in iphone development. I develop an application in which i call some web services in my application. When that application i ran on iphone device using Wi-Fi connectivity then it work fine and well condition also in good performance, but when that application ran on GPRS connection then the web service call well and after that application collapsed.What will be the exact problem dose with my application? Could any different setting between Wi-Fi and GPRS?

    Read the article

  • How i installing iphone application in iphone using window operating system?

    - by Rajendra Bhole
    Hi,My process have done on before, 1) I developing an application for apple iphone an generating .app file using Ad-Hoc build. 2) My iphone os is 3.1.2 and i developing .ipa file simply drag-and-drop my .app file into iTunes on apple leopard 10.5.8 version. 3) After that this .ipa file again drag-and-drop in windowsXP iTunes. 4) Then sync iphone to iTunes of windowsXP and that .ipa file from iTunes(WindowsXP) in my iphone having version 3.1.2 . The above process i have done, it will fine worked on 3.1.2 but it not working and installing on iphone device 3.1.3 version. How i troubleshoot the above problem.

    Read the article

  • How i finding Internate network error using Try..........Catch in iphone?

    - by Rajendra Bhole
    Hi, I developing an application in which i calling web services on iphone. I want to implement Try.......Catch in that code for catching internet and GPRS connection error.The code is as follow, NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:mainURL5]]; [request setHTTPMethod:@"POST"]; NSHTTPURLResponse* urlResponse = nil; NSError *error = [[[NSError alloc] init] autorelease]; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error]; result5 = [[NSMutableString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; I was using Try......catch but it didn't work that code as follows, @try { //prepar request NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:mainURL5]]; [request setHTTPMethod:@"POST"]; NSHTTPURLResponse* urlResponse = nil; NSError *error = [[[NSError alloc] init] autorelease]; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error]; result5 = [[NSMutableString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; } @catch(NSException * e) { [clsMessageBox ShowMessageOK:@"some text" :[e reason]]; }

    Read the article

  • Where i get the better idea to which type of application base should be in iphone?

    - by Rajendra Bhole
    Hi, I want to develop an application in which i doesn't any idea about how to create my app with which controller class i should i have gave? My application first screen contain TabBarController and i have also inserting UINavigationController. On above scenario i little bit confused which type of controller(confusion in TabBarController, NavigationBarController or simple ViewController ya windows based appliaction) should i take.

    Read the article

  • How i pass my view to nib at run time(Dynamically) in viewController class?

    - by Rajendra Bhole
    Hi, I want to create viewController class programmatically in which the view of nib file of viewController is not fixed. I have a UntitledViewController class that contains 4 UIButtons: -(IBAction)buttonPressed:(id)sender{ if((UIButton *)sender == button1){ tagNumber = button1.tag; NewViewController *newVC = [[NewViewController alloc] init]; //newVC.tagN [self.navigationController pushViewController:newVC animated:YES]; NSLog(@"Button Tag Number:- %i", tagNumber); } if((UIButton *) sender == button2){ tagNumber = button2.tag; NewViewController *newVC = [[NewViewController alloc] init]; [self.navigationController pushViewController:newVC animated:YES]; } if((UIButton *) sender == button3){ tagNumber = button3.tag; NewViewController *newVC = [[NewViewController alloc] init]; [self.navigationController pushViewController:newVC animated:YES]; } if((UIButton *) sender == button4){ int x = tagNumber; tagNumber = button4.tag; NewViewController *newVC = [[NewViewController alloc] init]; newVC.untitledVC = self; [self.navigationController pushViewController:newVC animated:YES]; } } When I will click any one of the UIButtons, I want to create a new NewViewController class with button tag property but without fixed nib file. In NewViewController's loadView event I want to fix the view of the nib of NewViewController class using UIButton's tag property (In NewViewController.xib I'm creating 4 UIViews named view1, view2, view3 and view4). -(void)loadView{ [super loadView]; CGRect frame = CGRectMake(0, 0, 320, 480); UIView *newView = [[UIView alloc] initWithFrame:frame]; newView.tag = untitledVC.tagNumber; self.view1 = newView; } Now I want that when I click button1 the NewViewController will be generated with view1 and when I click button2 the NewViewController will be generated with view2 and so on with different implementation. Thanks.

    Read the article

  • Problem in data binding in NSString?

    - by Rajendra Bhole
    Hi, I selecting the row of the table. The text of the row i stored in the application delegate object as a NSString. That NSString i want to retrieving or binding in SELECT statement of SQLite query, For that i written code in the TableView Class (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { selectedText = [appDelegate.categoryArray objectAtIndex:indexPath.row]; appDelegate.selectedTextOfRow = selectedText; ListOfPrayersViewController *listVC = [[ListOfPrayersViewController alloc] init]; [self.navigationController pushViewController:listVC animated:YES]; [listVC release]; } and database class class code is. + (void) getDuas:(NSString *)dbPath{ if(sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK){ SalahAppDelegate *appDelegate = (SalahAppDelegate *)[[UIApplication sharedApplication] delegate]; NSString *categoryTextForQuery =[NSString stringWithFormat:@"SELECT Category FROM Prayer WHERE Category ='%s'", appDelegate.selectedTextOfRow ]; NSLog(@"The Text %@", categoryTextForQuery); //const char *sqlQuery1 = (char *)categoryTextForQuery; //const char *sqlQuery = "SELECT Category FROM Prayer WHERE Category = 'Invocations for the beginning of the prayer'"; sqlite3_stmt *selectstmt; if(sqlite3_prepare_v2(database, [categoryTextForQuery UTF8String], -1, &selectstmt, NULL) == SQLITE_OK){ appDelegate.duasArray =[[NSMutableArray alloc] init]; while(sqlite3_step(selectstmt) == SQLITE_ROW){ NSString *dua = [[NSString alloc] initWithCString:(char *)sqlite3_column_text(selectstmt,0) encoding:NSASCIIStringEncoding]; Prayer *prayerObj = [[Prayer alloc] initwithDuas:dua]; prayerObj.DuaName = dua; [appDelegate.duasArray addObject:prayerObj]; } } } } The code is comes out of loop on the statement or starting the loop of the while(sqlite3_step(selectstmt) == SQLITE_ROW) Why? How i bind the table selected text in SELECT statement of sqlite?

    Read the article

  • Problem in to navigate on UITableView on the UIButtonClick which is present in UITabBarController sc

    - by Rajendra Bhole
    Hi, I develop an application in which i want to on UIButton Click the application navigate on UITableViewcontroller class.The UIButton is already on UITabBarController during the navigation the tab bar should be visible.The calling method in first tab bar controller class is, [appDelegate.nvcHome pushViewController:itemMenuTable animated:YES]; [itemMenuTable release]; itemMenuTable = nil; But it given me the following problem in GDB, Application tried to push a nil view controller on target . Also i want to display the icon and title of UITabBarController in programmatically, the code is, homeViewControllerLink = [[homeViewController alloc]initWithNibName:@"homeViewController" bundle:nil]; nvcHome = [[UINavigationController alloc]initWithRootViewController:homeViewControllerLink]; nvcHome.navigationBar.barStyle = UIStatusBarStyleBlackOpaque; UIImage *imgHomeTab = [UIImage imageNamed:@"home"]; [nvcHome.tabBarItem initWithTitle:@"Home" image:imgHomeTab tag:101]; [homeViewControllerLink release]; But it does not display when i running my app on iphone simulator.

    Read the article

  • Find largest rectangle containing only zeros in an N&times;N binary matrix

    - by Rajendra
    Given an NxN binary matrix (containing only 0's or 1's), how can we go about finding largest rectangle containing all 0's? Example: I 0 0 0 0 1 0 0 0 1 0 0 1 II->0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 <--IV 0 0 1 0 0 0 IV is a 6×6 binary matrix; the return value in this case will be Cell 1: (2, 1) and Cell 2: (4, 4). The resulting sub-matrix can be square or rectangular. The return value can also be the size of the largest sub-matrix of all 0's, in this example 3 × 4.

    Read the article

  • Random movement of wandering monsters in x & y axis in LibGDX

    - by Vishal Kumar
    I am making a simple top down RPG game in LibGDX. What I want is ... the enemies should wander here and there in x and y directions in certain interval so that it looks natural that they are guarding something. I spend several hours doing this but could not achieve what I want. After a long time of coding, I came with this code. But what I observed is when enemies come to an end of x or start of x or start of y or end of y of the map. It starts flickering for random intervals. Sometimes they remain nice, sometimes, they start flickering for long time. public class Enemy extends Sprite { public float MAX_VELOCITY = 0.05f; public static final int MOVING_LEFT = 0; public static final int MOVING_RIGHT = 1; public static final int MOVING_UP = 2; public static final int MOVING_DOWN = 3; public static final int HORIZONTAL_GUARD = 0; public static final int VERTICAL_GUARD = 1; public static final int RANDOM_GUARD = 2; private float startTime = System.nanoTime(); private static float SECONDS_TIME = 0; private boolean randomDecider; public int enemyType; public static final float width = 30 * World.WORLD_UNIT; public static final float height = 32 * World.WORLD_UNIT; public int state; public float stateTime; public boolean visible; public boolean dead; public Enemy(float x, float y, int enemyType) { super(x, y); state = MOVING_LEFT; this.enemyType = enemyType; stateTime = 0; visible = true; dead = false; boolean random = Math.random()>=0.5f ? true :false; if(enemyType == HORIZONTAL_GUARD){ if(random) velocity.x = -MAX_VELOCITY; else velocity.x = MAX_VELOCITY; } if(enemyType == VERTICAL_GUARD){ if(random) velocity.y = -MAX_VELOCITY; else velocity.y = MAX_VELOCITY; } if(enemyType == RANDOM_GUARD){ //if(random) //velocity.x = -MAX_VELOCITY; //else //velocity.y = MAX_VELOCITY; } } public void update(Enemy e, float deltaTime) { super.update(deltaTime); e.stateTime+= deltaTime; e.position.add(velocity); // This is for updating the Animation for Enemy Movement Direction. VERY IMPORTANT FOR REAL EFFECTS updateDirections(); //Here the various movement methods are called depending upon the type of the Enemy if(e.enemyType == HORIZONTAL_GUARD) guardHorizontally(); if(e.enemyType == VERTICAL_GUARD) guardVertically(); if(e.enemyType == RANDOM_GUARD) guardRandomly(); //quadrantMovement(e, deltaTime); } private void guardHorizontally(){ if(position.x <= 0){ velocity.x= MAX_VELOCITY; velocity.y= 0; } else if(position.x>= World.mapWidth-width){ velocity.x= -MAX_VELOCITY; velocity.y= 0; } } private void guardVertically(){ if(position.y<= 0){ velocity.y= MAX_VELOCITY; velocity.x= 0; } else if(position.y>= World.mapHeight- height){ velocity.y= -MAX_VELOCITY; velocity.x= 0; } } private void guardRandomly(){ if (System.nanoTime() - startTime >= 1000000000) { SECONDS_TIME++; if(SECONDS_TIME % 5==0) randomDecider = Math.random()>=0.5f ? true :false; if(SECONDS_TIME>=30) SECONDS_TIME =0; startTime = System.nanoTime(); } if(SECONDS_TIME <=30){ if(randomDecider && position.x >= 0) velocity.x= -MAX_VELOCITY; else{ if(position.x < World.mapWidth-width) velocity.x= MAX_VELOCITY; else velocity.x= -MAX_VELOCITY; } velocity.y =0; } else{ if(randomDecider && position.y >0) velocity.y= -MAX_VELOCITY; else velocity.y= MAX_VELOCITY; velocity.x =0; } /* //This is essential so as to keep the enemies inside the boundary of the Map if(position.x <= 0){ velocity.x= MAX_VELOCITY; //velocity.y= 0; } else if(position.x>= World.mapWidth-width){ velocity.x= -MAX_VELOCITY; //velocity.y= 0; } else if(position.y<= 0){ velocity.y= MAX_VELOCITY; //velocity.x= 0; } else if(position.y>= World.mapHeight- height){ velocity.y= -MAX_VELOCITY; //velocity.x= 0; } */ } private void updateDirections() { if(velocity.x > 0) state = MOVING_RIGHT; else if(velocity.x<0) state = MOVING_LEFT; else if(velocity.y>0) state = MOVING_UP; else if(velocity.y<0) state = MOVING_DOWN; } public Rectangle getBounds() { return new Rectangle(position.x, position.y, width, height); } private void quadrantMovement(Enemy e, float deltaTime) { int temp = e.getEnemyQuadrant(e.position.x, e.position.y); boolean random = Math.random()>=0.5f ? true :false; switch(temp){ case 1: velocity.x = MAX_VELOCITY; break; case 2: velocity.x = MAX_VELOCITY; break; case 3: velocity.x = -MAX_VELOCITY; break; case 4: velocity.x = -MAX_VELOCITY; break; default: if(random) velocity.x = MAX_VELOCITY; else velocity.y =-MAX_VELOCITY; } } public float getDistanceFromPoint(float p1,float p2){ Vector2 v1 = new Vector2(p1,p2); return position.dst(v1); } private int getEnemyQuadrant(float x, float y){ Rectangle enemyQuad = new Rectangle(x, y, 30, 32); if(ScreenQuadrants.getQuad1().contains(enemyQuad)) return 1; if(ScreenQuadrants.getQuad2().contains(enemyQuad)) return 2; if(ScreenQuadrants.getQuad3().contains(enemyQuad)) return 3; if(ScreenQuadrants.getQuad4().contains(enemyQuad)) return 4; return 0; } } Is there a better way of doing this. I am new to game development. I shall be very grateful to any help or reference.

    Read the article

  • OIM 11g notification framework

    - by Rajesh G Kumar
    OIM 11g has introduced an improved and template based Notifications framework. New release has removed the limitation of sending text based emails (out-of-the-box emails) and enhanced to support html features. New release provides in-built out-of-the-box templates for events like 'Reset Password', 'Create User Self Service' , ‘User Deleted' etc. Also provides new APIs to support custom templates to send notifications out of OIM. OIM notification framework supports notification mechanism based on events, notification templates and template resolver. They are defined as follows: Ø Events are defined as XML file and imported as part of MDS database in order to make notification event available for use. Ø Notification templates are created using OIM advance administration console. The template contains the text and the substitution 'variables' which will be replaced with the data provided by the template resolver. Templates support internationalization and can be defined as HTML or in form of simple text. Ø Template resolver is a Java class that is responsible to provide attributes and data to be used at runtime and design time. It must be deployed following the OIM plug-in framework. Resolver data provided at design time is to be used by end user to design notification template with available entity variables and it also provides data at runtime to replace the designed variable with value to be displayed to recipients. Steps to define custom notifications in OIM 11g are: Steps# Steps 1. Define the Notification Event 2. Create the Custom Template Resolver class 3. Create Template with notification contents to be sent to recipients 4. Create Event triggering spots in OIM 1. Notification Event metadata The Notification Event is defined as XML file which need to be imported into MDS database. An event file must be compliant with the schema defined by the notification engine, which is NotificationEvent.xsd. The event file contains basic information about the event.XSD location in MDS database: “/metadata/iam-features-notification/NotificationEvent.xsd”Schema file can be viewed by exporting file from MDS using weblogicExportMetadata.sh script.Sample Notification event metadata definition: 1: <?xml version="1.0" encoding="UTF-8"?> 2: <Events xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation="../../../metadata/NotificationEvent.xsd"> 3: <EventType name="Sample Notification"> 4: <StaticData> 5: <Attribute DataType="X2-Entity" EntityName="User" Name="Granted User"/> 6: </StaticData> 7: <Resolver class="com.iam.oim.demo.notification.DemoNotificationResolver"> 8: <Param DataType="91-Entity" EntityName="Resource" Name="ResourceInfo"/> 9: </Resolver> 10: </EventType> 11: </Events> Line# Description 1. XML file notation tag 2. Events is root tag 3. EventType tag is to declare a unique event name which will be available for template designing 4. The StaticData element lists a set of parameters which allow user to add parameters that are not data dependent. In other words, this element defines the static data to be displayed when notification is to be configured. An example of static data is the User entity, which is not dependent on any other data and has the same set of attributes for all event instances and notification templates. Available attributes are used to be defined as substitution tokens in the template. 5. Attribute tag is child tag for StaticData to declare the entity and its data type with unique reference name. User entity is most commonly used Entity as StaticData. 6. StaticData closing tag 7. Resolver tag defines the resolver class. The Resolver class must be defined for each notification. It defines what parameters are available in the notification creation screen and how those parameters are replaced when the notification is to be sent. Resolver class resolves the data dynamically at run time and displays the attributes in the UI. 8. The Param DataType element lists a set of parameters which allow user to add parameters that are data dependent. An example of the data dependent or a dynamic entity is a resource object which user can select at run time. A notification template is to be configured for the resource object. Corresponding to the resource object field, a lookup is displayed on the UI. When a user selects the event the call goes to the Resolver class provided to fetch the fields that are displayed in the Available Data list, from which user can select the attribute to be used on the template. Param tag is child tag to declare the entity and its data type with unique reference name. 9. Resolver closing tag 10 EventType closing tag 11. Events closing tag Note: - DataType needs to be declared as “X2-Entity” for User entity and “91-Entity” for Resource or Organization entities. The dynamic entities supported for lookup are user, resource, and organization. Once notification event metadata is defined, need to be imported into MDS database. Fully qualified resolver class name need to be define for XML but do not need to load the class in OIM yet (it can be loaded later). 2. Coding the notification resolver All event owners have to provide a resolver class which would resolve the data dynamically at run time. Custom resolver class must implement the interface oracle.iam.notification.impl.NotificationEventResolver and override the implemented methods with actual implementation. It has 2 methods: S# Methods Descriptions 1. public List<NotificationAttribute> getAvailableData(String eventType, Map<String, Object> params); This API will return the list of available data variables. These variables will be available on the UI while creating/modifying the Templates and would let user select the variables so that they can be embedded as a token as part of the Messages on the template. These tokens are replaced by the value passed by the resolver class at run time. Available data is displayed in a list. The parameter "eventType" specifies the event Name for which template is to be read.The parameter "params" is the map which has the entity name and the corresponding value for which available data is to be fetched. Sample code snippet: List<NotificationAttribute> list = new ArrayList<NotificationAttribute>(); long objKey = (Long) params.get("resource"); //Form Field details based on Resource object key HashMap<String, Object> formFieldDetail = getObjectFormName(objKey); for (Iterator<?> itrd = formFieldDetail.entrySet().iterator(); itrd.hasNext(); ) { NotificationAttribute availableData = new NotificationAttribute(); Map.Entry formDetailEntrySet = (Entry<?, ?>)itrd.next(); String fieldLabel = (String)formDetailEntrySet.getValue(); availableData.setName(fieldLabel); list.add(availableData); } return list; 2. Public HashMap<String, Object> getReplacedData(String eventType, Map<String, Object> params); This API would return the resolved value of the variables present on the template at the runtime when notification is being sent. The parameter "eventType" specifies the event Name for which template is to be read.The parameter "params" is the map which has the base values such as usr_key, obj_key etc required by the resolver implementation to resolve the rest of the variables in the template. Sample code snippet: HashMap<String, Object> resolvedData = new HashMap<String, Object>();String firstName = getUserFirstname(params.get("usr_key"));resolvedData.put("fname", firstName); String lastName = getUserLastName(params.get("usr_key"));resolvedData.put("lname", lastname);resolvedData.put("count", "1 million");return resolvedData; This code must be deployed as per OIM 11g plug-in framework. The XML file defining the plug-in is as below: <?xml version="1.0" encoding="UTF-8"?> <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <plugins pluginpoint="oracle.iam.notification.impl.NotificationEventResolver"> <plugin pluginclass= " com.iam.oim.demo.notification.DemoNotificationResolver" version="1.0" name="Sample Notification Resolver"/> </plugins> </oimplugins> 3. Defining the template To create a notification template: Log in to the Oracle Identity Administration Click the System Management tab and then click the Notification tab From the Actions list on the left pane, select Create On the Create page, enter values for the following fields under the Template Information section: Template Name: Demo template Description Text: Demo template Under the Event Details section, perform the following: From the Available Event list, select the event for which the notification template is to be created from a list of available events. Depending on your selection, other fields are displayed in the Event Details section. Note that the template Sample Notification Event created in the previous step being used as the notification event. The contents of the Available Data drop down are based on the event XML StaticData tag, the drop down basically lists all the attributes of the entities defined in that tag. Once you select an element in the drop down, it will show up in the Selected Data text field and then you can just copy it and paste it into either the message subject or the message body fields prefixing $ symbol. Example if list has attribute like First_Name then message body will contains this as $First_Name which resolver will parse and replace it with actual value at runtime. In the Resource field, select a resource from the lookup. This is the dynamic data defined by the Param DataType element in the XML definition. Based on selected resource getAvailableData method of resolver will be called to fetch the resource object attribute detail, if method is overridden with required implementation. For current scenario, Map<String, Object> params will get populated with object key as value and key as “resource” in the map. This is the only input will be provided to resolver at design time. You need to implement the further logic to fetch the object attributes detail to populate the available Data list. List string should not have space in between, if object attributes has space for attribute name then implement logic to replace the space with ‘_’ before populating the list. Example if attribute name is “First Name” then make it “First_Name” and populate the list. Space is not supported while you try to parse and replace the token at run time with real value. Make a note that the Available Data and Selected Data are used in the substitution tokens definition only, they do not define the final data that will be sent in the notification. OIM will invoke the resolver class to get the data and make the substitutions. Under the Locale Information section, enter values in the following fields: To specify a form of encoding, select either UTF-8 or ASCII. In the Message Subject field, enter a subject for the notification. From the Type options, select the data type in which you want to send the message. You can choose between HTML and Text/Plain. In the Short Message field, enter a gist of the message in very few words. In the Long Message field, enter the message that will be sent as the notification with Available data token which need to be replaced by resolver at runtime. After you have entered the required values in all the fields, click Save. A message is displayed confirming the creation of the notification template. Click OK 4. Triggering the event A notification event can be triggered from different places in OIM. The logic behind the triggering must be coded and plugged into OIM. Examples of triggering points for notifications: Event handlers: post process notifications for specific data updates in OIM users Process tasks: to notify the users that a provisioning task was executed by OIM Scheduled tasks: to notify something related to the task The scheduled job has two parameters: Template Name: defines the notification template to be sent User Login: defines the user record that will provide the data to be sent in the notification Sample Code Snippet: public void execute(String templateName , String userId) { try { NotificationService notService = Platform.getService(NotificationService.class); NotificationEvent eventToSend=this.createNotificationEvent(templateName,userId); notService.notify(eventToSend); } catch (Exception e) { e.printStackTrace(); } } private NotificationEvent createNotificationEvent(String poTemplateName, String poUserId) { NotificationEvent event = new NotificationEvent(); String[] receiverUserIds= { poUserId }; event.setUserIds(receiverUserIds); event.setTemplateName(poTemplateName); event.setSender(null); HashMap<String, Object> templateParams = new HashMap<String, Object>(); templateParams.put("USER_LOGIN",poUserId); event.setParams(templateParams); return event; } public HashMap getAttributes() { return null; } public void setAttributes() {} }

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >