How to set JMS user property in JMS Adapter.

I am using Jdeveloper and SOA 11g. I want to filter some JMS messages from a topic based on a JMS user property. It is consumed using (JMS Adapter) consumer --> Mediator---> DBAdapter.
My Question is how to define a JMS user property using Jdeveloper 11g.
Thanks
Edited by: user5108636 on 24/06/2010 16:10

In Mediator mplan Assign Values use a property expression in the "to" side like:
jca.jms.JMSProperty.XXX
where XXX is the name of the property you would like to have created and populated. In source it will look like:
<Mediator name="A03QueueWFeedMediator" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/sca/1.0/mediator"
wsdlTargetNamespace="http://www.oracle.com/integration/b2b/A03QueueWFeedFromB2B/">
<operation name="receive" deliveryPolicy="AllOrNothing" priority="4"
validateSchema="false">
<switch>
<case executionType="direct" name="A03QueueWFeedToJMS.Produce_Message">
<action>
<transform>
<part name="$out.body"
function="xslt(xsl/ADT_AXX_To_ADT_AXX.xsl, $in.body)"/>
</transform>
<assign>
<copy target="$out.body/imp1:ADT_AXX/imp1:MSH/@Type"
value="$in.property.b2b.documentDefinitionName"
xmlns:imp1="NS_64FCBED013AA409D933F624674E67BF220070423183755"/>
<copy target="$out.body/imp1:ADT_AXX/imp1:MSH/@ID"
value="$in.property.b2b.fromTradingPartnerId"
xmlns:imp1="NS_64FCBED013AA409D933F624674E67BF220070423183755"/>
<copy target="$out.body/imp1:ADT_AXX/imp1:MSH/@Name"
value="$in.property.b2b.toTradingPartnerId"
xmlns:imp1="NS_64FCBED013AA409D933F624674E67BF220070423183755"/>
<copy target="$out.property.b2b.conversationId"
value="$in.property.b2b.conversationId"/>
<copy target="$out.property.b2b.documentDefinitionName"
value="$in.property.b2b.documentDefinitionName"/>
<copy target="$out.property.b2b.documentProtocolName"
value="$in.property.b2b.documentProtocolName"/>
<copy target="$out.property.b2b.documentProtocolVersion"
value="$in.property.b2b.documentProtocolVersion"/>
<copy target="$out.property.b2b.documentTypeName"
value="$in.property.b2b.documentTypeName"/>
<copy target="$out.property.b2b.fromTradingPartnerId"
value="$in.property.b2b.fromTradingPartnerId"/>
<copy target="$out.property.b2b.fromTradingPartnerIdType"
value="$in.property.b2b.fromTradingPartnerIdType"/>
<copy target="$out.property.b2b.toTradingPartnerId"
value="$in.property.b2b.toTradingPartnerId"/>
<copy target="$out.property.b2b.toTradingPartnerIdType"
value="$in.property.b2b.toTradingPartnerIdType"/>
*<copy target="$out.property.jca.jms.JMSProperty.conversationId"*
value="$in.property.b2b.conversationId"/> <copy target="$out.property.jca.jms.JMSProperty.documentDefinitionName"
value="$in.property.b2b.documentDefinitionName"/>
<copy target="$out.property.jca.jms.JMSProperty.documentProtocolName"
value="$in.property.b2b.documentProtocolName"/>
<copy target="$out.property.jca.jms.JMSProperty.documentProtocolVersion"
value="$in.property.b2b.documentProtocolVersion"/>
<copy target="$out.property.jca.jms.JMSProperty.documentTypeName"
value="$in.property.b2b.documentTypeName"/>
<copy target="$out.property.jca.jms.JMSProperty.fromTradingPartnerId"
value="$in.property.b2b.fromTradingPartnerId"/>
<copy target="$out.property.jca.jms.JMSProperty.fromTradingPartnerIdType"
value="$in.property.b2b.fromTradingPartnerIdType"/>
<copy target="$out.property.jca.jms.JMSProperty.toTradingPartnerId"
value="$in.property.b2b.toTradingPartnerId"/>
<copy target="$out.property.jca.jms.JMSProperty.toTradingPartnerIdType"
value="$in.property.b2b.toTradingPartnerIdType"/>
</assign>
<invoke reference="A03QueueWFeedToJMS" operation="Produce_Message"/>
</action>
</case>
</switch>
</operation>
</Mediator>
The runtime will see something like:
[2010-09-09T11:48:06.353+10:00] [AdminServer] [TRACE] [] [oracle.soa.adapter] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@60ddbc76] [userId: weblogic] [ecid: 0000Ifo9olH2zGWjLxmJOA1CY0sg0001jY,0] [SRC_CLASS: oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl] [APP: soa-infra] [dcid: 02d1ff4621073810:26418f01:12af379c141:-7fd3-0000000000000219] [SRC_METHOD: log] Jms Adapter A03QueueWFeed:A03QueueWFeedToJMS [ Produce_Message_ptt::Produce_Message(body) ] XMLHelper_convertJmsMessageHeadersAndPropertiesToXML: <JMSInboundHeadersAndProperties xmlns="http://xmlns.oracle.com/pcbpel/adapter/jms/">[[
<JMSInboundHeaders>
<JMSCorrelationID></JMSCorrelationID>
<JMSDeliveryMode>2</JMSDeliveryMode>
<JMSExpiration>0</JMSExpiration>
<JMSMessageID>ID:&lt;911867.1283996886119.0></JMSMessageID>
<JMSPriority>4</JMSPriority>
<JMSRedelivered>false</JMSRedelivered>
<JMSType></JMSType>
<JMSTimestamp>1283996886119</JMSTimestamp>
</JMSInboundHeaders>
<JMSInboundProperties>
<Property name="documentProtocolVersion" value="2.3"/>
<Property name="toTradingPartnerIdType" value="Name"/>
*<Property name="conversationId" value="C0A83C0712AF42D840E0000074BA3CCC"/>* <Property name="documentTypeName" value="ADT"/>
<Property name="tracking_conversationId" value="C0A83C0712AF42D866F0000074BA3CD9"/>
<Property name="tracking_ecid" value="C0A83C0712AF42D866F0000074BA3CDA"/>
<Property name="tracking_compositeInstanceId" value="60019"/>
<Property name="documentProtocolName" value="HL7"/>
<Property name="documentDefinitionName" value="QH_ADT_Generic"/>
<Property name="tracking_parentComponentInstanceId" value="mediator:45E076D0BBB411DFAF05817F5F0DD1A1"/>
<Property name="fromTradingPartnerIdType" value="Name"/>
<Property name="fromTradingPartnerId" value="HOMER"/>
<Property name="toTradingPartnerId" value="Self"/>
<Property name="JMSXDeliveryCount" type="integer" value="1"/>
</JMSInboundProperties>
</JMSInboundHeadersAndProperties>
Edited by: Michael.Czapski on 8/09/2010 18:58

Similar Messages

  • How to set UOO(bea_unitoforder) property within BPEL Adapter property

    Hi,
    In oracle documentation JMS message payload field values can be used as correlation properties.
    Correlation property aliases are used to define from which payload field the correlation property value is taken.
    I need to set the correlation property value from a JMS message header field instead of payload fields. (=JMS JCA Adapter properties).I have a UOO value set same for all messages.Now I need to set this WL property to JMS JCA Adapter property and then create one single instance for all messages in queue.
    Routing a New message to a (New or) Existing Instance:
    http://docs.oracle.com/cd/E28389_01/dev.1111/e10224/bp_correlate.htm#CHDDJEAI
    How is it possible in BPEL???
    Thanks
    Souvik

    Hi,
    In oracle documentation JMS message payload field values can be used as correlation properties.
    Correlation property aliases are used to define from which payload field the correlation property value is taken.
    I need to set the correlation property value from a JMS message header field instead of payload fields. (=JMS JCA Adapter properties).I have a UOO value set same for all messages.Now I need to set this WL property to JMS JCA Adapter property and then create one single instance for all messages in queue.
    Routing a New message to a (New or) Existing Instance:
    http://docs.oracle.com/cd/E28389_01/dev.1111/e10224/bp_correlate.htm#CHDDJEAI
    How is it possible in BPEL???
    Thanks
    Souvik

  • How to set ApplIndentityData header field in JMS adapter

    Hi Guys ,
        I have one requirement for update the field in SAP JMS header. I am using transport protocol for IBM Websphere MQ in JMS adapter.
    While sending data to IBM Websphere MQ Queue via JMS Adapter, need to set the field called ApplIndentityData with the appropriate value which is populate to a MQHRF2 header of a message.
    So, regarding that where will do it? Means JMS receiver adapter or IBM MQ level. If JMS receiver adapter, I think using ASMA, So please guide me how to set this filed value in JMS adapter or share any document you have.
    Thanks & regards
    Vijaykumar S

    Hi RejaSekar,
           I reffered your blog and did the below settings in JMS module and ASMA settings. 
    1) Changed the mode for u201CJMS-Complaintu201D instead of u201CWebsphere MQ(non JMS)u201D
    2) Additional JMS message properties tab created below property name and java type.
           LocalName    --> String
           Partname      -->  String
    3) In module parameter tab added the below module name and key
        AF_Modules/DynamicConfigurationBean   -->  LocalEnterpriseBean  -->  RFH2HEADER
    4) Under parameter Tab
         RFH2HEADER       -->   key.0      -->     insert http://sap.com/XI/System/JMS  DCJMSMessageProperty0
         RFH2HEADER       -->   key.1      -->     insert http://sap.com/XI/System/JMS  DCJMSMessageProperty0
         RFH2HEADER      -->  value.0    -->    LocalName
         RFH2HEADER      -->  value.1    -->    PartnerName
    Kindly check the above settings whether this is correct or wrong. If anything wrong please let me know what we need to change JMS receiver adapter.
    Actually my requirement is need to set these parameters and set the value to that parameters and pass in to /usr folder of a WebsphereMQ message.
    Kindly check and help me out.
    Thanks & regards
    Vijayakumar S

  • How to set the item property to restrict the user to not to copy from above

    Hi Guru's,
    I have a requirement like, There were two items on the form name email Id, Confirm email Id.
    I have to ristrict the user to not to copy from email Id item.. make him/her to enter the value into confirm email id item field manually.
    How to set the item property to restrict the user to not to copy from above item and paste it in this item.
    Please help.
    Thanks!!

    Just an opinion here, but that is about the dumbest requirement I have ever seen.
    I am always annoyed by web sites that ask me to enter my email twice. I ALWAYS copy the email address from the original entry and paste it into the second one.
    People enter their email addresses so often, it takes a real klutz to not get it right. And what makes you think that if they enter it twice, that they won't enter it wrong both times anyway???

  • How to set default User preferences in Analyzer for all users

    How to set default User preferences in Analyzer for all users<BR><BR>Hi,<BR><BR>I would like to set some settings in Analyzer as default for all users. For example:<BR>1. Display | Char<BR>2. right mouse click on char | Chart Properties<BR>3. Axes tab<BR>4. "Format: Currency" i would like to change to "Format: Number".<BR><BR>How to set default values to all users? Is this possible?<BR><BR>Thanks,<BR>Grofaty

    I'm pretty sure higher access superceedes, so you could set up a group with no actual access, just to get the preferences working, then their individual security will dictate what they can do. I haven't tested this fully, but I beleive this is how it will work.<BR>As far as setting the preferences, go into the admin console and right click on the group, then select Preferences. To apply the group preferences to a user, add the user to the group, then right click on the user, select preferences and from the upper left corner, use the drop down to select the active preference, in this case, it will be the group you created and added them to.<BR><BR>HTH

  • How to set Multi User Environment in the weblogic 5.1 and 6.1 server..(Urgently)

    Hi all,
    I need to know how to set Multi User Environment in the weblogic 5.1
    properties file..
    Here my question is..:)
    1) I have a database with multiple users and having different privileges
    for the users.. and i need to use all the privileges when user aceess
    the database through weblogic server connectionPool.
    2)According to the user privileges i need access the database tables
    content and gives the frontEnd(jsp).
    3)How to modify dynamically weblogic.properties file in the weblogic
    5.1.
    If anybody having idea reg. this issues pl...help me..
    Thanks in advance
    Chandu([email protected],[email protected])

    Hi. A JDBC connection pool is a set of identical, interchangeable, pre-made
    connections, and the controls to make sure only one user uses a particular
    connection at any one time. If you want to have different DBMS users, you can
    have a separate pool for each DBMS user, which may contain as many or few
    connections as you want. Some applications has a pool for the accounting
    applications, and another for the sales applications etc. Some do have a
    separate pool for john, jane, joe etc, each with one connection. Pools
    can be created and destroyed dynamically using the dynamic pool API.
    Joe
    softstar wrote:
    >
    Hi all,
    I need to know how to set Multi User Environment in the weblogic 5.1
    properties file..
    Here my question is..:)
    1) I have a database with multiple users and having different privileges
    for the users.. and i need to use all the privileges when user aceess
    the database through weblogic server connectionPool.
    2)According to the user privileges i need access the database tables
    content and gives the frontEnd(jsp).
    3)How to modify dynamically weblogic.properties file in the weblogic
    5.1.
    If anybody having idea reg. this issues pl...help me..
    Thanks in advance
    Chandu([email protected],[email protected])

  • How to Set Polling Options of a DB adapter From EnterpriseManager/AdminCons

    HI All,
    We all know after Dragging a DB adapeter we can manually set the polling Options in J developer
    However,
    My query is how to Set Polling Options of a DB adapter From EnterpriseManager/AdminCons so that we dun hav to change our code and redeploy if any change is asked for.
    My DB adapter is deployed to EM.(SOA Server).
    Polling Options are like:
    From the Polling Frequency list, select how frequently to poll for new records or events.
    In the Database Rows per XML Document field, specify the number of rows per XML document when sending events to Oracle BPEL PM or Mediator. This is the batch setting between the database adapter and its consumer: Oracle BPEL PM or Mediator.
    In the Database Rows per Transaction field, select Unlimited or enter a value to indicate the number of table rows to process during a single transaction.
    When polling the database for events, you can order the returned rows by the selected column by using the Order By list. The best practice is to choose <No Ordering>, as message ordering regardless is not guaranteed without extra configuration.

    Hi,
    Inside your composite (in the EM), you can see there is a category table call 'Services and References'.
    Under it, find the name of your JCA Adapter, where you've define the polling from the DB. Click on it and go to the property tab.
    There you can find all the parameters you've set and more.
    After you finish update it, click on Apply (this will automatically poll the data).
    Arik

  • [LENOVO Y50-70] How To Set NVIDIA Card as Default Graphic Adapter

    I have just bought Lenovo Y50-70. But i wonder how to set NVIDIA Card as default Graphic Adapter instead using Intel Card. Thanks

    hi monx,
    Welcome to the Forums.
    The Y50-70 uses Nvidia Optimus Technology to automatically switch between the Intel GPU (for power saving) and Nvida GPU (for maximum performance).
    To manually set the default graphics adapter, you will need to set this inside the Nvidia Control Panel > Manage 3D Settings.
       - Sample image
    More info:
    http://support.lenovo.com/us/en/documents/ht071337
    Regards

  • Hi how to set the visible property in oracle adf?

    Hi,
    I am new to oracle adf in my application one of the field is id and it is sequence generated value Whenever I entered remaining values and click on save then only it has to display with sequence generated value before saving it has to be in hide mode. Can any one help me how the approach is.

    As there are three ways through which you may pass a message to B2B, so there are three ways to set Action name property.
    If you are using SCA/Fabric then set below properties -
    b2b.fileName
    b2b.contentType
    If you are using JCA JMS adapter, then set below property -
    jca.jms.JMSProperty.ACTION_NAME
    If you are using JCA AQ adapter then set -
    ACTION_NAME
    Regards,
    Anuj

  • JMS Message Property in JMS Receiver

    Hi there,
    I need to set a JMS String property of a message I send. This message is fixed for one channel.
    We use XI 3.0 SP 20. I went through the documentation and saw that I can give up-tp 10 properties.
    But only the name and the type.
    But where can I get a value from.
    Documentation sys that the technical name was DCJMSMessageProperty0, ...1 a.s.o.
    Is that sth. for the adapter module? Is this a field that needs to have this name in the message? I do not get it.
    Could you please lighten a bit the usage of this (strange) mechanism?
    Thanks in advance,
    Helge

    Hi there,
    there is a way (and a section somewhere in the help) to set adapter specific attributes in java mappings.
    The java doc for that can be found here:
    https://help.sap.com/javadocs/NW04/current/pi/index.html
    Hope that helps sbd who also has that prob.
    Cheers,
    Helge

  • How to set End User Permission to an iView?

    Hi experts,
    can someone tell me how I can set End User Permission to enabled to an iView?

    Hi there,
    From what I have read you want a user to access an iView without an account. To do this you need to configure the J2EE engine for an anonymous user access and set the iView property for authentication to anonymous.
    Because the user has no account you have to assign any roles you want to use for permissions to the anonymous user account configured for anonymous access.
    There is documentation on help.sap.com on how to configure anonymous access.
    Hope this helps.
    Regards
    Christiaan

  • How to set the actionname property in B2B 11g

    I have an outbound file sent via AS2 over http. I gather from other b2b forums/documents that for preserving the file name I have to set the actionname property. I have a BPEL process which is setting the fromTP, toTP, document TYPE etc, and then invoking the B2B and sending the document. Can I set the actionname property in the BPEL?
    When I am trying to assign a value like "contentType:application/octet-stream;filename:abc.xml", I don't see any actionname property in the "To" side.

    As there are three ways through which you may pass a message to B2B, so there are three ways to set Action name property.
    If you are using SCA/Fabric then set below properties -
    b2b.fileName
    b2b.contentType
    If you are using JCA JMS adapter, then set below property -
    jca.jms.JMSProperty.ACTION_NAME
    If you are using JCA AQ adapter then set -
    ACTION_NAME
    Regards,
    Anuj

  • How to set up user account and share folders

    We are a family of four sharing our first iMac. I would like to set up one account for my wife and I and one account for my kids on which I plan to enable Parental Controls.
    I have struggled with setting up my kids user account. After setting up a Standard account for the kids - I noticed none of our music or files were visible in the kids accounts. I spent 20 min on the phone with Apple and the tech was clueless. He had me copying my music folder all over the computer until I had about 6 copies of the same folder. I did figure out how to move the music library to SHARED folder and redirect iTunes source folder to the same shared folder.
    My problem now - when I copy my documents to the SHARED folder my kids can see the files and open them, but they can not save them. How do I give the kids account read write privileges?
    Should I set up a GROUP account instead?
    I need the best way to have two or three users who can access all data on the same iMac, while giving me the ability to enable Parental Controls on the accounts.

    Do this:
    Here's how to set it up by using ACLs:
    1. Create a new folder in /Users/Shared. Call it "Sharefolder".
    2. Log in to an Admin account, open Terminal and paste in all of this at the same time:
    chmod -R +a "everyone allow delete,chown,list,search,add_file,\
    addsubdirectory,delete_child,file_inherit,directoryinherit" \
    /Users/Shared/Sharefolder
    That will automatically make everything copied or created to the sharefolder writable by all users. Note: After setting this up, if you have existing files that you want to move to the sharefolder, hold down the option key when dragging them in. That will make new copies of them in the sharefolder. Dragging existing files in (i.e. simply moving them there) won't cause the ACL to inherit properly and they won't be writable by all users. Files that are copied or +newly created+ in the sharefolder shouldn't have this problem.
    Make sure you keep good backups. One user accidentally deleting a shared file will affect everybody else who uses it.

  • How to set Current User in moss 2007 for Authentication....

    Hi Team,
    We have current running website where we have user id to login but now requirement is that user will login with his Email address. Email is stored in active directory, I'm able to login with fba authentication.  
    I'm able to retrieve the user id of current user using Email but
    I am NOT able to set that user id for current user for further authentication using Moss 2007.
    Please find the source code for login and authentication page:
    //---------------------------Login Page--------------------//
        public partial class Login : System.Web.UI.UserControl
            #region Decleration
            string LoginStatus = null;
            string UserCurrent = null;
           static SPUser siteuser;
           // private static string _randomNumbercheck;
            //private static bool IsLoggedin;      
            Random random;
            #endregion       
            #region Page Load
            protected void Page_Load(object sender, EventArgs e)
                this.hplchangepw.Visible = false;
                this.hplmytask.Visible = false;
                string desturl = SPContext.Current.Site.Url;
                if (!IsPostBack)
                    try
                        string str;
     SPWeb web = SPContext.Current.Web;
                             SPUser siteuser = web. .CurrentUser; 
                        //SPUser siteuser = spWeb.EnsureUser(username);
                        str = (siteuser == null ? "" : siteuser.ToString());
                        this.Login.TitleText = "";
                        this.Login.DestinationPageUrl = desturl;
                        //if (HttpContext.Current.Request.UrlReferrer != null)
                        //    if (this.Page.User.Identity.IsAuthenticated && ((Session["test1"].ToString() == _randomNumbercheck) || LoginControl.Class1.IsLoggedIn))
                         if (this.Page.User.Identity.IsAuthenticated)
                               // _randomNumbercheck = "";
                                this.hplregister.Visible = false;
                                this.hplforgetpassw.Visible = false;
                                this.hplchangepw.Visible = true;
                                this.hplmytask.Visible = true;
                                this.Login.Visible = false;
      if (str.StartsWith("fba_"))
                                    string name = str.Split(':').GetValue(1).ToString();
                                    LoginnameLbl.Text = "<b>" + name.ToString() + "</b>,<br><br>Haryana Urban Development Authority Welcomes
    You. <br><br><br><b><i>\"In The Service Of Masses\"</i></b>";
                                else
                                    string name = str.Split('\\').GetValue(1).ToString();
                                    LoginnameLbl.Text = "<b>" + name.ToString() + "</b>,<br><br>Haryana Urban Development Authority Welcomes
    You. <br><br><br><b><i>\"In The Service Of Masses\"</i></b>";
                            else
                                this.hplchangepw.Visible = false;
                                this.hplmytask.Visible = false;
                                this.Login.Visible = true;
                                LoginnameLbl.Text = "";
                                HttpContext.Current.Session.Clear();
                                HttpContext.Current.Session.Abandon();
                    catch (Exception ex)
                        //HttpContext.Current.Session.Clear();
                        //HttpContext.Current.Session.Abandon();
            #endregion
            #region Get Audit Informations
            public void GetUserInfo()
                try
                    string user = Login.UserName;
                    SPSecurity.RunWithElevatedPrivileges(new SPSecurity.CodeToRunElevated(delegate()
                        using (SPSite oSite = new SPSite(SPContext.Current.Site.ID))
                            using (SPWeb web1 = oSite.OpenWeb(SPContext.Current.Web.ID))
                                SPListItem item = null;
                                SPListItemCollection listItems = null;
                                web1.AllowUnsafeUpdates = true;
                                siteuser = web1.EnsureUser(Session["User"].ToString());// spWeb.EnsureUser(login);
                                listItems = web1.Lists["Audit_Trail"].Items;
                                item = listItems.Add();
                                item["User_ID"] = UserCurrent.ToString(); //Request.ServerVariables["AUTH_USER"];
                                string ip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                                if ((ip == null) || (ip == "") || (ip.ToLower() == "unknown"))
                                    ip = Request.ServerVariables["REMOTE_ADDR"];
                                item["IP_Address"] = ip;
                                item["Login_Date"] = System.DateTime.Now;
                                item["Login_Status"] = LoginStatus.ToString();
                                item.Update();
                                web1.AllowUnsafeUpdates = false;
                                web1.Dispose();
                                oSite.Dispose();
                catch (Exception ex)
            #endregion
            #region MD5Encryption
            private string MD5Encryption(string strToEncrypt)
                System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding();
                byte[] bytes = ue.GetBytes(strToEncrypt);
                // encrypt bytes
                System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
                byte[] hashBytes = md5.ComputeHash(bytes);
                // Convert the encrypted bytes back to a string (base 16)
                string hashString = "";
                for (int i = 0; i < hashBytes.Length; i++)
                    hashString += Convert.ToString(hashBytes[i], 16).PadLeft(2, '0');
                return hashString.PadLeft(32, '0');
            #endregion
            #region Generate Random Code
            private string GenerateRandomCode()
                random = new Random();
                string s = "";
                for (int i = 0; i <= 6; i++)
                    s = string.Concat(s, this.random.Next(10).ToString());
               // _randomNumbercheck = s;
                return s;
            #endregion
            #region Generate Random String
            public string GenerateHashKey()
                StringBuilder myStr = new StringBuilder();
                myStr.Append(Request.Browser.Browser);
                myStr.Append(Request.Browser.Platform);
                myStr.Append(Request.Browser.MajorVersion);
                myStr.Append(Request.Browser.MinorVersion);
                myStr.Append(Request.LogonUserIdentity.User.Value);
                SHA1 sha = new SHA1CryptoServiceProvider();
                byte[] hashdata = sha.ComputeHash(Encoding.UTF8.GetBytes(myStr.ToString()));
                return Convert.ToBase64String(hashdata);
            #endregion
            #region Check User Authentication
            protected void Login_Authenticate(object sender, AuthenticateEventArgs e)
                Utility hu=new Utility();
                int CheckValue = 0;
                string user = Login.UserName;
                if(user.Contains("@"))
                    CheckValue=1;
                //Encrypted Password
                string HPassword = hash.Value;
                // Verify that the username/password pair is valid
                SqlConnection con = new SqlConnection();
                SqlCommand cmd = new SqlCommand();
                con.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["FBAPortalConnection"];
                if (con.State == ConnectionState.Closed)
                    con.Open();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "sp_Portal_ValidatePortalUser";
                cmd.Connection = con;
                cmd.Parameters.Add("@ID", SqlDbType.NVarChar, 256).Value = Login.UserName;
                cmd.Parameters.Add("@Password", SqlDbType.NVarChar, 300).Value = HPassword.ToString();
                cmd.Parameters.Add("@CheckVal", SqlDbType.Int).Value = CheckValue;
                cmd.Parameters.Add(new SqlParameter("@P_Return", SqlDbType.NVarChar, 256));
                cmd.Parameters["@P_Return"].Direction = ParameterDirection.Output;
                cmd.ExecuteNonQuery();
                string CurrentUserName = cmd.Parameters["@P_Return"].Value.ToString();
                cmd.Dispose();
                con.Close();
                //int x = hu.ValidatePortalUser(Login.UserName, HPassword.ToString(), CheckValue);
                if (CurrentUserName != "0")
                    Page.Session["User"] = CurrentUserName;
                    string UserName = Session["User"].ToString();
                    UserCurrent = UserName;
                    LoginStatus = "Successfull";
                    GetUserInfo();
                    e.Authenticated = true;
                    //Session["CustomAuthKey"] = MD5Encryption(Request.ServerVariables["Remote_Addr"] + Request.ServerVariables["Http_Cookie"] + Request.ServerVariables["Auth_User"]);
                    Session["CustomAuthKey"] = MD5Encryption(Request.ServerVariables["Remote_Addr"] + Request.ServerVariables["Http_Cookie"] + UserCurrent.ToString());
                    FormsAuthenticationTicket tkt;
                    String cookiestr;
                    HttpCookie ck;
                    tkt = new FormsAuthenticationTicket(1, UserName, DateTime.Now, DateTime.Now.AddMinutes(15), false, GenerateHashKey());
                    cookiestr = FormsAuthentication.Encrypt(tkt);
                    ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
                    ck.Path = FormsAuthentication.FormsCookiePath;
                    Response.Cookies.Add(ck);
                else
                    // Username/password are not valid...
                    Login.FailureText = "Invalid Username / password";
                    e.Authenticated = false;
            #endregion
            #region Login Error
            protected void Login_LoginError(object sender, EventArgs e)
                // Determine why the user could not login
                Login.FailureText = "Your login attempt was not successful. Please try again.";
                // Does there exist a User account for this user
                MembershipUser usrInfo = Membership.GetUser(Login.UserName);
                if (usrInfo != null)
                    // Is this user locked out?
                    if (usrInfo.IsLockedOut)
                        Login.FailureText = "Your account has been locked out because of too many invalid login attempts. Please contact the administrator to have your account unlocked.";
                    else if (!usrInfo.IsApproved)
                        Login.FailureText = "Your account has not yet been approved. You cannot login until an administrator has approved your account.";
                    else
                        Login.FailureText = "Invalid UserName / Password";
                        UserCurrent = usrInfo.UserName;
                        LoginStatus = "UnSucessfull";
                        GetUserInfo();
                else
                    Login.FailureText = "Invalid UserName / Password";
            #endregion
            #region Logged In
            protected void Login_LoggedIn(object sender, EventArgs e)
                string UserName = Session["User"].ToString();           
                LoginControl.Class1.IsLoggedIn = true;
                //If User Email is [email protected] it will be invalid. Prompt the user to update the email id. 
                LoginControl.Utility hu = new LoginControl.Utility();
                DataSet dsuser = hu.getUserDetails(UserName);
                string email;
                if (dsuser.Tables[0].Rows.Count > 0)
                    email = dsuser.Tables[0].Rows[0]["Email"].ToString();
                    if (email.Equals("[email protected]"))
                        Response.Redirect("/Pages/UserUpdates.aspx", true);
                    else
            #endregion
    //-------------------------------- Authentication code----------------------------//
      private void authenticateuser()
                try
                    if (SPContext.Current.Web.CurrentUser != null)
                        using (SPSite spSite = new SPSite(SPContext.Current.Site.Url))
                            using (SPWeb spWep = spSite.OpenWeb())
                                Utility hu = new Utility();
    _userid = spWep.CurrentUser.Name;
                                DataSet ds = new DataSet();
                                ds = hu.GetPlotid(_userid);
                                if (ds.Tables[0].Rows.Count > 0)
                                    _plotid = ds.Tables[0].Rows[0]["plotid"].ToString();
                                else
                                    if (!SPContext.Current.Web.UserIsSiteAdmin && !SPContext.Current.Web.UserIsWebAdmin)
                                        if (!SPContext.Current.Web.IsCurrentUserMemberOfGroup(SPContext.Current.Web.Groups["Allottee"].ID))
                                            SPUtility.HandleAccessDenied(new Exception("You do not have access to this page"));
                    else
                    { SPUtility.HandleAccessDenied(new Exception("Please login")); }
                catch (Exception ex)
                    //  lblMessage.Text = "Error:" + ex.Message;
                    ShowMessage("Following error has occured while executing the desried event :- " + ex.Message);
    Mohan Prakash

    1. Current work flow :-In web site the user have to register themselves in the web site and enters his details along with user id, password and email id. Once user
    is registered then he will login with his user id and password. The user id is picked from login control and that set in “SPWeb.CurrentUser” as user id and system uses "Membership.ValidateUser" method to Authenticate user for login. 
    2. New Requirement: we would like to facilitate the user to login with Email id as well as user id. 
    Problem: 
    We replaced "Membership.ValidateUser" method to our own method to Authenticate user with email id/user id and password. 
    When user is login with user id and password it is working successfully but in the case of email id and password –“the email id is picked from user control and set as
    "HttpContext.Current.User.Identity.Name" but we are not getting “SPWeb.CurrentUser” and it shows null value.” 
    We are able to get user id from database using email id of user. Please help us how we can set user id in "SPContext.Current.Web.CurrentUser".
    Mohan Prakash

  • How to set the user who can access to repository

    Hi,
    I know we can create user and group in the tools->security.And if this users is belong to Administrators Group, it can access to RPD and do some modify..
    Can we create group or user who can access RPD in some situation(like mentioned in HELP, A can access to repository on Mondays and Wednesdays, B can access to repository on Saturdays and Sundays) and how to set the privilege..
    Thanks
    anne

    Hi Anne,
    The example specified in Help is about restricting query execution on weekdays/weekends for a particular webgroup. Inorder to configure such access ,
    Double click on the web group name -> Query Limits tab ->Click on Restrict button provided against the physical connection pool ->Select Allow/Disallow by selecting a particular time period.
    Rgds,
    Dpka

Maybe you are looking for

  • Issue with Getting the file path from InputFile component

    Hi, One of our requirement is like below: I am working on ADF 11g (latest release R1) page. User will select the file and when he/she clicks on the Save button we need to store the file path in the database. In the database file_path is varchar2(300)

  • 'User is Locked' error while trying to start initial load

    While trying to start initial load of objects using R3AS, I am receiving error msg 'User is locked'. This rfc user is a dialog user with SAP_ALL. I even tried replicating using a new user, but ended up with same error. The user is not locked but stil

  • Loop in the received mails

    Hello, When I received a message from the external, I have a "loop" in my mail flow. I have not a problem with the receiving but it is strange. My headers are the follow : Received: from exchsrv.domain.com (192.168.1.x) by exchsrv.domain.com  (192.16

  • Applying TAX arte aganist total Invoice amount

    Hello ALL, We are trying to implement Oracle AR module for Taiwan. The lowest dollar amount use can poay in Taiwan is 1 taiwan dollar, there is no cents. But I oracle applications Ar is set up with 2 decimals and AR apply tax aganist each line, not a

  • First PKGBUILD: blobby2-svn

    Hi, this is my first PKGBUILD for the svn-version of Blobby Volley 2. Please test it before I'll put it into AUR: pkgname=blobby2-svn pkgver=375 pkgrel=1 pkgdesc="Blobby Volley 2 - SVN version" url="http://blobby.redio.de/content/de/index.php" licens