الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How To Insert Operation System Username In Database(Adf)

Featured Replies

بتاريخ:

السلام عليكم
عندى View object اسمها ChangeRequestVO
و فيها مجموعة attributes منها واحد اسمها submittedBy

السؤال
عاوز اضيف defualt value فى ال attribute دة و تكون Operation system user name

انا اعرف انى ممكن اجيب ال OS username عن طريق

System.getProperty("os,.user");



فعملت class فى ال model project و اسمها Util و فيها method اسمها getOsUser()

المطلوب الوقتى انى عاوز اخد القيمة اللى هتيجى من الميثود و اسجلها فى ال attribute اللى موجود فى ال Vo اللى قولتلكم عليه
يا اما اسجلها ك expression value on the attribute
او اضيفها قبل ما يحصل insert فى ال VO

يا ريت حد يساعدنى محتاج الموضوع دة ضروري

بتاريخ:

Hello Tarek,


about os user i think you may look for DLL file to use it's native method or javascript method that bring os username

http://stackoverflow.com/questions/2968690/get-windows-username-with-javascript

Regards
Karim Hasan

تم تعديل بواسطة karim_hasan

بتاريخ:
  • كاتب الموضوع

انا اعرف ان فى كلاس اسمها HttpServletReques
ممكن تجيبلى بيانات عن ال Client بس عاوز مثال ازاى استخدمها فى ال ADF

بتاريخ:

go to

ChangeRequestVO-->java-->and create viewRow Class

and

Override Create Method

EX:


@Override
protected void create(AttributeList attributeList)
{
super.create(attributeList);
setSubmittedBy(Util.getOsUser());
}

بتاريخ:

ويمكنك ايضا استخدام نفس الميثود فى ال entityImpl بنقس الطريقة ....كما يمكنك ايضا استخدام backing bean كالأتى:

   DCBindingContainer bindingsImpl = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
   //CreateInsert Here In your PageDefinition for your ViewObject
   OperationBinding operationBinding = bindingsImpl.getOperationBinding("CreateInsert");
   operationBinding.execute();
   DCIteratorBinding dciter = null;
   //access the iterator by its ID value in the PageDef file.
   dciter  = bindingsImpl.findIteratorBinding("ChangeRequestVO1Iterator");
   Row currentRow = dciter.getCurrentRow();
   currentRow.setAttribute("SubmittedBy", Util.getOsUser());

بتاريخ:
  • كاتب الموضوع

go to

ChangeRequestVO-->java-->and create viewRow Class

and

Override Create Method

EX:

 @Override protected void create(AttributeList attributeList) { super.create(attributeList); setSubmittedBy(Util.getOsUser()); } 



مفيش ميثود اسمها
protected void create
بتاريخ:
  • كاتب الموضوع
ويمكنك ايضا استخدام نفس الميثود فى ال entityImpl بنقس الطريقة ....كما يمكنك ايضا استخدام backing bean كالأتى:
 DCBindingContainer bindingsImpl = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry(); //CreateInsert Here In your PageDefinition for your ViewObject OperationBinding operationBinding = bindingsImpl.getOperationBinding("CreateInsert"); operationBinding.execute(); DCIteratorBinding dciter = null; //access the iterator by its ID value in the PageDef file. dciter = bindingsImpl.findIteratorBinding("ChangeRequestVO1Iterator"); Row currentRow = dciter.getCurrentRow(); currentRow.setAttribute("SubmittedBy", Util.getOsUser()); 



شكرا على الكود
بس معلش للتوضيح
الكود دة اكتبة فى اى ميثود؟
بتاريخ:
  • كاتب الموضوع

Thank you Miro
I solved the issue
I addedd you code to a command button that make insert

Thanks

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.