Search Results

Search found 11001 results on 441 pages for 'native drag drop'.

Page 150/441 | < Previous Page | 146 147 148 149 150 151 152 153 154 155 156 157  | Next Page >

  • How to filter and intercept Linux packets by using net_dev_add() API?

    - by Khajavi
    I'm writing ethernet network driver for linux. I want to receive packets, edit and resend them. I know how to edit the packet in packet_interceptor function, but how can I drop incoming packets in this function?? #include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/ip.h> #include <net/sock.h> struct packet_type my_proto; int packet_interceptor(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) { // I dont want certain packets go to upper in net_devices for further processing. // How can I drop sk_buff here?! return 0; } static int hello_init( void ) { printk(KERN_INFO "Hello, world!\n"); my_proto.type = htons(ETH_P_ALL); my_proto.dev = NULL; my_proto.func = packet_interceptor; dev_add_pack(&my_proto); return 0; } static void hello_exit(void) { dev_remove_pack(&my_proto); printk(KERN_INFO "Bye, world\n"); } module_init(hello_init); module_exit(hello_exit);

    Read the article

  • Getting hover text with selenium in java

    - by BinaryEmpire
    I am trying to figure out how to get the product availability text from a page like http://www.walmart.com/browse/TV-Video/TVs/_/N-96v3? (once a store has been selected) I selected 76574 as my zipcode and went to the "In My Store" tab The code I have now is WebElement hoverElement = driver.findElement(By.xpath(".//*[@id='Body_15992428']/span")); WebElement hidden = driver.findElement(By.xpath(".//*[@id='slapInfo_NoVariant_15992428']/div")); Actions builder = new Actions(driver); builder.clickAndHold(hoverElement).build().perform(); System.out.println(hidden.getText()); **Edit: I tried profile.setEnableNativeEvents(false); and the text is now displayed in the automated browser window. I still cannot get to the text I want though. It does not throw an exception, only displays nothing because the driver thinks its still hidden. Any one know how to fix this? I keep getting Exception in thread "main" org.openqa.selenium.InvalidElementStateException: Cannot perform native interaction: Could not load native events component. Even after I do profile.setEnableNativeEvents(true); Are there any other ways I can get the hidden text, or what am I doing wrong here? Additionally while I was inspecting the code with firebug, I saw that there is this code <script type="text/javascript"> WALMART.$(document).ready(function(){ WALMART.$('#Body_15992428').hover(function(){ WALMART.$('#SeeStoreAvailBubble').wmBubble('update',WALMART.$('#bubbleMsgUpdate_15992428').html()); }); }); </script> I dont really know how to do things directly with javascript but is there is any way of getting the message text directly from that with a javascript executor?

    Read the article

  • Phonegap: Will my mobile app 'feel' faster or slower once ported to phonegap?

    - by user15872
    So I'm designing everything in mobile Safari and I know that phonegap is essentially a stripped webview but... Question: Will my application will run better in phonegap? (revised below) a)I imagine my navigation and core app will load faster as the scripts and images are on the hard drive. Is this True? b)I assume since they've been working on it for 2 years now that they may have made some optimizations to make it quicker than just an average safari window. Is this true? (Assuming both html5/js/css code bases are pretty much the same and app is running on iOS.) Update: Sorry, I meant to compare apples to slightly different apples. Question 1 revised: Will my app see any performance benefits running with in a phonegap environment vs standard mobile safari? (compare mobile - to mobile) 1b) In what ways, other than loading time has phonegap optimized performance over standard mobile safari? Follow ups: 1) Are there any pitfalls, other than large libraries, that may cause phonegap to suffer a serious performance hit vs stand mobile safari? 2) Can I mix native and webview rendering? (i.e the top half of my app is rendered in with html/css/js and the bottom half native)

    Read the article

  • Storing records in a dropdownlist from DB without using LINQ Data source

    - by user1318369
    I have a website for dance academy where Users can register and add/drop dance classes. In the web page to drop a particular dance, for a particular user, the dropdown displays her registered dances. Now I want to delete one of the dances from the list. So i'll remove the row from the table and also from the dropdownlist. The problem is that everytime the item with the lowest ID (index) is getting deleted, no matter which one the user selects. I think I am storing the DataTextField and DataValueField for the dropdown incorrectly. Can someone please help me out? The code is: private void PopulateDanceDropDown() { var registereddanceList = from dd in context.DANCER_AND_DANCE where dd.UserId == dancerId select new { Text = dd.DanceName, Value = dd.DanceId }; dances.DataSource = registereddanceList; dances.DataTextField = "Text"; dances.DataValueField = "Value"; dances.DataBind(); } protected void dropthedance(object o, EventArgs e) { String strDataValueField = dances.SelectedItem.Value; int danceIDFromDropDown = Convert.ToInt32(strDataValueField); var dancer_dance = from dd in context.DANCER_AND_DANCE where dd.DanceId == danceIDFromDropDown select dd; foreach (var dndd in dancer_dance) { context.DANCER_AND_DANCE.DeleteOnSubmit(dndd); } try { context.SubmitChanges(); } catch (Exception ex) { Console.WriteLine(ex); } PopulateDanceDropDown(); }

    Read the article

  • Problem with Java FX Look and Feel

    - by drachenfels
    Hi, I was looking at some of the examples from the Deitel and Deitel's book for Programming in Java, and one of the first examples is a very simple Swing display. Hence this snippet of code : import javax.swing.*; public class cdea { public static void main(String args[]){ JOptionPane.showMessageDialog(null,"\"Welcome to Java Programming!\""); System.exit(0); //end method main } } I read some stuff regarding how one can get native UI look and feel by using UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); to the program. However, when I just add this to my main method, it gives me a host of errors. Specifically : Multiple markers at this line - Unhandled exception type IllegalAccessException - Unhandled exception type InstantiationException - Unhandled exception type ClassNotFoundException - Unhandled exception type UnsupportedLookAndFeelException However when I use it as part of a try/catch exception loop (is that what it is called?) as detailed on http://stackoverflow.com/questions/1590863/getting-java-applications-to-look-native-on-windows-how , I get the program running properly. Could anyone tell me in simple language why this is so? As in, why can't I directly get the System look and feel; why do I have to use it with exception handling? I'm new to Java, and OOP in general, so I'm sorry if I'm being too simplistic.

    Read the article

  • Insert Into Two SQL Tables From XML Maintaining Relationship

    - by Thx
    I am looking to insert records from xml into two different tables. For example <Root> <A> <AValue>1</AValue> <Children> <B> <BValue>2</BValue> </B> </Children> </A> </Root> Would insert a record into table A AID AValue # 1 also insert a record into table B BID AID BValue # #(Same as AID Above) 2 I have this DECLARE @idoc INT DECLARE @doc NVARCHAR(MAX) SET @doc = ' <Root> <A> <AValue>1</AValue> <Children> <B> <BValue>2</BValue> </B> </Children> </A> </Root> ' EXEC sp_xml_preparedocument @idoc OUTPUT, @doc CREATE TABLE #A ( AID INT IDENTITY(1, 1) , AValue INT ) INSERT INTO #A SELECT * FROM OPENXML (@idoc, '/Root/A',2) WITH (AValue INT ) CREATE TABLE #B ( BID INT IDENTITY(1, 1) , AID INT , BValue INT ) INSERT INTO #B SELECT * FROM OPENXML (@idoc, '/Root/A/Children/B',2) WITH ( AID INT, BValue INT ) SELECT * FROM #A SELECT * FROM #B DROP TABLE #A DROP TABLE #B Thanks!

    Read the article

  • Facebook-ios-sdk with embedded UIWebView

    - by Benchtop Creative
    I'm working with the new facebook-ios-sdk and have successfully integrated the api into my native app. I am able to authenticate a user and properly setup permissions using a popup dialog with the ios-sdk classes. For a portion of my app I need to use the facebook connection within a UIWebView, using javascript and html to process data within the webview. Given that the user is already logged in and authenticated via the above routine, I would have assumed that the UIWebView would share those credentials, or that there would at least be some way to pass or assign the credentials to the webview. Unfortunately, I found this earlier post which seems to suggest that this scheme doesn't quite work (iOS - being logged-in in a webView after logging in with the SDK). Has anyone else encountered this and/or found a work around? This seems like it would be a fairly straightforward use case given that I'm not trying to launch mobile safari or something like that - it's all within the same native app. It just seems like there must be some sort of easy trick or setting that I'm missing. Maybe somehow setting cookies in the new UIWebView? or something like this?

    Read the article

  • Potential Django Bug In QuerySet.query?

    - by Mike
    Disclaimer: I'm still learning Django, so I might be missing something here, but I can't see what it would be... I'm running Python 2.6.1 and Django 1.2.1. (InteractiveConsole) >>> from myproject.myapp.models import * >>> qs = Identifier.objects.filter(Q(key="a") | Q(key="b")) >>> print qs.query SELECT `app_identifier`.`id`, `app_identifier`.`user_id`, `app_identifier`.`key`, `app_identifier`.`value` FROM `app_identifier` WHERE (`app_identifier`.`key` = a OR `app_identifier`.`key` = b ) >>> Notice that it doesn't put quotes around "a" or "b"! Now, I've determined that the query executes fine. So, in reality, it must be doing so. But, it's pretty annoying that printing out the query prints it wrong. Especially if I did something like this... >>> qs = Identifier.objects.filter(Q(key=") AND") | Q(key="\"x\"); DROP TABLE `app_identifier`")) >>> print qs.query SELECT `app_identifier`.`id`, `app_identifier`.`user_id`, `app_identifier`.`key`, `app_identifier`.`value` FROM `app_identifier` WHERE (`app_identifier`.`key` = ) AND OR `app_identifier`.`key` = "x"); DROP TABLE `app_identifier` ) >>> Which, as you can see, not only creates completely malformed SQL code, but also has the seeds of a SQL injection attack. Now, obviously this wouldn't actually work, for quite a number of reasons (1. The syntax is all wrong, intentionally, to show the oddity of Django's behavior. 2. Django won't actually execute the query like this, it will actually put quotes and slashes and all that in there like it's supposed to). But, this really makes debugging confusing, and it makes me wonder if something's gone wrong with my Django installation. Does this happen for you? If so/not, what version of Python and Django do you have? Any thoughts?

    Read the article

  • Safe json parsing with jquery?

    - by user246114
    Hi, I am using jquery with json. My client pages generate json, which I store on my server. The clients can then fetch the json back out later, parse, and show it. Since my clients are generating the json, it may not be safe. I think jquery uses eval() internally. Is that true? Is there a way to use the native json parsers from the browsers where available, otherwise fall back to manual parsing if not? I'm new to jquery so I don't know where I'd insert my own parsing code. I'm doing something like: $.ajax({ url: 'myservlet', type: 'GET', dataType: 'json', timeout: 1000, error: function(){ alert('Error loading JSON'); }, success: function(json){ alert("It worked!: " + json.name + ", " + json.grade); } }); so in the success() method, the json object is already parsed for me. Is there a way to catch it as a raw string first? Then I can decide whether to use the native parsers or manual parsing (hoping there's a jquery plugin for that..). The articles I'm reading are all from different years, so I don't know if jquery has already abandoned eval() already for json, Thank you

    Read the article

  • Dropdownlist value not being set when there is a default blank option

    - by uriDium
    I am using ASP.Net MVC. I have a partial view which has a form with dropdownlists. The dropdownlists are set via ViewData. The partial view is used in a Create and Edit page. The create works fine. I get the dropdownlists and the blank option is a "Please select", like so <%= Html.DropDownList("ContactNrType", ViewData["ContactNrType"] as SelectList, "Please Select") %> But this doesn't seem to work for my edit. If I have that extra "Please select" parameter then it does not select the value for the drop down. I am setting the value of the drop down in the controller like so ViewData["ContactNrType"] = new SelectList(new List<string> { "Mobile", "Home", "Work", "Friend" }, candidate.ContactNrType); Any idea as to what I am doing wrong? I want to share the partial view which contains the form between the two pages. So I need the "Please Select" option for the Create. And I need the value set for the Edit (I don't mind that it has an option that still says "Please Select").

    Read the article

  • NHibernate not dropping foreign key constraints.

    - by Kendrick
    I'm new to NHibernate, so this is probably my mistake, but when I use: schema.Create(true, true); I get: SchemaExport [(null)]- There is already an object named 'XXX' in the database. System.Data.SqlClient.SqlException: There is already an object named 'XXX' in the database. I grabbed the SQL code nHibernate was using, ran it directly from MSSMS, and recieved similar errors. Looking into it, the generated code is not properly dropping the foreign key constraints. The drop looks like this: if exists (select 1 from sysobjects where id = OBJECT_ID(N'dbo[FK22212EAFBFE4C58]') AND parent_obj = OBJECT_ID('YYY')) alter table dbo.YYY drop constraint FK22212EAFBFE4C58 Doing a "select OBJECT_ID(N'dbo[FK22212EAFBFE4C58]')" I get null. If I take out the "dbo" (i.e. "select OBJECT_ID(N'[FK22212EAFBFE4C58]')") then the ID is returned. So, my question is, why is nHibernate adding the dbo, and why does that prevent the object from being returned (since the table owning the constraint is dbo.XXX) One of my mapping files: <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping namespace="CanineApp.Model" assembly="CanineApp.Model" xmlns="urn:nhibernate-mapping-2.2"> <class name="MedicalLog" table="MedicalLog" schema="dbo"> <id name="MedicalLogID" type="Int64"> <generator class="identity" /> </id> <property name="InvoiceAmount" type="Decimal" not-null="true" /> ... <many-to-one name="Canine" class="Canine" column="CanineID" not-null="true" fetch="join" /> <many-to-one name="TreatmentCategory" class="TreatmentCategory" column="TreatmentCategoryID" not-null="true" access="field.camelcase-underscore" /> </class> </hibernate-mapping>

    Read the article

  • Quantifying the Performance of Garbage Collection vs. Explicit Memory Management

    - by EmbeddedProg
    I found this article here: Quantifying the Performance of Garbage Collection vs. Explicit Memory Management http://www.cs.umass.edu/~emery/pubs/gcvsmalloc.pdf In the conclusion section, it reads: Comparing runtime, space consumption, and virtual memory footprints over a range of benchmarks, we show that the runtime performance of the best-performing garbage collector is competitive with explicit memory management when given enough memory. In particular, when garbage collection has five times as much memory as required, its runtime performance matches or slightly exceeds that of explicit memory management. However, garbage collection’s performance degrades substantially when it must use smaller heaps. With three times as much memory, it runs 17% slower on average, and with twice as much memory, it runs 70% slower. Garbage collection also is more susceptible to paging when physical memory is scarce. In such conditions, all of the garbage collectors we examine here suffer order-of-magnitude performance penalties relative to explicit memory management. So, if my understanding is correct: if I have an app written in native C++ requiring 100 MB of memory, to achieve the same performance with a "managed" (i.e. garbage collector based) language (e.g. Java, C#), the app should require 5*100 MB = 500 MB? (And with 2*100 MB = 200 MB, the managed app would run 70% slower than the native app?) Do you know if current (i.e. latest Java VM's and .NET 4.0's) garbage collectors suffer the same problems described in the aforementioned article? Has the performance of modern garbage collectors improved? Thanks.

    Read the article

  • ASP.NET - Google Chrome caching DropDownList selections

    - by Fake
    I'm experiencing what seems to be a caching issue with Google Chrome and Safari on my cart page. In the cart there are 2 dropdown lists. When you hit the checkout button after changing the values in the dropdown lists, it commits what's selected in the lists to the database. It's a little bit hard to explain the unexpected behavior so I will try to write it out step by step with an illustration of my problem. Lets say the first dropdown list has the values of: VALUE1 VALUE2 VALUE3 And the second dropdown list has the values of: DUMBO1 DUMBO2 DUMBO3 I add an item to my cart. Screen Says: VALUE1, DUMBO1 Database Says: VALUE1, DUMBO1 I hit Checkout. Database says: VALUE1, DUMBO1 (I can't see the dropdown lists after I hit checkout because i'm not at the cart page) I hit the back button. Screen Says: VALUE1, DUMBO1 Database Says: VALUE1, DUMBO1 I drop down the VALUE1 combo and select VALUE2, VALUE2 is selected momentarily and then the site posts back and VALUE1 is re-selected in the drop down list (from being reloaded from the DB) MOMENTARILY Screen Says: VALUE2, DUMBO1 Database Says: VALUE1, DUMBO1 THEN AFTER POSTBACK FROM DROPDOWNLIST_SELECTIONCHANGED EVENT Screen Says: VALUE1, DUMBO1 Database Says: VALUE1, DUMBO1 Hit Checkout. Database Says VALUE1 ,DUMBO1 (I can't see the dropdown lists after I hit checkout because i'm not at the cart page) Go back. Screen Says: VALUE2, DUMBO1 Database Says: VALUE1, DUMBO1 So it appears that it's remembering my selection of VALUE2 even though it jumped back to VALUE1 before I checked out. It seems to be a caching problem, however I've got some no-cache code to prevent caching of that page that works great in firefox and internet explorer but seems to be failing in Chrome and Safari. I'm basically returning in the headers for the cart page: no-cache, no-store, and must-revalidate to attempt to prevent caching, but based on this scenario it seems to be caching the page anyway and not reloading it when I hit the back button. I am open to any solutions or suggestions at this point. Thanks!

    Read the article

  • jquery asp.net combo box question

    - by coson
    Good Day, I have a small form with a combo box (ASP.NET Drop Down List control) and a text box (with a DIV id txtName). When the selected index of the combo box changes, I want to clear out the text box. I understand that: $("#txtName").val(''); clears the text box value The thing is the combo box. It contains a list of integers representing the months of the year. The drop down control is called ddlMonths. $("#ddlMonths").change(function() { $("#txtName").val(''); }); I thought by using change, an onSelectedIndexChange event handler would be associated with this control. I also tried (because I've ran into the client id being mangled in ASP.NET w/ jQuery) this: $("#<%=ddlMonths.ClientID%>").change(function() { $("#<%=txtName.ClientID%>").val(''); }); and neither approach seems to be working. Am I missing something? TIA, coson

    Read the article

  • How to conduct an interview for a development position remotely?

    - by sharptooth
    Usually we run interviews in office. We have a room with a table, the interviewee and one or two interviewers sit at the table, interviewers ask questions, often accompanied with code snippets on paper, the interviewee (hopefully) answers them, writes code snippets to illustrate his point. Usually it's something like an interviewer writes about five lines of C++ code and asks some specific question - quite a little code. Now we need to do the same remotely. We will be in our office and the interviewee will be far away - we are asked to help hire a person for another office located abroad. Of course we can use some technology for voice calls, but I'm afraid it's the most we can count on. I see a whole set of obstacles here: how to write illustration code snippets and exchange them efficiently? what to do to compensate for the fact that we're not native English speakers and the interviewees might or might be not native English speakers (I'm afraid this can make conversation significantly harder)? Are there any best practices for this situation? How could we address the obstacles listed? What other things should we consider to run the interview most efficiently?

    Read the article

  • Not getting concept of null

    - by appu
    Hy Guys, Beginning with mysql. I am not able to grasp the concept of NULL. Check screen-shot (*declare_not_null, link*). In it when I specifically declared 'name' field to be NOT NULL. When i run the 'desc test' table command, the table description shows default value for name field to be NULL.Why is that so? From what I have read about NULL, it connotes a missing or information that is not applicable. So when I declare a field to be NOT NULL it implies (as per my understanding) that user must enter a value for the name field else the DB engine should generate an error i.e. record will not be entered in DB. However when i run 'insert into test value();' the DB engine enters the record in table. Check screen-shot(*empty_value, link*). FLICKR LINKS *declare_not_null* http://www.flickr.com/photos/55097319@N03/5302758813/ *empty_values* Check the second screenshot on flickr Q.2 what would be sql statemetn to drop a primary key from a table's field. If I use 'ALTER TABLE test drop key id;' it gives the following: ERROR: Incorrect table definition; there can be only one auto column and it must be defined as a key. Thanks for your help..

    Read the article

  • NoInitialContextException: in ejb 3

    - by JavaDeveloper
    My client class code Hashtable hs = new Hashtable(); hs.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); hs.put(Context.PROVIDER_URL, "jnp://10.20.52.41:1200"); hs.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); Context context = new InitialContext(hs); System.out.println("-----"); try { Example helloWorld = (Example) context .lookup("Example"); helloWorld.display("HelloWorld"); } catch (NamingException e) { System.out.println("naming exception occoured"); e.printStackTrace(); } My session bean code public class Example implements javax.ejb.SessionBean { //method here.. } getting following exception. how to resolve? Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.(InitialContext.java:197) at comtest.client.Example.main(Test.java:22) Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:249) at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654) ... 4 more

    Read the article

  • Stored Procedure, 'incorrect syntax error'

    - by jacksonSD
    Attempting to figure out sp's, and I'm getting this error: "Msg 156, Level 15, State 1, Line 5 Incorrect syntax near the keyword 'Procedure'." the error seems to be on the if, but I can drop other existing tables with stored procedures the exact same way so I'm not clear on why this isn't working. can anyone shed some light? Begin Set nocount on Begin Try Create Procedure uspRecycle as if OBJECT_ID('Recycle') is not null Drop Table Recycle create table Recycle (RecycleID integer constraint PK_integer primary key, RecycleType nchar(10) not null, RecycleDescription nvarchar(100) null) insert into Recycle (RecycleID,RecycleType,RecycleDescription) values ('1','Compost','Product is compostable, instructions included in packaging') insert into Recycle (RecycleID,RecycleType,RecycleDescription) values ('2','Return','Product is returnable to company for 100% reuse') insert into Recycle (RecycleID,RecycleType,RecycleDescription) values ('3','Scrap','Product is returnable and will be reclaimed and reprocessed') insert into Recycle (RecycleID,RecycleType,RecycleDescription) values ('4','None','Product is not recycleable') End Try Begin Catch DECLARE @ErrMsg nvarchar(4000); SELECT @ErrMsg = ERROR_MESSAGE(); Throw 50001, @ErrMsg, 1; End Catch -- checking to see if table exists and is loaded: If (Select count(*) from Recycle) >1 begin Print 'Recycle table created and loaded '; Print getdate() End set nocount off End

    Read the article

  • <select> box not displaying on Android in PhoneGap

    - by Steve Nay
    I have some HTML code in a PhoneGap application that displays a <select> box to the user. When I tap on it, the usual Android selection screen doesn't pop up. I had a similar problem with this earlier on webOS (although at that time the drop-downs were working properly). The <select> is inside a <div> that gets hidden or shown at certain times during execution: <div id="submit"> <ul class="rounded"> <li><select id="item"></select></li> </ul> </div> The problem only occurs when the <div> has been hidden and then shown again (either directly through CSS or by using jQuery's hide() and show() methods. If I move the <select> box outside of that <div>, or if I make the <div> always visible, then the drop-down behaves as it should; no problems. Why is this?

    Read the article

  • Camera crashes in android 4.1(API level 16)

    - by Lincy
    My application has a camera functionality. It works fine in all Android version but now when i tested in S3 it crashes. The error points to this line: Parameters parameters = mCamera.getParameters(); Could someone provide a solution for this? The log is below: ?:??: W/?(?): java.lang.NullPointerException ?:??: W/?(?): at com.stpl.snapshun.camera.CameraActivity.surfaceChanged(CameraActivity.java:313) ?:??: W/?(?): at android.view.SurfaceView.updateWindow(SurfaceView.java:554) ?:??: W/?(?): at android.view.SurfaceView.access$000(SurfaceView.java:81) ?:??: W/?(?): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169) ?:??: W/?(?): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:671) ?:??: W/?(?): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1818) ?:??: W/?(?): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998) ?:??: W/?(?): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212) ?:??: W/?(?): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) ?:??: W/?(?): at android.view.Choreographer.doCallbacks(Choreographer.java:555) ?:??: W/?(?): at android.view.Choreographer.doFrame(Choreographer.java:525) ?:??: W/?(?): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) ?:??: W/?(?): at android.os.Handler.handleCallback(Handler.java:615) ?:??: W/?(?): at android.os.Handler.dispatchMessage(Handler.java:92) ?:??: W/?(?): at android.os.Looper.loop(Looper.java:137) ?:??: W/?(?): at android.app.ActivityThread.main(ActivityThread.java:4745) ?:??: W/?(?): at java.lang.reflect.Method.invokeNative(Native Method) ?:??: W/?(?): at java.lang.reflect.Method.invoke(Method.java:511) ?:??: W/?(?): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) ?:??: W/?(?): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) ?:??: W/?(?): at dalvik.system.NativeStart.main(Native Method) Thanks in advance

    Read the article

  • Dropdown menu not showing when using position: absolute;

    - by Xiy
    I've just turned my website into a responsive layout and along the way I've somehow managed to make my dropdown menus not work. When hovering over 'Drop-downs' they don't display unless I'm using position: relative. They worked before using position: absolute - but it seems they only work with position relative now. When using relative it uses the width which messes up the navigation bar. Using relative: http://d.pr/i/tp5R Using absolute: http://d.pr/i/j7r1 CSS for my sub-menu div.left_first_header ul.sub-menu { width: 125px; top: 14px; z-index: 2; height: 100%; position: absolute; -webkit-border-radius: 0px 0px 4px 4px; -moz-border-radius: 0px 0px 4px 4px; background: url(images/drop_down_bg.jpg); padding-left: 15px; padding-right: 15px; background-repeat: repeat; } jQuery for the drop down functionality jQuery(document).ready(function ($) { jQuery("ul.dropdown li").hover(function() { $('ul:first',this).css('visibility', 'visible'); }, function() { jQuery(this).removeClass("hover"); jQuery('ul:first',this).css('visibility', 'hidden'); }); }); My website http://wpvault.com/kahlam/ Considering it's 4am I've probably made a really stupid simple mistake. I apologise if I've missed anything.

    Read the article

  • Textbox time validations (javascript)

    - by unos
    I have a textbox in which user can enter time (eg- 01:00) and also a drop down box for entering AM/PM fields. (Since the AM/PM field is used, 12-hour time format is used.) The text box allows a max entry of 5 chars only (eg - 01:00). Pls let me know how I can set the 3rd char as a default -colon : , so that the user simply has to enter only the time. How to check if the time entered by the user is numeric or not?. Autocompletion feature : for eg, if user enters 1 then it would automatically be set to 01:00 Javascript Validations for 12-hour format. Eg: if user enters 13:00 then it should change to 01:00 How can I append the text box time values with the am/pm value selected in the drop down box?. Once the values are appended, automatically populate another text box (text box 2) with the result. Eg: 01:00 + pm should be set as 01:00p in the new text box (text box 2). Any help would be appreciated.

    Read the article

  • MySql - JSON data not showing in html

    - by Ramzie
    I'm trying to create a drop down list from a MySql. The php is successfully fetching the data from the MySql. But my problem is the data is not showing on the drop down list in my HTML page? json_mysql_data2.php header("Content-Type: application/json"); require_once("con.php"); $i=0; $jsonData = array(); foreach ($conn_db->query("SELECT customerID FROM customers WHERE furniture='33' ") as $result){ $i++; $jsonData["article".$i]=$result['customerID']; } echo json_encode($jsonData); myJS.js $(document).ready(function(){ var ddlist = document.getElementById("ddlist"); var hr = new XMLHttpRequest(); hr.open("GET", "json_mysql_data2.php", true); hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); hr.onreadystatechange = function() { if(hr.readyState == 4 && hr.status == 200) { var d = JSON.parse(hr.responseText); for(var o in d){ if(d[o].title){ ddlist.innerHTML += '</option><option value='+d[o].title+'</option>'; } } } } hr.send("null"); ddlist.innerHTML = "Loading Customer ID...."; }); html <script src="myJS.js" type="text/javascript"></script> </head> <body> <div class="dlist"> Customer ID: <select id='EmpLst' name="dwlist" onchange='document.getElementById("val1").value = this.value;'><option value="">SELECT STUDENT ID</option> <div id="ddlist"></div> </select> </div>

    Read the article

  • Visual Studio 2010 and .NET 4 Released

    - by ScottGu
    The final release of Visual Studio 2010 and .NET 4 is now available. Download and Install Today MSDN subscribers, as well as WebsiteSpark/BizSpark/DreamSpark members, can now download the final releases of Visual Studio 2010 and TFS 2010 through the MSDN subscribers download center.  If you are not an MSDN Subscriber, you can download free 90-day trial editions of Visual Studio 2010.  Or you can can download the free Visual Studio express editions of Visual Web Developer 2010, Visual Basic 2010, Visual C# 2010 and Visual C++.  These express editions are available completely for free (and never time out).  If you are looking for an easy way to setup a new machine for web-development you can automate installing ASP.NET 4, ASP.NET MVC 2, IIS, SQL Server Express and Visual Web Developer 2010 Express really quickly with the Microsoft Web Platform Installer (just click the install button on the page). What is new with VS 2010 and .NET 4 Today’s release is a big one – and brings with it a ton of new feature and capabilities. One of the things we tried hard to focus on with this release was to invest heavily in making existing applications, projects and developer experiences better.  What this means is that you don’t need to read 1000+ page books or spend time learning major new concepts in order to take advantage of the release.  There are literally thousands of improvements (both big and small) that make you more productive and successful without having to learn big new concepts in order to start using them.  Below is just a small sampling of some of the improvements with this release: Visual Studio 2010 IDE  Visual Studio 2010 now supports multiple-monitors (enabling much better use of screen real-estate).  It has new code Intellisense support that makes it easier to find and use classes and methods. It has improved code navigation support for searching code-bases and seeing how code is called and used.  It has new code visualization support that allows you to see the relationships across projects and classes within projects, as well as to automatically generate sequence diagrams to chart execution flow.  The editor now supports HTML and JavaScript snippet support as well as improved JavaScript intellisense. The VS 2010 Debugger and Profiling support is now much, much richer and enables new features like Intellitrace (aka Historical Debugging), debugging of Crash/Dump files, and better parallel debugging.  VS 2010’s multi-targeting support is now much richer, and enables you to use VS 2010 to target .NET 2, .NET 3, .NET 3.5 and .NET 4 applications.  And the infamous Add Reference dialog now loads much faster. TFS 2010 is now easy to setup (you can now install the server in under 10 minutes) and enables great source-control, bug/work-item tracking, and continuous integration support.  Testing (both automated and manual) is now much, much richer.  And VS 2010 Premium and Ultimate provide much richer architecture and design tooling support. VB and C# Language Features VB and C# in VS 2010 both contain a bunch of new features and capabilities.  VB adds new support for automatic properties, collection initializers, and implicit line continuation support among many other features.  C# adds support for optional parameters and named arguments, a new dynamic keyword, co-variance and contra-variance, and among many other features. ASP.NET 4 and ASP.NET MVC 2 With ASP.NET 4, Web Forms controls now render clean, semantically correct, and CSS friendly HTML markup. Built-in URL routing functionality allows you to expose clean, search engine friendly, URLs and increase the traffic to your Website.  ViewState within applications can now be more easily controlled and made smaller.  ASP.NET Dynamic Data support has been expanded.  More controls, including rich charting and data controls, are now built-into ASP.NET 4 and enable you to build applications even faster.  New starter project templates now make it easier to get going with new projects.  SEO enhancements make it easier to drive traffic to your public facing sites.  And web.config files are now clean and simple. ASP.NET MVC 2 is now built-into VS 2010 and ASP.NET 4, and provides a great way to build web sites and applications using a model-view-controller based pattern. ASP.NET MVC 2 adds features to easily enable client and server validation logic, provides new strongly-typed HTML and UI-scaffolding helper methods.  It also enables more modular/reusable applications.  The new <%: %> syntax in ASP.NET makes it easier to HTML encode output.  Visual Studio 2010 also now includes better tooling support for unit testing and TDD.  In particular, “Consume first intellisense” and “generate from usage" support within VS 2010 make it easier to write your unit tests first, and then drive your implementation from them. Deploying ASP.NET applications gets a lot easier with this release. You can now publish your Websites and applications to a staging or production server from within Visual Studio itself. Visual Studio 2010 makes it easy to transfer all your files, code, configuration, database schema and data in one complete package. VS 2010 also makes it easy to manage separate web.config configuration files settings depending upon whether you are in debug, release, staging or production modes. WPF 4 and Silverlight 4 WPF 4 includes a ton of new improvements and capabilities including more built-in controls, richer graphics features (cached composition, pixel shader 3 support, layoutrounding, and animation easing functions), a much improved text stack (with crisper text rendering, custom dictionary support, and selection and caret brush options).  WPF 4 also includes a bunch of support to enable you to take advantage of new Windows 7 features – including multi-touch and Windows 7 shell integration. Silverlight 4 will launch this week as well.  You can watch my Silverlight 4 launch keynote streamed live Tuesday (April 13th) at 8am Pacific Time.  Silverlight 4 includes a ton of new capabilities – including a bunch for making it possible to build great business applications and out of the browser applications.  I’ll be doing a separate blog post later this week (once it is live on the web) that talks more about its capabilities. Visual Studio 2010 now includes great tooling support for both WPF and Silverlight.  The new VS 2010 WPF and Silverlight designer makes it much easier to build client applications as well as build great line of business solutions, as well as integrate and bind with data.  Tooling support for Silverlight 4 with the final release of Visual Studio 2010 will be available when Silverlight 4 releases to the web this week. SharePoint and Azure Visual Studio 2010 now includes built-in support for building SharePoint applications.  You can now create, edit, build, and debug SharePoint applications directly within Visual Studio 2010.  You can also now use SharePoint with TFS 2010. Support for creating Azure-hosted applications is also now included with VS 2010 – allowing you to build ASP.NET and WCF based applications and host them within the cloud. Data Access Data access has a lot of improvements coming to it with .NET 4.  Entity Framework 4 includes a ton of new features and capabilities – including support for model first and POCO development, default support for lazy loading, built-in support for pluralization/singularization of table/property names within the VS 2010 designer, full support for all the LINQ operators, the ability to optionally expose foreign keys on model objects (useful for some stateless web scenarios), disconnected API support to better handle N-Tier and stateless web scenarios, and T4 template customization support within VS 2010 to allow you to customize and automate how code is generated for you by the data designer.  In addition to improvements with the Entity Framework, LINQ to SQL with .NET 4 also includes a bunch of nice improvements.  WCF and Workflow WCF includes a bunch of great new capabilities – including better REST, activation and configuration support.  WCF Data Services (formerly known as Astoria) and WCF RIA Services also now enable you to easily expose and work with data from remote clients. Windows Workflow is now much faster, includes flowchart services, and now makes it easier to make custom services than before.  More details can be found here. CLR and Core .NET Library Improvements .NET 4 includes the new CLR 4 engine – which includes a lot of nice performance and feature improvements.  CLR 4 engine now runs side-by-side in-process with older versions of the CLR – allowing you to use two different versions of .NET within the same process.  It also includes improved COM interop support.  The .NET 4 base class libraries (BCL) include a bunch of nice additions and refinements.  In particular, the .NET 4 BCL now includes new parallel programming support that makes it much easier to build applications that take advantage of multiple CPUs and cores on a computer.  This work dove-tails nicely with the new VS 2010 parallel debugger (making it much easier to debug parallel applications), as well as the new F# functional language support now included in the VS 2010 IDE.  .NET 4 also now also has the Dynamic Language Runtime (DLR) library built-in – which makes it easier to use dynamic language functionality with .NET.  MEF – a really cool library that enables rich extensibility – is also now built-into .NET 4 and included as part of the base class libraries.  .NET 4 Client Profile The download size of the .NET 4 redist is now much smaller than it was before (the x86 full .NET 4 package is about 36MB).  We also now have a .NET 4 Client Profile package which is a pure sub-set of the full .NET that can be used to streamline client application installs. C++ VS 2010 includes a bunch of great improvements for C++ development.  This includes better C++ Intellisense support, MSBuild support for projects, improved parallel debugging and profiler support, MFC improvements, and a number of language features and compiler optimizations. My VS 2010 and .NET 4 Blog Series I’ve been cranking away on a blog series the last few months that highlights many of the new VS 2010 and .NET 4 improvements.  The good news is that I have about 20 in-depth posts already written.  The bad news (for me) is that I have about 200 more to go until I’m done!  I’m going to try and keep adding a few more each week over the next few months to discuss the new improvements and how best to take advantage of them. Below is a list of the already written ones that you can check out today: Clean Web.Config Files Starter Project Templates Multi-targeting Multiple Monitor Support New Code Focused Web Profile Option HTML / ASP.NET / JavaScript Code Snippets Auto-Start ASP.NET Applications URL Routing with ASP.NET 4 Web Forms Searching and Navigating Code in VS 2010 VS 2010 Code Intellisense Improvements WPF 4 Add Reference Dialog Improvements SEO Improvements with ASP.NET 4 Output Cache Extensibility with ASP.NET 4 Built-in Charting Controls for ASP.NET and Windows Forms Cleaner HTML Markup with ASP.NET 4 - Client IDs Optional Parameters and Named Arguments in C# 4 - and a cool scenarios with ASP.NET MVC 2 Automatic Properties, Collection Initializers and Implicit Line Continuation Support with VB 2010 New <%: %> Syntax for HTML Encoding Output using ASP.NET 4 JavaScript Intellisense Improvements with VS 2010 Stay tuned to my blog as I post more.  Also check out this page which links to a bunch of great articles and videos done by others. VS 2010 Installation Notes If you have installed a previous version of VS 2010 on your machine (either the beta or the RC) you must first uninstall it before installing the final VS 2010 release.  I also recommend uninstalling .NET 4 betas (including both the client and full .NET 4 installs) as well as the other installs that come with VS 2010 (e.g. ASP.NET MVC 2 preview builds, etc).  The uninstalls of the betas/RCs will clean up all the old state on your machine – after which you can install the final VS 2010 version and should have everything just work (this is what I’ve done on all of my machines and I haven’t had any problems). The VS 2010 and .NET 4 installs add a bunch of new managed assemblies to your machine.  Some of these will be “NGEN’d” to native code during the actual install process (making them run fast).  To avoid adding too much time to VS setup, though, we don’t NGEN all assemblies immediately – and instead will NGEN the rest in the background when your machine is idle.  Until it finishes NGENing the assemblies they will be JIT’d to native code the first time they are used in a process – which for large assemblies can sometimes cause a slight performance hit. If you run into this you can manually force all assemblies to be NGEN’d to native code immediately (and not just wait till the machine is idle) by launching the Visual Studio command line prompt from the Windows Start Menu (Microsoft Visual Studio 2010->Visual Studio Tools->Visual Studio Command Prompt).  Within the command prompt type “Ngen executequeueditems” – this will cause everything to be NGEN’d immediately. How to Buy Visual Studio 2010 You can can download and use the free Visual Studio express editions of Visual Web Developer 2010, Visual Basic 2010, Visual C# 2010 and Visual C++.  These express editions are available completely for free (and never time out). You can buy a new copy of VS 2010 Professional that includes a 1 year subscription to MSDN Essentials for $799.  MSDN Essentials includes a developer license of Windows 7 Ultimate, Windows Server 2008 R2 Enterprise, SQL Server 2008 DataCenter R2, and 20 hours of Azure hosting time.  Subscribers also have access to MSDN’s Online Concierge, and Priority Support in MSDN Forums. Upgrade prices from previous releases of Visual Studio are also available.  Existing Visual Studio 2005/2008 Standard customers can upgrade to Visual Studio 2010 Professional for a special $299 retail price until October.  You can take advantage of this VS Standard->Professional upgrade promotion here. Web developers who build applications for others, and who are either independent developers or who work for companies with less than 10 employees, can also optionally take advantage of the Microsoft WebSiteSpark program.  This program gives you three copies of Visual Studio 2010 Professional, 1 copy of Expression Studio, and 4 CPU licenses of both Windows 2008 R2 Web Server and SQL 2008 Web Edition that you can use to both develop and deploy applications with at no cost for 3 years.  At the end of the 3 years there is no obligation to buy anything.  You can sign-up for WebSiteSpark today in under 5 minutes – and immediately have access to the products to download. Summary Today’s release is a big one – and has a bunch of improvements for pretty much every developer.  Thank you everyone who provided feedback, suggestions and reported bugs throughout the development process – we couldn’t have delivered it without you.  Hope this helps, Scott P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

    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 | 146 147 148 149 150 151 152 153 154 155 156 157  | Next Page >