"Download Blob" using Interactive Grid - blob

What is equivalent to the Interactive Report "Download Blob" for Interactive Grids?
Currently I am using an Interactive Report as my workaround but would like to use Interactive Grid however there is no Download Blob column type and I don't want to hack a URL in the select clause.

Here are some steps that show you how it's done in APEX 19.2. Feel free to adjust as needed for other versions of APEX and as per your business requirements.
Create a table to store BLOB files and add a file as an example.
create table files (
id number generated by default as identity,
mime_type varchar2(255),
name varchar2(255),
content blob,
constraint files_pk primary key (id)
)
/
insert into files (
mime_type,
name,
content
) values (
'text/plain',
'test.txt',
hextoraw('48656c6c6f20576f726c6421')
);
commit;
Create a new Interactive Grid page on the table using this query:
select id,
mime_type,
name,
dbms_lob.getlength(content) file_size
from files
Create a new Blank Page in your application. Set Page Number to 9000 and set Name to Download File.
In the left-hand column of the Page Designer, right-click Content Body (under Regions) and select Create Region. Right-click the new region and select Create Page Item. Set the Name of the new item to P9000_FILE_ID and set the Type to Hidden. Note that neither the region or its item will ever be displayed.
In the left-hand column of the Page Designer, open the Pre-Rendering section, right-click Before Header, then select Create Process. Set the Name of the process to Download File and enter the following code for the PL/SQL Code:
declare
l_files_rec files%rowtype;
begin
select *
into l_files_rec
from files
where id = :P9000_FILE_ID;
owa_util.mime_header(l_files_rec.mime_type, false);
htp.p('Content-Length: ' || dbms_lob.getlength(l_files_rec.content));
htp.p('Content-Disposition: attachment; filename="' || l_files_rec.name || '"');
owa_util.http_header_close;
wpg_docload.download_file(l_files_rec.content);
apex_application.stop_apex_engine;
end;
This PL/SQL code is what gets the file from the database and streams it to the browser. You may want to modify this code, for example, to ensure a user should have access to the file they are trying to download. Also, consider application and page level security.
In the Page Designer, return to the Interactive Grid page. Right-click Columns under the Interactive Grid region and select Create Column. Set Column Name to Download, Type to Link, and (under Source) set Type to None. Click the No Link Defined button for Target to open the link settings. Set Page to 9000, use the popup to select P9000_FILE_ID under the Name column, use the popup to select ID under the Value column (in the same row), then click the OK button. Finally, set Link Text (under Target) to download.
To test, run the page and click the download link. The browser should download the file and when you open it the contents should be: Hello World!

Related

Create telegram bot Keyboard from JSON file depending on user menu selection

I am creating a telegram bot that requires a dynamic menu to be created depending on the user's previous menu selection. The dynamic menu should pull from a json file and a specific key:value. Required keyboard is the KeyboardButton and NOT an InlineKeyboardButton.
Example: User is presented with a menu that is A-F, G-L, M-R, and S-Z. When they select the button A-F I am looking for a dynamic menu to be built from the json file where Name is sorted from A-F. The user would then select a name from the new menu and information would be presented associated with that name.
I am lost on the dynamic menu portion for the af_menu_keyboard. Other menus are no problem and can retrieve what I need from that json file.
Anyone know how to achieve this?
result = os.popen("curl https://api.mainnet.klever.finance.....")
details = json.load(result)
def messageHandler(update: Update, context: CallbackContext):
if "A-F" in update.message.text:
update.message.reply_text(node_menu_message()),
reply_markup=af_menu_keyboard():
if "Back" in update.message.text:
update.message.reply_text(main_menu_message(),
reply_markup=main_menu_keyboard())
def first_menu_keyboard():
buttons = [[KeyboardButton("A-F"), KeyboardButton("G-L"), KeyboardButton("M-R")],
[KeyboardButton("S-Z"),KeyboardButton("Back", calback_data='main')]]
return ReplyKeyboardMarkup(buttons,resize_keyboard=True)
def af_menu_keyboard():
buttons = **** Create menu with multiple values from the API JSON file above ****
return ReplyKeyboardMarkup(buttons,resize_keyboard=True)

TestCafe does not write in text input field

