Document Library in APEX 4.2.4
On Dec 19, I read in article http://www.oracle.com/technetwork/developer-tools/apex/overview/apex-42-new-features-1867076.pptx
on page 26 that one of the productivity Applications is "Document Library".
After I installed the patch from Metalink, I was not able to identify that Packaged app. Can someone help on how to locate and install that particular application?
Now I checked it again and it is not there. Someone removed it.
Is there any plan to upgrade the original app that came out with APEX 3.2 any time soon?
Thank you
Yannisr,
I'm not seeing a reference to "Document Library" in the slide deck you linked to, nor have we created a packaged application with that name. If it was referenced in an earlier version of the slide deck, that was an error. (And, of course, there's the disclaimer on slide 3.)
As to our plans: to date, we have not been upgrading any old applications to our new system, instead focusing on building new applications that we felt would be useful. That said, a Document Library does sound like it might be a very useful application; would you mind spending some time detailing what sorts of features you'd like to have?
Thanks,
-David
Similar Messages
-
Cannot Download Documents from the Application Document Library
I installed the Document library into APEX 2.2.1 & Oracle10g R2 running my HTTPD server in SSL mode. I cannot download any documents loaded into the application. I modified the WWV_FLOW_EPG_INCLUDE_MOD_LOCAL as directed in another post and I'm still having problems.
Can anyone help?
Thanks,
KirkThis question is closed,
I de-installed the application, dropped the workspace then I reinstalled everything, now it's working...hmmmmm!
Kirk -
Unable to load Packaged App Document Library 0.91 in Apex 3
I have downloaded packaged application Document Library 0.91 from packaged applications URL and trying to import it into APEX 3.0.
In Application Builder I am getting an error message that 'Script has exceeded the maximum limit'. So I tried executing the install script as a application parsing schema, then it returned following error in SQL*Plus:
SQL> spool doclib_install.log
SQL> @doc_library_installer_0.91.sql
APPLICATION 12487 - Document Library 0.9
Set Credentials...
Illegal security group id value for this schema.
Check Compatibility...
API Last Extended:20070108
Your Current Version:20070108
This import is compatible with version: 20060224
COMPATIBLE (You should be able to run this import without issues.)
Set Application ID...
begin
ERROR at line 1:
ORA-20001: Package variable g_security_group_id must be set.
ORA-06512: at "FLOWS_030000.WWV_FLOW_API", line 45
ORA-06512: at "FLOWS_030000.WWV_FLOW_API", line 237
ORA-06512: at line 4
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.4.2 - Production
With the Partitioning, OLAP and Data Mining options
Am i missing anything or if anybody got a luck to install this app into Apex 3.0 pls. let me know how to resolve the above error?
Thanks & regards,
PreetPreet,
Maybe we need to be more explicit in the readme. You need to "Import and install the doc_library_installer_0.91.sql ... Select to install supporting objects." This is from the Application Builder, select Import. Maybe you uploaded it as a script under the SQL Workshop? Those directions are in the readme for upgrading from the .9 version to the .91 version without losing your data.
-- Sharon -
Packaged App Document Library 0.91 installs with errors in Apex 3.0
Hello All,
I get these errors when I try to install Document Library packaged application in Apex 3.0
Script name success errors total
tab.sql 137 1 137
doclib.pkb 0 1 1
sync_index.sql 1 1 2
When I try to run the app, I am prompted for user name and password. I enter the user name I’ve selected during the install process as parsing schema, and I get this error:
ORA-04063: package body "DOADMIN.DOCLIB" has errors ORA-06508: PL/SQL: could not find program unit being called: "DOADMIN.DOCLIB"
ERR-1082 Error in executing authorization scheme code.
How can I find the object that caused errors during install? Is there any installation log?
Thank you,
DanielI’ve attempted to install the document library app into completely new workspace, with new parsing user. I still get the same errors:
Errors
tab.sql
create index doclib_docs_idx2 on doclib_documents(contents) indextype is ctxsys.context
ORA-29833: indextype does not exist
doclib.pkb
create or replace package body doclib as
g_html_email_header constant varchar2(4000) := '<html lang="en-us" xmlns:htmldb="http://htmldb.oracle.com">
<head>
<style type="text/css">
*{font-size:12px;font-family:Arial, Helvetica, Geneva, sans-serif;}
body{background-color:#fff;margin:0;padding:0;font-family:Arial, Helvetica, Geneva, sans-serif;font-size:12px;}
body *{font-size:12px;}
img{border:0;margin:0;}
hr{color:#bbb;height:1px;}
br{clear:both;}
p{font-size:12px;}
a:link,a:visited{text-decoration:none;font-size:-1;color:#7f7f7f;}
a:active,a:hover{text-decoration:underline;font-size:-1;color:#ff6600;}
</style>
<title></title>
<body>';
g_html_email_footer constant varchar2(30) := '</body></html>';
function get_member_id (
p_user_name in varchar2
) return number
is
l_user_id number;
begin
for c1 in (select user_id
from doclib_members
where upper(p_user_name) = user_name ) loop
l_user_id := c1.user_id;
end loop;
return l_user_id;
end get_member_id;
function get_member_email (
p_user_name in varchar2
) return varchar2
is
l_email varchar2(255);
begin
for c1 in (select email_address
from doclib_members
where upper(p_user_name) = user_name ) loop
l_email := c1.email_address;
end loop;
return l_email;
end get_member_email;
function get_acl_id (
p_user_name in varchar2
) return number
is
l_acl_id number := 0;
begin
for c1 in (select role_id
from doclib_members
where upper(p_user_name) = user_name ) loop
l_acl_id := c1.role_id;
end loop;
return l_acl_id;
return 3;
end get_acl_id;
function get_local_name (
p_filename in varchar2
) return varchar2
is
begin
return substr(p_filename,instr(p_filename,'/')+1);
end get_local_name;
function doc_is_checkedout_by (
p_doc_id in varchar2
) return varchar2
is
begin
for c1 in (select checkedout_by
from doclib_documents
where doc_id = p_doc_id ) loop
return c1.checkedout_by;
end loop;
return null;
end doc_is_checkedout_by;
function get_doc_name (
p_doc_id in varchar2
) return varchar2
is
begin
for c1 in (select name
from doclib_documents
where doc_id = p_doc_id ) loop
return c1.name;
end loop;
return null;
end get_doc_name;
function doc_already_exists (
p_name in varchar2
) return boolean
is
begin
for c1 in (select null
from doclib_documents
where name = p_name ) loop
return true;
end loop;
return false;
end doc_already_exists;
function alert_todo_already_exists (
p_user_id in number
) return boolean
is
l_found boolean := false;
begin
for c1 in (select null
from doclib_alerts a, doclib_alerts_todo b
where a.alert_id = b.alert_id
and a.doctask_id = 0
and a.user_id = p_user_id ) loop
l_found := true;
exit;
end loop;
return l_found;
end alert_todo_already_exists;
function parse_search_string(
p_search_str in varchar2 ) return varchar2
is
l_temp_value varchar2(1000);
l_temp_value2 varchar2(1000);
l_return_value varchar2(1000) := NULL;
l_start_token number := 1;
l_in_token boolean := FALSE;
l_quotes number;
l_phrases dbms_sql.varchar2s;
n number;
begin
if nvl(length(p_search_str),0) = 0 then
return NULL;
end if;
l_quotes := length(p_search_str) - length(replace(p_search_str,'"', ''));
if ( l_quotes > 0 and mod(l_quotes,2) = 0 ) then
l_temp_value2 := lower(p_search_str);
for i in 1 .. l_quotes/2 loop
n := instr( l_temp_value2, '"' );
l_temp_value := l_temp_value || substr( l_temp_value2, 1, n-1 );
l_temp_value2 := substr( l_temp_value2, n+1 );
n := instr( l_temp_value2, '"' );
l_phrases(i) := substr( l_temp_value2, 1, n-1 );
l_temp_value2 := substr( l_temp_value2, n+1 );
end loop;
l_temp_value := l_temp_value || l_temp_value2;
else
l_temp_value := lower(p_search_str);
end if;
l_temp_value := trim(replace( l_temp_value, ':', ' '));
l_temp_value := trim(replace( l_temp_value, ';', ' '));
l_temp_value := trim(replace( l_temp_value, '"', ' '));
l_temp_value := trim(replace( l_temp_value, ':'',', ' '));
l_temp_value := trim(replace( l_temp_value, '(', ' '));
l_temp_value := trim(replace( l_temp_value, ')', ' '));
l_temp_value := trim(replace( l_temp_value, '!', ' '));
l_temp_value := trim(replace( l_temp_value, '&', ' '));
l_temp_value := trim(replace( l_temp_value, '+', ' '));
l_temp_value := trim(replace( l_temp_value, '-', ' '));
l_temp_value := trim(replace( l_temp_value, ',', ' '));
l_temp_value := trim(replace( l_temp_value, '\', ' '));
l_temp_value := trim(replace( l_temp_value, ' and ', ' ' ));
l_temp_value := trim(replace( l_temp_value, ' or ', ' ' ));
if length(l_temp_value) > 0 then
l_in_token := TRUE;
end if;
for i in 1..nvl(length(l_temp_value),0) loop
if substr(l_temp_value,i,1) = ' ' then
if l_in_token = TRUE then
l_return_value := l_return_value || '{' || substr(l_temp_value,l_start_token, i-l_start_token) || '}' || ' and ';
l_in_token := FALSE;
end if;
elsif l_in_token = FALSE then
l_in_token := TRUE;
l_start_token := i;
end if;
end loop;
if l_in_token = TRUE then
l_return_value := l_return_value || '{' || substr(l_temp_value,l_start_token) || '} and ';
end if;
for i in 1 .. nvl(l_phrases.count,0) loop
l_return_value := l_return_value || ' {' || l_phrases(i) || '} and ';
end loop;
return trim( substr( l_return_value, 1, length(l_return_value)-4 ) );
end parse_search_string;
function doc_has_revisions (
p_doc_id in varchar2
) return number
is
l_revisions number := 0;
begin
for c1 in (select count(*) cnt
from doclib_documents
where deleted_as_of = to_date('22-04-2004','DD-MM-YYYY')
and revision_of = p_doc_id ) loop
l_revisions := c1.cnt;
end loop;
return l_revisions;
end doc_has_revisions;
function get_checkout_list (
p_user_name in varchar2
) return varchar2
is
l_chkout_lst varchar2(32000);
begin
for c1 in (select '<li>'||name||'</li>' name
from doclib_documents
where deleted_as_of = to_date('22-04-2004','DD-MM-YYYY')
and revision_of = 0
and checkedout_by = p_user_name ) loop
l_chkout_lst := l_chkout_lst || c1.name;
end loop;
if l_chkout_lst is null then
l_chkout_lst := 'None.';
else
l_chkout_lst := '<ul>'||l_chkout_lst||'</ul>';
end if;
return l_chkout_lst;
end get_checkout_list;
procedure return_xml (
p_doc_id in number,
p_action in varchar2,
p_message in varchar2,
p_chkout_lst in varchar2,
p_result in varchar2,
p_user_name in varchar2
is
begin
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.p('<div class="return" id="'||p_doc_id||'" action="'||p_action||'" result="'||p_result||'">');
htp.p('<div class="message" id="primary">'||p_message||'</div>');
htp.p('<div class="message" id="chkoutlst">'||p_chkout_lst||'</div>');
htp.p('<div id="checkoutby">'||p_user_name||'</div>');
htp.p('<div id="modifiedby">'||p_user_name||'</div>');
htp.p('</div>');
end;
procedure add_document (
p_doc_id in varchar2 default null,
p_name in varchar2 default null,
p_filename in varchar2,
p_user_name in varchar2,
p_description in varchar2,
p_attr1 in varchar2,
p_attr2 in varchar2,
p_attr3 in varchar2
is
l_content blob;
l_mime_type varchar2(48);
l_name varchar2(255);
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to add documents.');
end if;
if p_name is null then
l_name := get_local_name(p_filename);
for c1 in (select doc_id, name
from doclib_documents
where revision_of = 0
and name = l_name ) loop
--document already exists, so update it
update_document(c1.doc_id, c1.name, p_filename, p_user_name, p_description, p_attr1, p_attr2, p_attr3);
goto end_add;
end loop;
else
l_name := p_name;
end if;
for c1 in (select mime_type, blob_content
from apex_application_files
where name = p_filename ) loop
l_content := c1.blob_content;
l_mime_type := c1.mime_type;
end loop;
insert
into doclib_documents (doc_id, name, description, mime_type, contents, attr1, attr2, attr3)
values (p_doc_id, l_name, p_description, l_mime_type, l_content, p_attr1, p_attr2, p_attr3);
delete
from apex_application_files
where name = p_filename;
if p_name is null then
do_alerts('D',0,null);
end if;
commit;
<<end_add>>
null;
exception when others then
raise_application_error(-20001, 'Exception encountered adding document: '||sqlerrm);
end add_document;
procedure add_member (
p_user_name in varchar2,
p_member in varchar2,
p_email in varchar2,
p_acl_id in varchar2
is
begin
if get_acl_id(p_user_name) < 3 then
raise_application_error(-20001,'You are not authorized to add members.');
end if;
insert
into doclib_members (user_name, email_address, role_id)
values (p_member, p_email, p_acl_id);
commit;
exception when dup_val_on_index then
raise_application_error(-20001,'The user is already a member of this workspace.');
when others then
raise_application_error(-20001,'Exception encountered adding member: '||sqlerrm);
end add_member;
procedure add_task (
p_user_name in varchar2,
p_assigned_to in varchar2,
p_name in varchar2,
p_description in varchar2,
p_start_date in varchar2,
p_end_date in varchar2,
p_priority in varchar2,
p_status in varchar2,
p_pct_complete in varchar2,
p_doc_id in varchar2
is
l_start_date date;
l_due_date date;
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to add tasks.');
end if;
l_start_date := to_date(p_start_date,'DD-MM-YYYY HH24:MI');
l_due_date := to_date(p_end_date, 'DD-MM-YYYY HH24:MI');
insert
into doclib_tasks (assigned_to, name, description, start_date, due_date, priority_id, status_id, pct_complete, doc_id)
values (p_assigned_to, p_name, p_description, l_start_date, l_due_date, p_priority, p_status, p_pct_complete, p_doc_id);
do_alerts('T',0,null);
commit;
exception when others then
raise_application_error(-20001,'Exception encountered adding task: '||sqlerrm);
end add_task;
procedure add_link (
p_user_name in varchar2,
p_name in varchar2,
p_url in varchar2
is
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to add links.');
end if;
insert
into doclib_links (name, url)
values (p_name, p_url);
commit;
exception when others then
raise_application_error(-20001,'Exception encountered adding link: '||sqlerrm);
end add_link;
procedure add_announcement (
p_user_name in varchar2,
p_title in varchar2,
p_description in varchar2,
p_expire_date in varchar2
is
l_expire_date date;
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to add announcements.');
end if;
l_expire_date := to_date(p_expire_date,'DD-MM-YYYY HH24:MI');
insert
into doclib_announcements (title, description, expire_date)
values (p_title, p_description, l_expire_date);
commit;
exception when others then
raise_application_error(-20001,'Exception encountered adding announcement: '||sqlerrm);
end add_announcement;
procedure add_alert (
p_user_name in varchar2,
p_alert_type in varchar2,
p_alert_interval in varchar2,
p_doctask_id in varchar2
is
l_user_id number;
begin
l_user_id := get_member_id(p_user_name);
insert
into doclib_alerts (user_id, alert_type, alert_interval, doctask_id)
values (l_user_id, p_alert_type, p_alert_interval, p_doctask_id);
commit;
exception when others then
raise_application_error(-20001,'Exception adding alert: '||sqlerrm);
end add_alert;
procedure delete_alert (
p_alert_id in varchar2
is
begin
delete
from doclib_alerts
where alert_id = p_alert_id;
commit;
end delete_alert;
procedure do_alerts (
p_alert_type in varchar2,
p_doctask_id in number,
p_newdoc_id in number default null
is
l_subject varchar2(2000);
l_url varchar2(4000);
l_body clob;
l_body_html clob;
begin
l_body := ' ';
if p_alert_type = 'D' then
--Do document alerts on specific document
if p_doctask_id != 0 then
for c1 in (select c.email_address, c.user_id, b.name, a.alert_interval, a.alert_id
from doclib_alerts a, doclib_documents b, doclib_members c
where a.alert_type = p_alert_type
and a.doctask_id = b.doc_id
and a.user_id = c.user_id
and a.doctask_id = p_doctask_id ) loop
l_subject := 'Document '||c1.name||' has been updated.';
l_url := v('BASE_URL')||'/f?p='||v('APP_ID')||':2:::::P2_DOC_ID:'||p_newdoc_id;
l_body_html := g_html_email_header||'<p />'||l_subject||'<p />Click to view.'||
g_html_email_footer;
if c1.alert_interval = 'I' then
apex_mail.send(
p_to => c1.email_address,
p_from => c1.email_address,
p_body => l_body,
p_body_html => l_body_html,
p_subj => l_subject );
else --it is a daily alert, insert into todos
if not alert_todo_already_exists(c1.user_id) then --make sure non-specific daily alert isn't already recorded
insert
into doclib_alerts_todo (alert_id, alert_url)
values (c1.alert_id, l_url);
end if;
end if;
end loop;
update doclib_alerts
set doctask_id = p_newdoc_id
where alert_type = 'D'
and doctask_id = p_doctask_id;
end if;
--Do document alerts on generic documents
for c1 in (select c.email_address, c.user_id, a.alert_id, a.alert_interval
from doclib_alerts a, doclib_members c
where a.alert_type = p_alert_type
and a.doctask_id = 0
and a.user_id = c.user_id ) loop
l_subject := 'A document has been added or updated in the document workspace.';
l_url := v('BASE_URL')||'/f?p='||v('APP_ID')||':1';
l_body_html := g_html_email_header||'<p />'||l_subject||'<p />Click to view.'||
g_html_email_footer;
if c1.alert_interval = 'I' then
apex_mail.send(
p_to => c1.email_address,
p_from => c1.email_address,
p_body => l_body,
p_body_html => l_body_html,
p_subj => l_subject );
else --it is a daily alert, insert into todos
if not alert_todo_already_exists(c1.user_id) then --make sure non-specific daily alert isn't already recorded
insert
into doclib_alerts_todo (alert_id, alert_url)
values (c1.alert_id, l_url);
end if;
end if;
end loop;
else
if p_doctask_id != 0 then
--Do task alerts on specific tasks
for c1 in (select c.email_address, c.user_id, b.name, a.alert_interval, a.alert_id
from doclib_alerts a, doclib_tasks b, doclib_members c
where a.alert_type = p_alert_type
and a.doctask_id = b.task_id
and a.user_id = c.user_id
and a.doctask_id = p_doctask_id ) loop
l_subject := 'Task '||c1.name||' has been updated.';
l_url := v('BASE_URL')||'/f?p='||v('APP_ID')||':75:::::P75_TASK_ID:'||p_doctask_id;
l_body_html := g_html_email_header||'<p />'||l_subject||'<p />Click to view.'||
g_html_email_footer;
if c1.alert_interval = 'I' then
apex_mail.send(
p_to => c1.email_address,
p_from => c1.email_address,
p_body => l_body,
p_body_html => l_body_html,
p_subj => l_subject );
else --it is a daily alert, insert into todos
if not alert_todo_already_exists(c1.user_id) then --make sure non-specific daily alert isn't already recorded
insert
into doclib_alerts_todo (alert_id, alert_url)
values (c1.alert_id, l_url);
end if;
end if;
end loop;
end if;
--Do task alerts on generic tasks
for c1 in (select c.email_address, c.user_id, a.alert_id, a.alert_interval
from doclib_alerts a, doclib_members c
where a.alert_type = p_alert_type
and a.doctask_id = 0
and a.user_id = c.user_id ) loop
l_subject := 'A task has been added or updated in the document workspace.';
l_url := v('BASE_URL')||'/f?p='||v('APP_ID')||':1';
l_body_html := g_html_email_header||'<p />'||l_subject||'<p />Click to view.'||
g_html_email_footer;
if c1.alert_interval = 'I' then
apex_mail.send(
p_to => c1.email_address,
p_from => c1.email_address,
p_body => l_body,
p_body_html => l_body_html,
p_subj => l_subject );
else --it is a daily alert, insert into todos
if not alert_todo_already_exists(c1.user_id) then --make sure non-specific daily alert isn't already recorded
insert
into doclib_alerts_todo (alert_id, alert_url)
values (c1.alert_id, l_url);
end if;
end if;
end loop;
end if;
end do_alerts;
procedure do_alert_todos
is
l_subject varchar2(2000);
l_body clob;
l_body_html clob;
begin
wwv_flow_api.set_security_group_id;
l_body := ' ';
l_subject := 'Documents or tasks have been updated.';
for c1 in (select distinct(c.email_address), b.user_id
from doclib_members c, doclib_alerts b, doclib_alerts_todo a
where a.alert_id = b.alert_id
and b.user_id = c.user_id ) loop
l_body_html := g_html_email_header||'<p />The following documents or tasks have been added or updated.';
for c2 in (select b.alert_url
from doclib_alerts a, doclib_alerts_todo b
where a.alert_id = b.alert_id
and a.user_id = c1.user_id ) loop
l_body_html := l_body_html || '<p />'||c2.alert_url||'';
end loop;
l_body_html := l_body_html ||g_html_email_footer;
apex_mail.send(
p_to => c1.email_address,
p_from => c1.email_address,
p_body => l_body,
p_body_html => l_body_html,
p_subj => l_subject );
end loop;
delete from doclib_alerts_todo;
commit;
end do_alert_todos;
procedure update_document (
p_doc_id in varchar2,
p_name in varchar2,
p_filename in varchar2,
p_user_name in varchar2,
p_description in varchar2,
p_attr1 in varchar2,
p_attr2 in varchar2,
p_attr3 in varchar2
is
l_doc_id number;
l_checked_out_by varchar2(255);
l_mime_type varchar2(48);
l_cnt number;
l_num_over number;
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to update documents.');
end if;
l_checked_out_by := doc_is_checkedout_by(p_doc_id);
--this can be optimistic locking mechanism
if l_checked_out_by is not null and upper(l_checked_out_by) != upper(p_user_name) then
raise_application_error(-20001,'This document is locked by '||l_checked_out_by);
end if;
for c1 in (select mime_type
from apex_application_files
where name = p_filename ) loop
l_mime_type := c1.mime_type;
end loop;
for c1 in (select mime_type
from doclib_documents
where doc_id = p_doc_id ) loop
if l_mime_type != c1.mime_type then
delete
from apex_application_files
where name = p_filename;
raise_application_error(-20001,'The document type to be checked in does not match the document type of the original document.');
end if;
end loop;
if l_checked_out_by is not null then
checkin(p_doc_id, p_user_name);
end if;
l_doc_id := doclib_nextval;
add_document(l_doc_id, p_name, p_filename, p_user_name, p_description, p_attr1, p_attr2, p_attr3);
update doclib_documents
set revision_of = l_doc_id
where doc_id = p_doc_id;
l_cnt := 1;
for c1 in (select count(*) cnt
from doclib_documents
where revision_of != 0
and deleted_as_of = to_date('22-04-2004','DD-MM-YYYY') -- don't count logically deleted docs
and name = p_name ) loop
l_cnt := l_cnt + c1.cnt;
end loop;
--check whether we have hit max revisions as defined in workspace setting
if v('DOC_WORKSPACE_VERSIONS') != '0' and l_cnt > to_number(v('DOC_WORKSPACE_VERSIONS')) then
l_num_over := l_cnt - to_number(v('DOC_WORKSPACE_VERSIONS'));
for c2 in (select doc_id
from (select doc_id
from doclib_documents
where name = p_name
order by version_no)
where rownum <= l_num_over ) loop
delete
from doclib_documents
where doc_id = c2.doc_id;
end loop;
end if;
update doclib_documents
set revision_of = l_doc_id
where (revision_of != 0 or deleted_as_of != to_date('22-04-2004','DD-MM-YYYY'))
and name = p_name;
--preserve lock
if l_checked_out_by is not null then
update doclib_documents
set checkedout_by = l_checked_out_by
where doc_id = l_doc_id;
end if;
--do alerts
do_alerts('D',p_doc_id, l_doc_id);
--update tasks
update doclib_tasks
set doc_id = l_doc_id
where doc_id = p_doc_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered updating document: '||sqlerrm);
end update_document;
procedure update_doc_attributes (
p_doc_id in varchar2,
p_user_name in varchar2,
p_description in varchar2,
p_attr1 in varchar2,
p_attr2 in varchar2,
p_attr3 in varchar2
is
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to update document attributes.');
end if;
update doclib_documents
set description = p_description,
attr1 = p_attr1,
attr2 = p_attr2,
attr3 = p_attr3
where doc_id = p_doc_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered updating document attributes: '||sqlerrm);
end update_doc_attributes;
procedure checkout (
p_doc_id in varchar2,
p_user_name in varchar2
is
l_chkout_lst varchar2(32000);
begin
if get_acl_id(p_user_name) < 2 then
--raise_application_error(-20001,'You are not authorized to checkout documents.');
return_xml(p_doc_id,'CHECKOUT','You are not authorized to lock documents.',null,'FAILED',p_user_name);
return;
end if;
--This can be the optimistic locking scheme
if doc_is_checkedout_by(p_doc_id) is not null then
--raise_application_error(-20001,'This document is already checked out.');
return_xml(p_doc_id,'CHECKOUT','This document is already locked.',null,'FAILED',p_user_name);
return;
end if;
update doclib_documents
set checkedout_by = p_user_name
where doc_id = p_doc_id;
commit;
l_chkout_lst := get_checkout_list(p_user_name);
return_xml(p_doc_id,'CHECKOUT','Document successfully locked.',l_chkout_lst,'SUCCESS',p_user_name);
exception when others then
--raise_application_error(-20001,'Expection encountered checking out document: '||sqlerrm);
return_xml(p_doc_id,'CHECKOUT','Expection encountered checking out document: '||sqlerrm,null,'FAILED',p_user_name);
end checkout;
procedure checkin (
p_doc_id in varchar2,
p_user_name in varchar2
is
begin
if doc_is_checkedout_by(p_doc_id) is null then
raise_application_error(-20001,'This document is not locked.');
end if;
update doclib_documents
set checkedout_by = null
where doc_id = p_doc_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered checking in document: '||sqlerrm);
end checkin;
procedure uncheckout (
p_doc_id in varchar2,
p_user_name in varchar2
is
l_checkedout_by varchar2(255);
l_chkout_lst varchar2(32000);
begin
l_checkedout_by := doc_is_checkedout_by(p_doc_id);
if l_checkedout_by is null then
--raise_application_error(-20001,'This document is not checked out.');
return_xml(p_doc_id,'UNCHECKOUT','This document is not locked.',null,'FAILED',p_user_name);
return;
end if;
--This can be optimistic locking scheme
if upper(l_checkedout_by) != upper(p_user_name) and get_acl_id(p_user_name) < 3 then
--raise_application_error(-20001,'You are not authorized to uncheckout this document.');
return_xml(p_doc_id,'UNCHECKOUT','You are not authorized to unlock this document.',null,'FAILED',p_user_name);
return;
end if;
update doclib_documents
set checkedout_by = null
where doc_id = p_doc_id;
commit;
l_chkout_lst := get_checkout_list(p_user_name);
return_xml(p_doc_id,'UNCHECKOUT','Unlock was successfull',l_chkout_lst,'SUCCESS',p_user_name);
exception when others then
--raise_application_error(-20001,'Exception encountered unchecking out document: '||sqlerrm);
return_xml(p_doc_id,'UNCHECKOUT','Exception encountered unlocking document: '||sqlerrm,null,'FAILED',p_user_name);
end uncheckout;
procedure update_member (
p_user_name in varchar2,
p_member_id in varchar2,
p_email in varchar2,
p_acl_id in varchar2,
p_retrieved in varchar2
is
l_retrieved date;
begin
l_retrieved := to_date(p_retrieved,'DD-MM-YYYY HH24:MI:SS');
if get_acl_id(p_user_name) < 3 then
raise_application_error(-20001,'You are not authorized to update members.');
end if;
--optimistic locking
for c1 in (select null
from doclib_members
where user_id = p_member_id
and updated_on > l_retrieved ) loop
raise_application_error(-20001,'The member has been updated since you retrieved the data. Refresh and try again.');
end loop;
update doclib_members
set email_address = p_email,
role_id = p_acl_id
where user_id = p_member_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered updating member: '||sqlerrm);
end update_member;
procedure update_member_email (
p_user_name in varchar2,
p_email in varchar2,
p_retrieved in varchar2
is
l_user_id number;
l_retrieved date;
begin
l_user_id := get_member_id(p_user_name);
l_retrieved := to_date(p_retrieved,'DD-MM-YYYY HH24:MI:SS');
--optimistic locking
for c1 in (select null
from doclib_members
where user_id = l_user_id
and updated_on > l_retrieved ) loop
raise_application_error(-20001,'Remarkably, your email address changed since you retrieved the data. Refresh and try again.');
end loop;
update doclib_members
set email_address = p_email
where user_id = l_user_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered updating email: '||sqlerrm);
end update_member_email;
procedure update_task (
p_task_id in varchar2,
p_title in varchar2,
p_user_name in varchar2,
p_assigned in varchar2,
p_priority in varchar2,
p_status in varchar2,
p_pct_complete in varchar2,
p_description in varchar2,
p_start_date in varchar2,
p_due_date in varchar2,
p_doc_id in varchar2,
p_retrieved in varchar2
is
l_start_date date;
l_due_date date;
l_retrieved date;
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to update tasks.');
end if;
l_retrieved := to_date(p_retrieved,'DD-MM-YYYY HH24:MI:SS');
l_start_date := to_date(p_start_date,'DD-MM-YYYY HH24:MI');
l_due_date := to_date(p_due_date, 'DD-MM-YYYY HH24:MI');
--optimistic locking
for c1 in (select null
from doclib_tasks
where task_id = p_task_id
and updated_on > l_retrieved ) loop
raise_application_error(-20001,'This task has been updated since you retrieved the data. Refresh and try again.');
end loop;
update doclib_tasks
set assigned_to = p_assigned,
priority_id = p_priority,
status_id = p_status,
pct_complete = p_pct_complete,
name = p_title,
description = p_description,
start_date = l_start_date,
due_date = l_due_date,
doc_id = p_doc_id
where task_id = p_task_id;
do_alerts('T',p_task_id,null);
commit;
exception when others then
raise_application_error(-20001,'Exception encountered updating task: '||sqlerrm);
end update_task;
procedure update_link (
p_link_id in varchar2,
p_user_name in varchar2,
p_name in varchar2,
p_url in varchar2,
p_retrieved in varchar2
is
l_retrieved date;
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to update links.');
end if;
l_retrieved := to_date(p_retrieved,'DD-MM-YYYY HH24:MI:SS');
--optimistic locking
for c1 in (select null
from doclib_links
where link_id = p_link_id
and updated_on > l_retrieved ) loop
raise_application_error(-20001,'This link has been updated since you retrieved the data. Refresh and try again.');
end loop;
update doclib_links
set name = p_name,
url = p_url
where link_id = p_link_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered updating link: '||sqlerrm);
end update_link;
procedure update_announcement (
p_an_id in varchar2,
p_user_name in varchar2,
p_title in varchar2,
p_description in varchar2,
p_expire_date in varchar2,
p_retrieved in varchar2
is
l_expire_date date;
l_retrieved date;
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to update announcements.');
end if;
l_retrieved := to_date(p_retrieved,'DD-MM-YYYY HH24:MI:SS');
l_expire_date := to_date(p_expire_date,'DD-MM-YYYY HH24:MI');
--optimistic locking
for c1 in (select null
from doclib_announcements
where an_id = p_an_id
and updated_on > l_retrieved ) loop
raise_application_error(-20001,'This task has been updated since you retrieved the data. Refresh and try again.');
end loop;
update doclib_announcements
set title = p_title,
description = p_description,
expire_date = l_expire_date
where an_id = p_an_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered updating announcement: '||sqlerrm);
end update_announcement;
procedure delete_document (
p_doc_id in varchar2,
p_user_name in varchar2,
p_delete_all in varchar2 default null
is
l_date date := sysdate;
l_checkedout_by varchar2(255);
l_chkout_lst varchar2(32000);
begin
if get_acl_id(p_user_name) < 2 then
--raise_application_error(-20001,'You are not authorized to delete documents.');
return_xml(p_doc_id,'DELETE','You are not authorized to delete documents.',null,'FAILED',p_user_name);
return;
end if;
l_checkedout_by := doc_is_checkedout_by(p_doc_id);
if l_checkedout_by is not null and upper(l_checkedout_by) != upper(p_user_name) then
--raise_application_error(-20001,'This document is currently checked out by '||l_checkedout_by);
return_xml(p_doc_id,'DELETE','This document is currently locked by '||l_checkedout_by,null,'FAILED',p_user_name);
return;
end if;
if p_delete_all = 'Y' then
update doclib_documents
set deleted_as_of = l_date
where doc_id = p_doc_id
or revision_of = p_doc_id;
else
update doclib_documents
set deleted_as_of = l_date
where doc_id = p_doc_id;
end if;
commit;
l_chkout_lst := get_checkout_list(p_user_name);
return_xml(p_doc_id,'DELETE','Document successfully deleted.',l_chkout_lst,'SUCCESS',p_user_name);
exception when others then
--raise_application_error(-20001,'Exception encountered deleting document: '||sqlerrm);
return_xml(p_doc_id,'DELETE','Exception encountered deleting document: '||sqlerrm,null,'FAILED',p_user_name);
end delete_document;
procedure really_delete_document (
p_user_name in varchar2,
p_doc_id in varchar2
is
begin
if get_acl_id(p_user_name) < 3 then
raise_application_error(-20001,'You are not authorized to really delete documents.');
end if;
delete
from doclib_documents
where doc_id = p_doc_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered deleting document: '||sqlerrm);
end really_delete_document;
procedure delete_member (
p_user_name in varchar2,
p_user_id in varchar2
is
begin
if get_acl_id(p_user_name) < 3 then
raise_application_error(-20001,'You are not authorized to delete members.');
end if;
delete
from doclib_members
where user_id = p_user_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered deleting member: '||sqlerrm);
end delete_member;
procedure delete_task (
p_user_name in varchar2,
p_task_id in varchar2
is
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to delete tasks.');
end if;
delete
from doclib_tasks
where task_id = p_task_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered deleting task: '||sqlerrm);
end delete_task;
procedure delete_announcement (
p_user_name in varchar2,
p_an_id in varchar2
is
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to delete announcements.');
end if;
delete
from doclib_announcements
where an_id = p_an_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered deleting announcement: '||sqlerrm);
end delete_announcement;
procedure delete_link (
p_user_name in varchar2,
p_link_id in varchar2
is
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to delete links.');
end if;
delete
from doclib_links
where link_id = p_link_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered deleting link: '||sqlerrm);
end delete_link;
procedure make_doc_current (
p_user_name in varchar2,
p_name in varchar2,
p_doc_id in varchar2
is
l_name varchar2(255);
l_checkedout_by varchar2(255);
l_curr_doc_id number;
begin
if get_acl_id(p_user_name) < 2 then
raise_application_error(-20001,'You are not authorized to make this document current.');
end if;
l_checkedout_by := doc_is_checkedout_by(p_doc_id);
if l_checkedout_by is not null and upper(l_checkedout_by) != upper(p_user_name) then
raise_application_error(-20001,'This document is currently locked by '||l_checkedout_by);
end if;
for c1 in (select doc_id
from doclib_documents
where deleted_as_of = to_date('22-04-2004','DD-MM-YYYY')
and revision_of = 0
and name = p_name ) loop
l_curr_doc_id := c1.doc_id;
exit; -- this should only get one row, but just in case
end loop;
l_checkedout_by := doc_is_checkedout_by(l_curr_doc_id);
if l_checkedout_by is not null and upper(l_checkedout_by) != upper(p_user_name) then
raise_application_error(-20001,'This document is currently locked by '||l_checkedout_by);
end if;
update doclib_documents
set revision_of = p_doc_id,
checkedout_by = null --Revisions can't be locked
where name = p_name
and doc_id != p_doc_id;
update doclib_documents
set revision_of = 0,
checkedout_by = l_checkedout_by --In case original document was locked by p_user_name
where doc_id = p_doc_id;
--do alerts
do_alerts('D',l_curr_doc_id, p_doc_id);
commit;
exception when others then
raise_application_error(-20001,'Exception encountered making document current: '||sqlerrm);
end make_doc_current;
procedure undelete_document (
p_user_name in varchar2,
p_doc_id in varchar2
is
begin
if get_acl_id(p_user_name) < 3 then
raise_application_error(-20001,'You are not authorized to undelete a document.');
end if;
update doclib_documents
set deleted_as_of = to_date('22-04-2004','DD-MM-YYYY')
where doc_id = p_doc_id;
commit;
exception when others then
raise_application_error(-20001,'Exception encountered undeleting document: '||sqlerrm);
end undelete_document;
procedure send_invitation (
p_user_name in varchar2,
p_url in varchar2,
p_email in varchar2,
p_acl_id in varchar2,
p_subject in varchar2,
p_body in varchar2
is
l_body clob;
l_role_name varchar2(30);
l_from varchar2(255);
begin
for c1 in (select name
from doclib_roles
where role_id = p_acl_id ) loop
l_role_name := c1.name;
end loop;
for c1 in (select email_address
from doclib_members
where user_name = p_user_name ) loop
l_from := c1.email_address;
end loop;
l_body := g_html_email_header||chr(13)||'<p />'||p_body||chr(13);
l_body := l_body ||chr(13)||'<p />'||p_user_name||' has granted you access to '||p_url||'.';
l_body := l_body ||chr(13)||' Click the link to view the site. You have been granted access to the workspace with ';
l_body := l_body ||chr(13)||'the role of: '||l_role_name||'.'||g_html_email_footer;
apex_mail.send(
p_to => p_email,
p_from => l_from,
p_body => to_clob(' '),
p_body_html => l_body,
p_subj => p_subject );
end send_invitation;
procedure delete_document_multi (
p_doc_ids in varchar2,
p_user_name in varchar2
is
l_date date := sysdate;
l_checkedout_by varchar2(255);
l_chkout_lst varchar2(32000);
l_vc_arr2 apex_application_global.vc_arr2;
l_doc_id number;
l_curr_doc_id number;
begin
if get_acl_id(p_user_name) < 2 then
--raise_application_error(-20001,'You are not authorized to delete documents.');
return_xml(p_doc_ids,'DELETE_MULTI','You are not authorized to delete documents.',null,'FAILED',p_user_name);
return;
end if;
l_vc_arr2 := apex_util.string_to_table(p_doc_ids,',');
for c1 in (select revision_of
from doclib_documents
where doc_id = l_vc_arr2(1) ) loop
l_curr_doc_id := c1.revision_of;
end loop;
for z in 1..l_vc_arr2.count loop
l_checkedout_by := doc_is_checkedout_by(l_vc_arr2(z));
if l_checkedout_by is not null and upper(l_checkedout_by) != upper(p_user_name) then
--raise_application_error(-20001,'This document is currently checked out by '||l_checkedout_by);
return_xml(l_vc_arr2(z),'DELETE_MULTI','This document is currently locked by '||l_checkedout_by,null,'FAILED',p_user_name);
return;
end if;
update doclib_documents
set deleted_as_of = l_date
where doc_id = l_vc_arr2(z);
end loop;
commit;
l_chkout_lst := get_checkout_list(p_user_name);
return_xml(l_curr_doc_id,'DELETE_MULTI','Documents successfully deleted',l_chkout_lst,'SUCCESS',p_user_name);
exception when others then
--raise_application_error(-20001,'Exception encountered deleting document: '||sqlerrm);
return_xml(p_doc_ids,'DELETE_MULTI','Exception encountered deleting documents '||sqlerrm,null,'FAILED',p_user_name);
end delete_document_multi;
procedure rollback_document (
p_doc_id in varchar2,
p_user_name in varchar2
is
l_date date := sysdate;
l_checkedout_by varchar2(255);
l_chkout_lst varchar2(32000);
begin
if get_acl_id(p_user_name) < 2 then
return_xml(p_doc_id,'ROLLBACK','You are not authorized to rollback documents.',null,'FAILED',p_user_name);
return;
end if;
l_checkedout_by := doc_is_checkedout_by(p_doc_id);
--can be used as optimistic locking
if l_checkedout_by is not null and upper(l_checkedout_by) != upper(p_user_name) then
return_xml(p_doc_id,'ROLLBACK','This document is currently locked by '||l_checkedout_by,null,'FAILED',p_user_name);
return;
end if;
update doclib_documents
set deleted_as_of = l_date
where doc_id = p_doc_id;
for c1 in (select doc_id, name
from doclib_documents
where deleted_as_of = to_date('22-04-2004','DD-MM-YYYY')
and revision_of = p_doc_id
and version_no = (select max(version_no)
from doclib_documents
where deleted_as_of = to_date('22-04-2004','DD-MM-YYYY')
and revision_of = p_doc_id) ) loop
doclib.make_doc_current(
p_user_name => p_user_name,
p_name => c1.name,
p_doc_id => c1.doc_id );
apex_util.set_session_state('DOC_ID',c1.doc_id);
end loop;
commit;
l_chkout_lst := get_checkout_list(p_user_name);
return_xml(p_doc_id,'ROLLBACK','Document successfully rolled back',l_chkout_lst,'SUCCESS',p_user_name);
exception when others then
return_xml(p_doc_id,'ROLLBACK','Exception encountered rolling back document: '||sqlerrm,null,'FAILED',p_user_name);
end rollback_document;
/* Begin CBackstrom procedures and functions */
PROCEDURE return_all_docs(p_doc_type IN VARCHAR2) IS
l_checkedout_by VARCHAR2(4000);
l_attr1 VARCHAR2(4000);
l_attr2 VARCHAR2(4000);
l_attr3 VARCHAR2(4000);
BEGIN
l_checkedout_by := v('P9_MEMBERS');
l_attr1 := v('P9_ATTR1');
l_attr2 := v('P9_ATTR2');
l_attr3 := v('P9_ATTR3');
IF(p_doc_type = 'XML') THEN
owa_util.mime_header('text/xml', FALSE);
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
END IF;
htp.p('<div id="filelist">');
--htp.p('<div style="width:150px;"></div>');
IF v('P9_DESC') IS NOT NULL THEN
FOR c1 IN
(SELECT score(1) sc,
name,
doc_id,
checkedout_by,
'<img src="' || decode(mime_type, 'application/vnd.oasis.opendocument.text', '' || v('APP_IMAGES') || 'icodt.GIF', 'application/vnd.ms-excel', '' || v('APP_IMAGES') || 'ICXLS.GIF', 'application/msword', '' || v('APP_IMAGES') || 'ICDOC.GIF', 'application/pdf', '' || v('APP_IMAGES') || 'icpdf.GIF', 'application/vnd.ms-powerpoint', '' || v('APP_IMAGES') || 'ICPPT.GIF', 'application/vnd.oasis.opendocument.spreadsheet', '' || v('APP_IMAGES') || 'iccalc.GIF', 'application/vnd.oasis.opendocument.presentation', '' || v('APP_IMAGES') || 'icodp.GIF', 'text/plain', '' || v('APP_IMAGES') || 'ICTXT.GIF', 'application/x-zip-compressed', '' || v('APP_IMAGES') || 'ICZIP.GIF', '' || v('APP_IMAGES') || 'ICGEN.GIF') || '" width="16" height="16" border="0" />' img
FROM doclib_documents
WHERE deleted_as_of = to_date('22-04-2004', 'DD-MM-YYYY')
AND revision_of = 0
AND(checkedout_by = l_checkedout_by OR l_checkedout_by = '0')
AND(attr1 = l_attr1 OR l_attr1 = '0')
AND(attr2 = l_attr2 OR l_attr2 = '0')
AND(attr3 = l_attr3 OR l_attr3 = '0')
AND contains(contents, doclib.parse_search_string(v('P9_DESC')), 1) > 0
ORDER BY sc DESC)
LOOP
IF c1.checkedout_by IS NULL THEN
htp.p('<a href="javascript:void(0) onclick="GetDoc(this,''' || c1.doc_id || ''')" id="' || c1.doc_id || '">' || c1.img || ' (' || c1.sc || ') '|| c1.name || '</a>');
ELSIF c1.checkedout_by = apex_application.g_user THEN
htp.p('<a href="javascript:void(0) onclick="GetDoc(this,''' || c1.doc_id || ''')" id="' || c1.doc_id || '" class="checkedoutme">' || c1.img || ' (' || c1.sc || ') ' || c1.name || '(' || c1.sc || ')</a>');
ELSE
htp.p('<a href="javascript:void(0) onclick="GetDoc(this,''' || c1.doc_id || ''')" id="' || c1.doc_id || '" class="checkedout">' || c1.img || ' (' || c1.sc || ') '|| c1.name || '(' || c1.sc || ')</a>');
END IF;
END LOOP;
ELSE
FOR c1 IN
(SELECT name,
doc_id,
checkedout_by,
'<img src="' ||decode(mime_type,'application/vnd.oasis.opendocument.text', ''|| v('APP_IMAGES')||
'icodt.GIF','application/vnd.ms-excel',''||v('APP_IMAGES')||'ICXLS.GIF','application/msword',''||
v('APP_IMAGES')||'ICDOC.GIF','application/pdf',''||v('APP_IMAGES')||'icpdf.GIF','application/vnd.ms-powerpoint',''||
v('APP_IMAGES')||'ICPPT.GIF','application/vnd.oasis.opendocument.spreadsheet',''||v('APP_IMAGES')||
'iccalc.GIF','application/vnd.oasis.opendocument.presentation',''||v('APP_IMAGES')||'icodp.GIF','text/plain',''||
v('APP_IMAGES')||'ICTXT.GIF','application/x-zip-compressed',''||v('APP_IMAGES')||'ICZIP.GIF',''||v('APP_IMAGES')||
'ICGEN.GIF')||'" width="16" height="16" border="0" />' img
FROM doclib_documents
WHERE deleted_as_of = to_date('22-04-2004', 'DD-MM-YYYY')
AND revision_of = 0
AND(checkedout_by = l_checkedout_by OR l_checkedout_by = '0')
AND(attr1 = l_attr1 OR l_attr1 = '0')
AND(attr2 = l_attr2 OR l_attr2 = '0')
AND(attr3 = l_attr3 OR l_attr3 = '0')
order by name, updated_on desc)
LOOP
IF c1.checkedout_by IS NULL THEN
htp.p('<a href="javascript:void(0) onclick="GetDoc(this,''' || c1.doc_id || ''')" id="' || c1.doc_id || '">' || c1.img || ' ' || c1.name || '</a>');
ELSIF c1.checkedout_by = apex_application.g_user THEN
htp.p('<a href="javascript:void(0) onclick="GetDoc(this,''' || c1.doc_id || ''')" id="' || c1.doc_id || '" class="checkedoutme">' || c1.img || ' ' || c1.name || '</a>');
ELSE
htp.p('<a href="javascript:void(0) onclick="GetDoc(this,''' || c1.doc_id || ''')" id="' || c1.doc_id || '" class="checkedout">' || c1.img || ' ' || c1.name || '</a>');
END if;
END LOOP;
END IF;
htp.p('</div>');
END;
PROCEDURE doc_versions(p_doc_id IN VARCHAR2) IS
l_checkedout_by VARCHAR2(4000);
l_doc_name VARCHAR2(4000);
BEGIN
htp.p('<table id="doc_versions" cellpadding="0" border="0" cellspacing="0">');
htp.p('<tr>');
htp.p('<th><input type="checkbox" onclick="html_CheckAll(''doc_versions'',this.checked)" /></th>');
htp.p('<th>Version</th>');
htp.p('<th>Created</th>');
htp.p('<th>Created By</th>');
htp.p('</tr>');
FOR c2 IN
(SELECT doc_id,
decode(revision_of,0,' ',apex_item.checkbox(1,doc_id)) a,
name,
version_no,
created_on,
created_by
FROM doclib_documents
WHERE deleted_as_of = to_date('22-04-2004', 'DD-MM-YYYY')
AND(doc_id = p_doc_id OR revision_of = p_doc_id)
ORDER BY version_no DESC)
LOOP
htp.p('<tr>');
htp.p('<td>' || c2.a || '</td>');
htp.p('<td><a id="filehref" href="apex_util.count_click?p_url=' || v('OWNER') || '.get_doc?p=' || c2.doc_id || '&p_cat=DOCS&p_id=' || c2.doc_id || '&p_user=' || v('APP_USER') || '&p_workspace=' || apex_custom_auth.get_security_group_id || '">' || c2.version_no || '</a></td>');
htp.p('<td>' || to_char(c2.created_on, 'MM/DD/YYYY HH:MI AM') || '</td>');
htp.p('<td>' || c2.created_by || '</td>');
htp.p('</tr>');
END LOOP;
htp.p('</table>');
END;
FUNCTION doc_is_updated_by(p_doc_id IN VARCHAR2) RETURN VARCHAR2 IS
BEGIN
FOR c1 IN
(SELECT updated_by
FROM doclib_documents
WHERE doc_id = p_doc_id)
LOOP
RETURN c1.updated_by;
END LOOP;
RETURN NULL;
END doc_is_updated_by;
FUNCTION doc_updated_date(p_doc_id IN VARCHAR2) RETURN VARCHAR2 IS
BEGIN
FOR c1 IN
(SELECT to_char(updated_on, 'MM/DD/YYYY HH:MI AM') updated_on
FROM doclib_documents
WHERE doc_id = p_doc_id)
LOOP
RETURN c1.updated_on;
END LOOP;
RETURN NULL;
END doc_updated_date;
FUNCTION doc_created_date(p_doc_id IN VARCHAR2) RETURN VARCHAR2 IS
BEGIN
FOR c1 IN
(SELECT to_char(created_on, 'MM/DD/YYYY HH:MI AM') created
FROM doclib_documents
WHERE doc_id = p_doc_id)
LOOP
RETURN c1.created;
END LOOP;
RETURN NULL;
END doc_created_date;
FUNCTION doc_linked_image(p_doc_id IN VARCHAR2) RETURN VARCHAR2 IS l_image_link VARCHAR2(4000);
l_image_prefix VARCHAR2(4000);
BEGIN
l_image_link := '<a id="filehref" href="apex_util.count_click?p_url=' || v('OWNER') || '.get_doc?p=' || p_doc_id || '&p_cat=DOCS&p_id=' || p_doc_id || '&p_user=' || v('APP_USER') || '&p_workspace=' || apex_custom_auth.get_security_group_id || '">';
l_image_prefix := v('APP_IMAGES');
FOR c1 IN
(SELECT mime_type,
l_image_link || '<img src="' || decode(mime_type, 'application/vnd.oasis.opendocument.text', l_image_prefix || 'icodt.GIF', 'application/vnd.ms-excel', l_image_prefix || 'ICXLS.GIF', 'application/msword', l_image_prefix || 'ICDOC.GIF', 'application/pdf', l_image_prefix || 'icpdf.GIF', 'application/vnd.ms-powerpoint', l_image_prefix || 'ICPPT.GIF', 'application/vnd.oasis.opendocument.spreadsheet', l_image_prefix || 'iccalc.GIF', 'application/vnd.oasis.opendocument.presentation', l_image_prefix || 'icodp.GIF', 'text/plain', l_image_prefix || 'ICTXT.GIF', 'application/x-zip-compressed', l_image_prefix || 'ICZIP.GIF', l_image_prefix || 'ICGEN.GIF') || '" width="16" height="16" border="0" /></a>' image
FROM doclib_documents
WHERE doc_id = p_doc_id)
LOOP
RETURN c1.image;
END LOOP;
RETURN NULL;
END doc_linked_image;
FUNCTION doc_file_type(p_doc_id IN VARCHAR2) RETURN VARCHAR2 IS l_file_type VARCHAR2(4000);
BEGIN
FOR c1 IN
(SELECT mime_type
FROM doclib_documents
WHERE doc_id = p_doc_id)
LOOP
RETURN c1.mime_type;
END LOOP;
RETURN NULL;
END doc_file_type;
PROCEDURE doc_attribute_tab(p_doc_id IN VARCHAR2, p_user_name IN VARCHAR2) IS
BEGIN
for c1 in (select attr1, attr2, attr3, description
from doclib_documents
where doc_id = p_doc_id ) loop
htp.p('<table id="doc_attribute" cellpadding="0" cellspacing="0" border="0">');
htp.p('<tr><th>'||v('DOC_WORKSPACE_LBL1')||'</th><td>'||APEX_ITEM.SELECT_LIST_FROM_LOV(1,c1.attr1,'ATTR1',null,'NO',null,null,'ATTR1')||'</td></tr>');
htp.p('<tr><th>'||v('DOC_WORKSPACE_LBL2')||'</th><td>'||APEX_ITEM.SELECT_LIST_FROM_LOV(2,c1.attr2,'ATTR2',null,'NO',null,null,'ATTR2')||'</td></tr>');
htp.p('<tr><th>'||v('DOC_WORKSPACE_LBL3')||'</th><td>'||APEX_ITEM.SELECT_LIST_FROM_LOV(3,c1.attr3,'ATTR3',null,'NO',null,null,'ATTR3')||'</td></tr>');
htp.p('<tr><td colspan="2"><b>Description</b>
<textarea id="desc">' || c1.description || '</textarea></td></tr>');
htp.p('<tr><td colspan="2"><input type="button" onclick="doc_attribute_update()" value="Update Attributes" /></td></tr>');
htp.p('</table>');
end loop;
END;
PROCEDURE doc_detail(p_doc_id IN VARCHAR2, p_user_name IN VARCHAR2) IS
l_checkedout_by VARCHAR2(4000);
l_updated_by VARCHAR2(4000);
l_created_date VARCHAR2(4000);
l_updated_date VARCHAR2(4000);
l_mime_type VARCHAR2(4000);
l_doc_name VARCHAR2(4000);
l_acl_id VARCHAR2(4000);
BEGIN
l_checkedout_by := doclib.doc_is_checkedout_by(p_doc_id);
l_doc_name := doclib.get_doc_name(p_doc_id);
l_acl_id := doclib.get_acl_id(p_user_name);
l_updated_by := doc_is_updated_by(p_doc_id);
l_mime_type := doc_file_type(p_doc_id);
l_updated_date := doc_updated_date(p_doc_id);
l_created_date := doc_created_date(p_doc_id);
apex_util.set_session_state('DOC_ID', p_doc_id);
apex_util.set_session_state('DOC_NAME', l_doc_name);
htp.p('<div id="doc_detail">');
htp.p('<div id="doc_header">');
htp.p('<div id="doc_name"><a href="apex_util.count_click?p_url=' || v('OWNER') || '.get_doc?p=' || p_doc_id || '&p_cat=DOCS&p_id=' || p_doc_id || '&p_user=' || v('APP_USER') || '&p_workspace=' || apex_custom_auth.get_security_group_id || ">' || l_doc_name || '</a></div>');
htp.p('<table><tr><td valign="top">');
htp.p('<table>');
htp.p('<tr><th>View :</th><td>' || doc_linked_image(p_doc_id) || '</td></tr>');
htp.p('<tr><th>Locked By :</th><td id="checkedoutby">' || l_checkedout_by || '</td></tr>');
htp.p('<tr><th>Modified By :</th><td id="modifiedby">' || l_updated_by || '</td></tr>');
htp.p('</table>');
htp.p('</td><td width="100">
<td><td valign="top">');
htp.p('<table>');
htp.p('<tr><th>Updated Date :</th><td id="updateddate">' || l_updated_date || '</td></tr>');
htp.p('<tr><th>Created Date :</th><td id="createddate">' || l_created_date || '</td></tr>');
htp.p('<tr><th>Send Link :</th><td id="sendlink"><a href="mailto:' || doclib.get_member_email(p_user_name) || '?subject=' || l_doc_name || '&body=' || v('BASE_URL') || '/f?p=' || v('APP_ID') || ':2:::::P2_DOC_ID:' || p_doc_id || ">Click Here</a></td></tr>');
htp.p('</table>');
htp.p('</td></tr></table>');
htp.p('</div>');
htp.p('<div id="doc_actions">Actions : ');
IF l_acl_id > 1 THEN
IF l_checkedout_by IS NULL THEN
htp.p('<a href="javascript:doc_Action(this,''' || p_doc_id || ''',''CHECKOUT'') id="checkout_button">Lock</a>');
ELSIF l_checkedout_by = p_user_name OR l_acl_id > 2 THEN
htp.p('<a href="javascript:doc_Action(this,''' || p_doc_id || ''',''UNCHECKOUT'') id="checkout_button">Unlock</a>');
END IF;
IF l_checkedout_by IS NULL OR l_checkedout_by = p_user_name THEN
htp.p('Add Version');
htp.p('Delete');
END IF;
-- htp.p('<a href="f?p=&APP_ID.:5:&SESSION.::::P5_NAME,P5_DOC_ID:' || l_doc_name || ',' || p_doc_id || ' id="versions_button">Versions</a>');
END IF;
htp.p('<a href="apex_util.count_click?p_url=' || v('OWNER') || '.get_doc?p=' || p_doc_id || '&p_cat=DOCS&p_id=' || p_doc_id || '&p_user=' || p_user_name || '&p_workspace=' || apex_custom_auth.get_security_group_id || ">View</a>');
htp.p('<a href="f?p=' || v('APP_ID') || ':95:' || v('SESSION') || '::::P95_ALERT_TYPE,P95_ALERT_INTERVAL,P95_DOC_ID:D,,' || v('DOC_ID') || ">Alert Me</a>');
htp.p('</div>');
htp.p('<div id="action_message"></div>');
htp.p('<div id="doc_tabs">');
htp.p('<div id="doc_tabsbuttons">Versions<a id="tab3" href="javascript:void(0)" onclick="doc_Comments_Tab(''tab3'')">Comments</a>');
if doclib.GET_ACL_ID(v('APP_USER')) > 1 then
htp.p('Attributes');
end if;
htp.p('</div>');
htp.p('<div id="doc_tabsbody">');
htp.p('<div id="tab1_content">');
doc_versions(p_doc_id);
IF (l_checkedout_by IS NULL OR l_checkedout_by = p_user_name) and get_acl_id(v('APP_USER')) > 1 THEN
htp.p('<hr /><input type="button" value="Delete All Versions" onclick="doc_Action(this,''' || p_doc_id || ''',''DELETE'')" />');
if doc_has_revisions(p_doc_id) > 0 then
htp.p('<input type="button" value="Delete Checked Versions" onclick="doc_Action(this,''' || p_doc_id || ''',''DELETE_CHECKED'')" />');
htp.p('<input type="button" value="Delete Current Version (Rollback Version)" onclick="doc_Action(this,''' || p_doc_id || ''',''ROLLBACK'')" />');
end if;
END IF;
htp.p('</div>');
htp.p('<div id="tab2_content" style="display:none;">');
doc_attribute_tab(p_doc_id, p_user_name);
htp.p('</div>');
htp.p('<div id="tab3_content" style="display:none;"><div id="doc_comments">
</div></div>');
htp.p('</div>');
htp.p('</div>');
htp.p('</div>');
END;
PROCEDURE doc_comments(p_doc_id IN VARCHAR2) IS
BEGIN
htp.p('<div>');
htp.p('<table id="doc_versions" cellpadding="0" border="0" cellspacing="0">');
htp.p('<tr><th>Member</th><th>Date</th><th>Comment</th></tr>');
FOR c2 IN
(SELECT description,
created_by,
created_on
FROM doclib_documents
WHERE(doc_id = p_doc_id OR revision_of = p_doc_id)
AND(description IS NOT NULL OR description != '')
AND deleted_as_of = to_date('22-04-2004','DD-MM-YYYY')
ORDER BY created_on DESC)
LOOP
htp.p('<tr>' || '<td>' || c2.created_by || '</td><td>' || to_char(c2.created_on, 'MM/DD/YYYY HH:MI AM') || '</td><td>' || c2.description || '</td></tr>');
END LOOP;
htp.p('</table>');
htp.p('</div>');
END;
/* End CBackstrom procedures and functions */
end doclib;
Error at line 1230: PL/SQL: SQL Statement ignored
sync_index.sql
declare
l_job_id binary_integer;
begin
for c1 in (select job
from user_jobs
where what = 'ctx_ddl.sync_index(''doclib_docs_idx2'', ''2M'');' ) loop
dbms_job.remove(c1.job);
end loop;
dbms_job.submit(
job => l_job_id,
what => 'ctx_ddl.sync_index(''doclib_docs_idx2'', ''2M'');',
next_date => sysdate + 15/1440,
interval => 'sysdate + 15/1440');
end;
ORA-06550: line 1, column 93:
PLS-00201: identifier 'CTX_DDL.SYNC_INDEX' must be declared
ORA-06550: line 1, column 93:
PL/SQL: Statement ignored
I would appreciate any suggestions.
Thank you for your time.
DanielD -
UNABLE TO INSTALL THE PACKAGED APPLICATIONS (DOCUMENT LIBRARY)
Created new workspace, and downloaded and tried to install Document Library
from http://www.oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html#DOC_LIB .
Installed application just fine, but when Apex attempted to install the
supporting objects, it failed. It hangs for a while and then goes to “page cannot be displayed page” When I click on refresh, and I get an error.
When browse the tables under SQL Workshop, I noticed that none of the objects have been installed for that App.
When i try to run the application, i get the following error.
ORA-06550: line 3, column 19: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 1, column 17: PL/SQL: SQL Statement ignored ORA-06550: line 5, column 26: PLS-00364: loop index variable 'C1' use is invalid ORA-06550: line 5, column 3: PL/SQL: Statement ignored ORA-06550: line 6, column 26: PLS-00364: loop index variable 'C1' use is invalid ORA-06550: line 6, column 3: PL/SQL: Statement ignored ORA-06550: line 7, column 26: PLS-00364: loop index variable 'C1' use is invalid ORA-06550: line 7,
Error setting workspace attributes.
Did anyone installed this APP? if so, was it successful?Could be possible that Samsung Galaxy Fit Processor doesn't match with the system requirements of AIR. It should be ARMv7
http://www.adobe.com/products/air/systemreqs/MOBILE SYSTEM REQUIREMENTS
Android devices
VGA: Dedicated Cortex A8 (ARMv7) 550MHz App Processor with Neon for A8 only; Hardware Vector FPU
WVGA: Dedicated Cortex A8 (ARMv7) 800MHz App Processor; Hardware Vector FPU
Google Android™ 2.2 or later
-Pahup -
Document Library - how to add more categories?
Hi,
Im using APEX 3.2 on oracle XE and just installed the document library application. we would like to have the following functionalities:
1. add more categories (custom attributes etc. and more filter in the document borwser)
2. control who gets to view a particular document being uploaded.
3. add workflow options (eg. before a document is locked, a reviewer needs to check if it is the right document)
any help will be highly appreciated.you've sat for 11 days waiting for this reply?? didn't even bother trying any other means, like a search engine, perhaps? or the documentation? nah, of course not. best leave it to someone else to solve your problem. well, if you can afford to just sit and wait for 11 days without trying anything else, it's obviously not a big deal, so wait another 11 days and see what happens
tsk. also, the CLASSPATH environment variable is best avoided really -
Packaged App - Document Library - New user password?
How do you set the password for a new user on the Document Library packaged app. The documentation suggests that by default it uses 'Standard application express authentication' which can then be changed. In which case the user admin function in the app does not work in its default state and would need to be removed if the user wants to use 'Standard application express authentication' (or does it?)
Which leads me to another question:
Is it possible to manage application express users from an application express app in Apex 3.0?
Thanks
SimonSimon:
For a new user, you also need to create them as a normal Application Express authenticated user. To do that, click the Manage Application Express Users link under Administration from the Application Expres home page.
The only thing the Document Library handles is authorization (who can do what). Authentication (who the heck are you) is determined by the application setting, which by default is standard Application Express authentication. So all you are doing in the Document Library on the user administration page, is defining who is a reader, contributor, or administrator. You are not actually creating users, you are just defining the rights for existing users.
Regarding your second question, you can use the APEX_UTIL API to handle user management within your application. See:
http://download-west.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/api.htm#CHDBDCIE
Specifically, CREATE_USER Procedure, EDIT_USER Procedure, CHANGE_CURRENT_USER_PW Procedure, etc.
Regards,
Jason -
First off...great forum, it's saved me numerous times in the past. Search didn't help me out this time around.
I've been using the packaged app Document Library v0.92 on Apex 3.01.00.08. Recently I expanded usage of the doc lib to other users and noticed some strange behavior in the versioning functionality. Whenever a new version of an existing document is uploaded the user under "modified by" is overwritten for all previous versions. I cannot verify this ever worked. I downloaded the app again and reinstalled into a different schema with the same result. Anyone else notice this?
Thanks
MikeThank you for the feedback. I'm going to look at this more myself but what I ended up doing was modifying the report sql on page 5 to select the user from the created_by column in doclib_documents instead of the modified_by column. The created_by column gets updated with the user name of the modifying user...essentially this is what should be happening to the modified_by column. Is the created_by column supposed to store the user name that originally uploaded the document and the modified_by column store the user name that added a new version? At this point I'm trying to understand the need for both columns... In my deployment I don't think I need to know who the originator of the document is if that's the intended use for the created_by column. Still playing with it but I'll probably have to modify page 1 and 9 as well. Seem like it should work.... Any holes in my logic here?
Thanks again -
Document Library - "Hover" list no longer working
Hi!
Years ago, I downloaded the Document Library packaged app from OTN. I then made changes to it to meet our needs. It's been running fine for years.
I have just copied my Apex DB to a new server. And now when I click on the Document Name (to get the list - Add Version, Lock, etc)...It doesn't highlight, and no list appears!
My problem is I don't even know how that functionality is coded to try to debug it.
Does anybody have any ideas on why this would suddenly stop working, or at least where on earth I can start debugging it?
Please help!! The app is basically useless without this functionality.
Thanks!!
Jodie
Edited by: Jodie on Jun 1, 2012 1:46 PM
Edited by: Jodie on Jun 1, 2012 1:47 PM
Edited by: Jodie on Jun 1, 2012 1:49 PMDownload the all packaged apps from here http://www.oracle.com/technetwork/cn/developer-tools/apex/packaged-apps-087541-zhs.html
Make sure you use Google chrome to translate, because it is in Chinese -
Using Designer to get Document ID in Document Library
I am creating an approval workflow on a document library that auto starts on submitting a document.
What I want to do, besides sending the user a link to view the document, is to actually provide a link to the URL that is used to generated the popup with approval options. I do not need a popup. When you paste the URL popup in the address bar, you
get the page with the correct info.
Here's the URL:
http://.../_Layouts/listform.aspx?PageType=4&ListId={...}&ID=22
The number 22 is what I am trying to get.
In Designer, when i do a look up, I cannot seem to get the ID of the document in the list view.Hi Ogrehulk,
Is the URL the related document in the approval task?
Do you want to put the URL in the email when user gets the task notification?
If yes, we can get the ID of the related document in the Start Approval Process step.
Click Approval in the Start Approval Process step.
Click Change the behavior of a single task under Customization.
Navigate to the step Email task notification to Current Task:Assigned To in When a Task is Pending.
Click Current Task:Assigned To.
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
Error while creating a new report data source in Sharepoint Document library
I installed SSRS(sql server 2012 SP1) in my sharepoint 2013 farm(single server installation).
I have installed SSRS addin for report also.
I created a document library and included the report data source content type, report builder report and report builder model content types. On click of any of these content types i get the below error.
"new Document requires a Microsoft SharePoint Foundation-compatible application and web browser. To add document to document library, click on the 'Upload' button."
I am using windows 7 64-bit operation system with Google chrome and IE 8 64 bit.
Any help would be appreciated.Rakesh, is this an SSRS question?
This doesn't look like Power View.
Thanks!
Ed Price, Azure & Power BI Customer Program Manager (Blog,
Small Basic,
Wiki Ninjas,
Wiki)
Answer an interesting question?
Create a wiki article about it! -
Looking for help with PowerShell script to delete folders in a Document Library
I'd like to create a PowerShell script to delete old folders in a Document library that are over 30 days old. Has anyone created something like this?
Orange County District AttorneyHello Sid:
I am trying to do the same and Iam running the script to delete the subfolders inside a folder but I have some errors.
Could you please take a look?
_______Script________
$web = Get-SPWeb -Identity https://myportal.mydomain.com
$list = $web.GetList("ar_mailingactivity")
$query = New-Object Microsoft.SharePoint.SPQuery
$camlQuery = '<Where><And><Eq><FieldRef Name="ContentType" /><Value Type="Computed">Folder</Value></Eq><Leq><FieldRef Name="Created" /><Value Type="DateTime"><Today OffsetDays="-30" /></Value></Leq></And></Where>'
$query.Query = $camlQuery
$items = $list.GetItems($query)
for ($intIndex = $items.Count - 1; $intIndex -gt -1; $intIndex--)
$items.Delete($intIndex);
________Errors_______
Unable to index into an object of type System.Management.Automation.PSMethod.
At C:\Script.ps1:2 char:22
+ $list =$webGetList <<<< "ar_mailingactivity"]
+ CategoryInfo
:InvalidOperation: (ar_mailingactivity:String) [], RuntimeException
+ FullyQualifiedErrorID
:CannotIndex
You cannot call a method on a null-valued expression.
At c:\Script.ps1:6 char:24
+ $items = $list.GetItems <<<< ($query)
+ CategoryInfo
:InvalidOperation: (GetItems:String) [], RuntimeException
+ FullyQualifiedErrorID
:InvokeMethodOnNull -
How to read excel file in document library and store excel content in sql table
Hello,
Can anyone help me how to read the excel file present in document library and store the content inside excel into sql table?
Please let me know the ways to acheive this. Feel free to give your suggestions.
Thanks,
Cool DeveloperHi!
this code i have written becuase i donot find any soltions on net for this , u can try with this . :)
System.Data.OleDb.
OleDbConnection ExcelConnection = null;
FileMode fileMode;
string filePath = ConfigurationManager.AppSettings["TempLoaction"] + "\\" + fileName;
using (SPSite _site = new SPSite(SPContext.Current.Web.Url))
using (SPWeb _web = _site.OpenWeb())
string docLibrary = ConfigurationManager.AppSettings["DocumentLibrary"];
SPFile _file = _web.GetFile("/" + docLibrary + "/" + fileName);
fileMode =
FileMode.Create;
byte[] byteArray = _file.OpenBinary();
MemoryStream dataStream = new MemoryStream(byteArray);
Stream stream = dataStream;
using (FileStream fs = File.Open(filePath, fileMode))
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) != 0)
fs.Write(buffer, 0, bytesRead);
fs.Close();
//Create the Connection String
try
string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source ='"
+ filePath + "'; Extended Properties=Excel 5.0";
//Create the connection
ExcelConnection =
new System.Data.OleDb.OleDbConnection(ConnectionString);
//create a string for the query
string ExcelQuery;
//Sheet1 is the sheet name
//create the query:
//read columns from the Excel file
ExcelQuery =
"Select * from [Sheet1$]"; // from Sheet1";
//use "Select * ... " to select the entire sheet
//create the command
System.Data.OleDb.
OleDbCommand ExcelCommand = new System.Data.OleDb.OleDbCommand(ExcelQuery, ExcelConnection);
//Open the connection
ExcelConnection.Open();
//Create a reader
System.Data.OleDb.
OleDbDataReader ExcelReader;
ExcelReader = ExcelCommand.ExecuteReader();
//For each row after the first
while (ExcelReader.Read())
thanks,
kshitij -
I have an Access 2013 Web App in my Sharepoint 2013 online website. It contains a query to report on its data (several, actually, but let's keep it simple). I want to connect an Excel spreadsheet to the query, visualise the data in pivot tables/graphs/whatever,
save the spreadsheet in a Document Library, and let other team site Sharepoint users open the spreadsheet (preferably in Excel online, but with Excel client if it has to be) and see/copy the data, refreshed with the latest information from the Access Web App.
Simple, surely!
The way I'm doing it at the moment is to create an ODC file to connect to the cloud-based Access 2013 database, save that ODC in a Data Connection Library in the SP site, and use the saved ODC file as data source in the Excel spreadsheet. This works and
successfully keeps everything 'in the cloud' but I can't get it to refresh in Excel Online, and if I open the spreadsheet in Excel Client I have to enter the database password every time to refresh it. I don't really want to issue this password to everyone
who might want to view the data. There must be a better way than this ODC method, I suspect.
Googlings on this have led down various blind alleys - Excel Services, PowerPivots, Web Parts - but I'm stuck on which to follow through. Please, someone, point me to an article/book/website that explains how to do this step-by-step in simple language..
thanks
JonathanI don't see any quick way of achieving it - at least there's no such functionality exists in SharePoint. All you can do, develop an event receiver that will update the fields in the list item once the excel file is added/updated. You can use OpenXml API
to manipulate the excel file.
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com -
Hi,
I have site with contains many document library each contains many MS Office and Pdf files. We have provided document library level access rights. While users click the file name, "Prompting the credentials while click MS office documents in document
library in SharePoint Foundation 2010".
Its annoying the user.
How could i resolve this? Its for all users.
Note: only for MS Office file. other files are opening correctly.
Kind Regards
Poomani SankaranHi,
According to your post, my understanding is that you got the promote issue when clicked the documents in the library of the SharePoint foundation server.
The issue may be caused that the Kerberos authentication is misconfigured, you can change to NTLM to check whether it works.
http://www.techrepublic.com/blog/smb-technologist/prevent-unwanted-credentials-prompts-with-sharepoint-document-libraries/
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support
Maybe you are looking for
-
Avoiding duplicate records while inserting into the table
Hi I tried the following insert statement , where i want to avoid the duplicate records while inserting itself but giving me the errror like invalid identifier, though the column exists in the table Please let me know Where i'm doing the mistake. INS
-
Samsung 4g lte wifi keeps disconnecting when computer in sleeep mode?
I just purchsed this product and whenever I put my computer to sleep within either minutes or hours the power is still on but nothing else is lit on my samsung 4glte. Is there something I should do so it is in standby for whenever I open my computer
-
NVARCHAR - NVARCHAR2 datatype mapping between sql server and oracle.
Question regarding size allocation that occurs for NVARCHAR columns in sql server to NVARCHAR2 in Oracle in the migration tool. The migration tool has converted NVARCHAR columns to be twice their size as NVARCH2 in Oracle. Example, a table whose colu
-
to get around this? It says please choose a shorter bounce time. Actually, the file is a lecture of about 120 min and i don't understand why it's exceeding 2 GB..... any suggestions are appreciated.
-
Great PDF-viewer: llpp Also, a question
I just discovered llpp in the AUR. It's a great PDF-viewer that is extremely fast and remembers where I quit the file (next time you open that pdf, it opens at the page that you left last time) If I open files with SpaceFM everything works great. But