Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

OBIEE 11g Only One Apply/Go Button

user9525825Sep 26 2013

Hi All,

Currently Ii´m involved in
a migration process of OBIEE 10g to 11g and I need to maintain the same functionalities
works in 11g.

In 10g I have one dashboard
with 3 dashboard prompts, and the apply/go button is only one for all dashboard
prompts.

This feature in 10g was implements
by javascript however in 11g don´t work.

After some research I try code
that was mention on link http://bidirect.blogspot.pt/2013/06/single-apply-and-clear-button-for.html but this don´t work like i need,
because only works for the 2 dashboard prompt.

After some changes i have
this code:

<script>

function apply()

{

alert ('ola');

var x = 0;

var aElm=PromptManager.getPromptManager().getAllPromptCollectionJSON();

alert ( aElm.length);

var promptExpr = []

for(var i = 0; i < aElm.length;i++)

{

alert ( 'Dashboard Prompt --> ' + i);

for(var j = 0; j < aElm[i].promptSteps[0].prompts.length;j ++ )

{

var promptid = aElm[i].promptSteps[0].prompts[j].promptStreamID;

var g = null;

var h =
PromptManager.getPromptManager().getPromptCollectionInfoWithViewID(aElm[i].viewStatePath);

//alert ( 'Dashboard Prompt --> ' + i + '\n' + ' Prompt ' + j);

if(h)

{

//alert ( 'Dashboard Prompt --> ' + i + '\n' + ' Prompt ' + j);

try

{

//alert ( 'Dashboard Prompt --> ' + i + '\n' + ' Prompt ' + j);

var b = h.getAllPromptExprsArray();

//alert ('2')

if( ! h.verifyPromptValuesAndDisplayError(b))

{

return;

}

//alert ('3');

g = PromptManager.buildPromptExprGivenExpr("", b);

//alert ('4')

}

catch(f)

{

alert(f);

return;

}

}

}

x++;

promptExpr[i] = g;

//alert ('incrementar x');

//PromptManager.submitPrompt(aElm[i].viewStatePath,
true,"PromptFinish", g)

var t = i + 1;

//alert ('Run prompt')

}

x--;

//PromptManager.submitPrompt(aElm[x].viewStatePath,
true,"PromptFinish", g)

//alert ('PromptAgain');

//PromptManager.submitPrompt(aElm[0].viewStatePath,
false,"PromptAgain", g)

alert ('PromptAgain');

alert
(aElm[0].viewStatePath);

alert (aElm[1].viewStatePath);

//PromptManager.submitPrompt(aElm[0].viewStatePath,
false,"PromptAgain", promptExpr[0])

//alert ('PromptFinish 2');

//PromptManager.submitPrompt(aElm[1].viewStatePath,
true,"PromptFinish", promptExpr[1])

  1. PromptManager.submitPrompt(aElm[0].viewStatePath,
    false,"ApplyFilter", promptExpr[0])

    PromptManager.submitPrompt(aElm[1].viewStatePath,
    false,"ApplyFilter", promptExpr[1])

    PromptManager.submitPrompt(aElm[2].viewStatePath,
    false,"PromptFinish", promptExpr[2])

alert ('FIM');

}

</script>

<td class='GFPSubmitN'>

<table cellspacing=”0?>

<tbody><tr>

<td class="XUIPromptEntry">

<span class="minibuttonOn" align="left">

<div align="left"><a href="#"
onclick="javascript:apply();">Run</a></div>

</span></td>

<td></td>

<td class="XUIPromptEntry">

<span class="minibuttonOn" align="left">

<div align="left"><a href="#" onclick="return
PersonalizationEditor.removeDefaultSelection(false)
">Clear</a></div>

</span></td></tr><tr><td/></tr>

</tbody></table></td>

The code works but don´t
have the right functionality because when i submit first dashboard prompt they
apply the filters but refresh the dashboard and clear all other prompts values.

Can someone help me please?

Best Regards,

Pedro Madureira