I'm using TestCafe for test automation of a web application based on the Wicket framework. I try to type text into a text input field ... well, actually it is a dropdown list, where a text input field appears, so that the user can search for certain codes. The HTML fragment is as follows:
HTML fragment
And here is the corresponding screenshot (text field above "001"):
Text input field with dropdown
The user can type some characters and the list below is automatically filtered (I did this manually):
Text input field with some text
My TestCafe test tries this:
.click( productcodeList )
.expect( productcodeInputField.visible ).ok()
.click( productcodeInputField )
.typeText( productcodeInputField, 'ABW' )
i.e.
Click on the drop down list.
Assume that the text input field is now visible (works fine).
Click on the text input field (this should not be necessary, since typeText() is supposed to do this anyway).
Type the text "ABW" into the text input field ==> This does not work.
I'm sure that my Selector works, since the assertion (expect) is successful and when I debug the test run after the second click (on the text input field), I see the following:
TestCafe screenshot
I.e. the cursor is directly on the text field, but somehow TestCafe cannot write the text into the field.
Some additional information: The Selector for the input field is created as follows:
productcodeInputField = Selector('span').withAttribute('class', /select2-dropdown.*/ ).child('span').withAttribute('class', /select2-search.*/ ).child('input').withAttribute('class', 'select2-search__field' );
More information: I'm using the same logic on the same page:
kurzbezeichnungField = Selector('input').withAttribute('name', /.*aeAbbreviation.*/);
...
await t.click( kurzbezeichnungField )
.typeText( kurzbezeichnungField, 'xxxWWW' )
and this works fine.
Node.js version: v10.16.3
Testcafe version: 1.5.0
This issue looks like a bug. However, I cannot say it precisely without an example that demonstrates the problem.
My team would really appreciate it if you share your project or sample to demonstrate the issue.
Please create a separate issue in the TestCafe github repository using the following template and provide as much additional information as possible.

Using send_keys() on a search/filter input field does not filter results in table

There is a table with a list of users and their email on a webpage. At the top of the page, is a search/filter input field that allows the user to type an email or username and filter for the result as he/she is typing.
The problem: However, when I use the send_keys() method instead of doing this manually, nothing is filtered in the table view.
This is happening on the Safari browser on the iPhone 7 Plus (real device, not simulator). Some other information:
iOS version: 12.2
Appium version: 1.13.0-beta.3
Selenium version: 2.53.1
Programming language: Python 2.7.15
In addition to send_keys(), i've tried to use set_value(), i've also tried to execute JS and setting the attribute value, and also tried to send key for each character (in a for loop with a delay between each character).
I'm expecting for example, element.send_keys("test1000#test.com) to filter the table view on the web page so that the only user that is displayed has the associated test1000#test.com email as it does when I go through the site manually.
In actuality, send_keys() does not do that and nothing in the table view gets filtered.
Any help or guidance would be appreciated!
Explicit wait for table to get populate in DOM
sendKeys search String and additional key Tab
textbox.sendKeys("test1000#test.com"+Keys.TAB)
Explicit Wait for filter to get applied and table to get refreshed.
find elements for the newly populated table with applied filters.

Chart data does not link to interactive report page in APEX

I am attempting to create a link in an APEX (Oracle) chart which will open an interactive report page by using the "Link Builder -Target" wizard.
Link Builder -Target Dialog]1
Unfortunately the link is passing the column name (bob) rather than it's value:
https://xxxxxxxxx.xxxx.xxx:xxxx/ords/f?p=100:51:19910173095277::NO:RP,51:P51_TARGET_FIELD:#BOB#
If I substitute a value for #BOB#, the interactive page opens properly.
How do I get APEX to pass the column value rather than the column name to the linked page?
Is BOB a chart column?
If not in the Link Builder, use the selector on 'Value' to select the corresponding column from the chart, such as #NAME#.
Regards,
David
Page Designer vs Legacy Component View
Apex 5.0 still using anychart charts, but using Page Designer the query of the chart is not validate. If you change to Legacy Component View you must see a error on save the chart with this query.
The selects in anychart charts need a query following these terms:
*BOB column is not valid to use on Link Builder Target
Try to put the value of the BOB column in the LINK column, like:
SELECT
bob AS LINK,
or use APEX_UTIL.PREPARE_URL, in this case it's not necessary to use Link Builder Target.
...
The query needs only three columns called LINK, LABEL and VALUE. Use alias to make this.
SELECT
APEX_UTIL.PREPARE_URL
('f?p=&APP_ID.:14:&APP_SESSION.::::P14_RECIEVER,P14_VALUE:' || bob || ',' || quantity) AS LINK,
month AS LABEL,
quantity AS VALUE
FROM mytable
https://apex.oracle.com/pls/apex/f?p=4550
Workspace: STACKQUESTIONS
User: test
Password: test
Issue page: https://apex.oracle.com/pls/apex/f?p=145797:10

Need to capture ID after clicking on submit button

I am using selenium with java and In my application , whenever I click on submit button, system generates random ID, I need to capture that ID displayed on screen(a div) and then put in other field to ensure, all fields are filled and we are able to edit as well.
The simpelst way is this:
Create a variable that will contain the id:
String myID;
After id is created you need to capture the text in the filed:
myID = driver.findElement(By.id(".....")).getText();
After this, the ID will be saved in myID.
to see if it worked, run the following line:
System.out.println(myID);
If the output in the console is the same as in a generated ID field then all worked correctly.