Comments

Igor.M
check this (as sys)
set serveroutput on
DECLARE
ns VARCHAR2 (1024);
v_directory VARCHAR2 (1024);
BEGIN
v_directory := 'D:\USERS';
SYS.DBMS_BACKUP_RESTORE.searchfiles (v_directory, ns);

FOR xx IN (SELECT fname_krbmsft AS NAME
FROM x$krbmsft)
LOOP
DBMS_OUTPUT.put_line (xx.NAME);
END LOOP;
END;
/
or external table + PREPROCESSOR

http://www.oracle-developer.net/display.php?id=513

http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:3021213500346960197
unknown-7404
>
Below is the code that i have used from Tom's forums
>
That IS NOT identical to the code from the forum article you linked. Use cut & paste and be careful not to alter the code.

For example this is the original line #18 from Tom's code
18          element = list;
And this is the line from what you posted
element = list;
Tom's code is reference ONE item from the array but your code references the entire array because you left off the subscript. Then when you reference 'element' in the query you will get an error because you need to provide a single item but you are providing an array.
{quote}
i would like to know is there any alternative approach to retrieve the all file names from the server folder and move those files to another folder? 
{quote}
No - just use the code Tom provided. You can modify it to do the 'move' also. There won't be anything better than one short, simple procedure.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
ShankarViji
Answer
Hi,

This is a limitation of UTL_FILE in Oracle which we can do with the Java Stored Procedures in Oracle.

We can read the Server Directory Files Using the Below Steps:

Please Follow the Steps below :

1. Creating a Type of Varchar2 Type.
  CREATE OR REPLACE TYPE file_list AS TABLE OF VARCHAR2(255);
2. Next we need to create a Java library file
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ListVirtualDirectory" AS
  import java.io.*;
  import java.security.AccessControlException;
  import java.sql.*;
  import oracle.sql.driver.*;
  import oracle.sql.ArrayDescriptor;
  import oracle.sql.ARRAY;
 
  public class ListVirtualDirectory {
    public static ARRAY getList(String path) throws SQLException, AccessControlException {
 
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
 
    File directory = new File(path);
 
    ArrayDescriptor arrayDescriptor = new ArrayDescriptor("FILE_LIST",conn);
 
    ARRAY listed = new ARRAY(arrayDescriptor,conn,((Object[])directory.list()));
  return listed; }}
The more advanced method overrides exception handling by suppressing information about the java.properties settings. You can do it by catching the natively thrown exception and rethrow it or ignore it. The example rethrows it.

3. Next we need to create a Wrapper Function:
CREATE OR REPLACE FUNCTION list_files(path VARCHAR2) RETURN FILE_LIST IS
LANGUAGE JAVA
NAME 'ListVirtualDirectory.getList(java.lang.String) return oracle.sql.ARRAY';
4. Grant Permissions to the Driectory:
BEGIN
  DBMS_JAVA.GRANT_PERMISSION('USER_NAME'
                             ,'SYS:java.io.FilePermission'
                             ,'C:\JavaDev\images'
                             ,'read');
  END;
5. Next, You can read the contents of the Directory as,
SELECT column_value FROM TABLE(list_files('C:\JavaDev\images'));
Which displays all the Files in the Directory Mentioned.

Thanks,
Shankar
Marked as Answer by Amit Bhandari · Sep 27 2020
Amit Bhandari
Hi rp0428,

I used the same code from the Tom's forum but still getting same error "ORA-00900: invalid SQL statement" when executing the procedure. - I have used the same line that you had mentioned but when i had pasted that here that line showing only the element = list; instead of element = list of i ;


Thanks
Amit Bhandari
Amit Bhandari
Hi Shankar,

Thanks for the reply, the code is working for me ,i would also like to know that is there any approach to move those files to another folder?


Thanks
Amit Bhandari

Edited by: 935671 on Jun 4, 2012 11:21 PM
1 - 5
Locked Post
New comments cannot be posted to this locked post.