Problem in resizable 2 matrix in own form
I want to design a form with exactly like <b>journal voucher</b>
so it has 2 matrix object (upper and below)
here's my code
Set oFormPOS = SBO_Application.Forms.Add("formPointOfSales", ft_Sizable, -11)
'// set the form properties
oFormPOS.Title = "Form Point of Sales"
oFormPOS.Left = 300
oFormPOS.Width = 520
oFormPOS.Top = 100
oFormPOS.Height = 500
oFormPOS.AutoManaged = False
Set oItem = oFormPOS.Items.Add("PMatrix1", it_MATRIX)
oItem.Left = 20
oItem.Width = 485
oItem.Top = 25
oItem.Height = 160
Set oPOS.oMatrix = oItem.Specific
Set oPOS.oColumns = oPOS.oMatrix.Columns
Set oItem = oFormPOS.Items.Add("PMatrix2", it_MATRIX)
oItem.Left = 20
oItem.Width = 485
oItem.Top = 300
oItem.Height = 170
Set oPOS.oMatrix2 = oItem.Specific
Set oPOS.oColumns2 = oPOS.oMatrix2.Columns
but when I resize down my form, <b>the matrix followed my resize and increasing the height automatically and stacking with another matrix</b>.
even though I set AutoManaged = False, it still resize automatically , and make my form
screw up
Please anyone help me to solve this problem
I want my form to exactly like journal voucher (doesn't has a problem with resize)
Thanks
Hi Rasmus Thanks for the answer
and what do you mean by catch the form resize event ?
about my code what is the use of Automanaged = false, I didn't feel any different
I thought Automanaged = false will make my matrix not resize automatically,but it didn't
if i can change my matrix not resize automatically, I think i will change my code to these code, and I hope will auto arrange the position of my matrix
Set oItem = oFormPOS.Items.Add("PMatrix1", it_MATRIX)
oItem.Left = 20
oItem.Width = 485
oItem.Top = oFormPos.Top + 10
oItem.Height = (oFormPos.height/2) - 30
Set oPOS.oMatrix = oItem.Specific
Set oPOS.oColumns = oPOS.oMatrix.Columns
Set oItem = oFormPOS.Items.Add("PMatrix2", it_MATRIX)
oItem.Left = 20
oItem.Width = 485
oItem.Top = (oFormPos.Height/2) + 10
oItem.Height = (oFormPos.Height/2) - 50
Set oPOS.oMatrix2 = oItem.Specific
Set oPOS.oColumns2 = oPOS.oMatrix2.Columns
but I don't know how to disable the resize of the matrix automatically
so Rasmus beside what is the form resize event, do you know the use of automanaged ?
Thanks
Similar Messages
-
Displaying a matrix on a Forms 6 form
Guys:
I'm trying to figure out a way to display
a matrix on a form with three fields
2 text items and 1 check box eg.
Dept
====
Emp Finance Projects Transport ...
===
John X
Tom X
Sam X
Pete X X
Any ideas???
Thanks!
AbhayHi
I had similar problem. May be my dicision will be helpfull for you.
There are table (for simplicity) sheet(emp, day, job) with the primary key(emp, day). It's needed matrix with X axis as 'emp', Y axis as 'day' (for a one month) and 'job' as the cell.
I created block SHEET_BLOCK with the items: EMP, DAY_01, DAY_02, ..., DAY_31. 'Query Data Souce Name' is:
SELECT emp FROM sheet;
EMP is the 'Database Item', but another (DAY_??) aren't 'Database Item'.
Cteated POST_QUERY trigger for populating fields DAY_??:
DECLARE
v_dest_item VARCHAR2(80);
v_rec_num NUMBER;
CURSOR c_emp_day_job IS
SELECT day, job
FROM sheet
WHERE emp = :SHEET_BLOCK.EMP
BEGIN
IF :System.Mode != 'QUERY' THEN
RETURN;
END IF;
FOR v_emp_day_job IN c_emp_day_job LOOP
v_dest_item := ':SHEET_BLOCK.DAY_' | | v_emp_day_job.day;
COPY( v_emp_day_job.job, v_dest_item );
END LOOP;
END;
Andrew. -
I filled out my own form saved it and sent through email, when I opened it what I filled out was not there, why would this be?
What software did you use to fill-in the form (Preview, perhaps) and what software did you use to open it after you emailed it?
-
Facing Problem in resizing datafile
Hi i m facing problem in resizing a datafile of size 2.5 gb, i infact import data of 2gb in this file then reorganize data in different tablespace now the used size of this datafile is 96mb , when i issue command to reduce it to 200mb it gives me error that data exist u cannot resize datafile,
tell me what should be done to resize it.
thanksHi,
You can create a working tablespace with a good size
CREATE TABLESPACE tbs_tmp
DATAFILE 'D:\Oracle\oradata\SID\file_tmp.dbf' SIZE 100M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 64K;
And move all segments from your tablespace TBS1 into this new tbs
(select segment_name,segment_type from dba_segments where tablespace_name = 'TBS1')
If indexes :
alter index owner.index_name rebuild tablespace tbs_tmp;
If table :
alter table owner.table_name move tablespace tbs_tmp;
Ensure that the tablespace TBS1 is empty
select segment_name,segment_type from dba_segments where tablespace_name = 'TBS1'
After what, if no row return, you can drop your first tablespace,
DROP TABLESPACE tbs1 INCLUDING CONTENTS CASCADE CONSTRAINTS;
recreate it with a goos size,
CREATE TABLESPACE tbs1
DATAFILE 'D:\Oracle\oradata\SID\file_tbs1.dbf' SIZE 100M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 64K;
and move all segment from tbs_tmp into this new tbs1
(select segment_name,segment_type from dba_segments where tablespace_name = 'TBS_TMP')
If indexes :
alter index owner.index_name rebuild tablespace tbs1;
If table :
alter table owner.table_name move tablespace tbs1;
Ensure that the tablespace TBS1 is empty
select segment_name,segment_type from dba_segments where tablespace_name = 'TBS_TMP'
If no row return, drop the working tablespace
DROP TABLESPACE tbs_tmp INCLUDING CONTENTS CASCADE CONSTRAINTS;
Nicolas. -
It looks like your problem is at the beggining in the form tag, specificall
Hello,
I'm having an issue with a cgi form that I created (added on to a website I created using iWeb). Basically, here's the problem: I'm not sure if I have to FTP it over to mac in order for it to work, but if someone could let me know if that's the issue, I'd appreciate it. Basically, when any client hits the submit button on my site to fill out a quote request, it DOES NOT go into my inbox. Why?
Here's the html code:
http://yourdomain.com/cgi-bin/FormNewMail.cgi
Below is a comment I received from someone who thought they knew where the problem was.
"It looks like your problem is at the beginning in the form tag, specifically
this part:
action="http://yourdomain.com/cgi-bin/FormNewMail.cgi"
When I type in that address, the correct page isn't loading, which probably
means you haven't uploaded the actual "FormNewMail" script to your cgi-bin
folder (at Webintellects).
Anyone care to tackle this one?
Thx,
JWhat exactly does iWeb support as far as html forms then?
Search this forum for "form".
http://discussions.apple.com/thread.jspa?messageID=7650084� -
UNIX: problem running an DEV & QA environment using form/report servlets
UNIX: problem running an DEV & QA environment using form/report servlets
I am trying to setup on one server an DEV and QA environment using the Forms Servlet, Forms Listener Servlet and Report Servlet.
I think I have the Forms Servlet and Forms Listener Servlet running properly. The problem is setting up the DEV and QA environment for running reports.
For example, when in DEV environment I would like to run a report from a directory specified in the REPORTS60_PATH. This doesn't seem possible.
It might be easier if I describe my configuration first:
DEV: run all forms and reports from the directory /data/release/dev
QA: run all forms and reports from the directory /data/release/qa
---DEV & QA Settings Forms Listener Servlet:
zone.properties:
# DEV
servlet.fl60dev.code=oracle.forms.servlet.ListenerServlet
servlet.fl60dev.initArgs=EnvFile=/u01/app/oracle/product/ias/6iserver/forms60/server/dev.env
# QA
servlet.fl60qa.code=oracle.forms.servlet.ListenerServlet
servlet.fl60qa.initArgs=EnvFile=/u01/app/oracle/product/ias/6iserver/forms60/server/qa.env
---DEV & QA Settings Forms Servlet:
servlet.f60servlet.code=oracle.forms.servlet.FormsServlet
--- Settings for Reports Servlet:
servlet.RWServlet.code=oracle.reports.rwcgi.RWServlet
Custom Env files since we are using Developer 6i Patch 7
dev.env and qa.env
Here I specify FORMS60_PATH and REPORTS60_PATH,
eg: DEV -> FORMS60_PATH=/data/release/dev
REPORTS60_PATH=/data/release/dev
likewise for QA ../qa
In the formsweb.cfg file i have something like:
[dev]
serverURL=/servlet/fl60dev
form=test.fmx
[qa]
serverURL=/servlet/fl60dev
form=test2.fmx
I have tested the following and they work without problems:
1. forms listener test page, eg: http://webserver:7777/servlet/fl60dev
2. running forms from the 2 environments
eg: http://webserver:7777/servlet/f60servlet?config=dev
this runs the form in the FORMS60_PATH (/data/release/dev)
Now my problems start with Reports.
When I run a report from forms (using run_report_object) it will not run any reports
as specified in the REPORTS60_PATH
Even using this url:
http://webserver:7777/servlet/RWServlet?server=rep60&report=test.rdf&destype=cache&desformat=html&
userid=scott/tiger@test9i
It NEVER seems to pickup and use the REPORTS60_PATH. I have tried nearly everything.
I have gone throught the instructions in "Integrating Oracle9iAS Reports in Oracle9iAS Forms -
White Paper"
(http://otn.oracle.com/products/forms/pdf/277282.pdf)
and Forms6i Patch 7: Oracle Forms Listner Servlet for Deployment of FOrms on the Internet
(http://otn.oracle.com/products/forms/pdf/p7listenerservlet.pdf)
plus any other documents in metalink relating to forms, or report servlets. I am
totally confused, please help.
I have tried setting the REPORTS60_PATH in the following files without success:
custom.env (as specified by initArgs=EnvFile in zone.properties)
jserv.properties
in the zone.properties I have tried to set a custom env file for the report servlet:
servlet.RWServlet.code=oracle.reports.rwcgi.RWServlet
servlet.RWServlet.initArgs=EnvFile=/u01/app/oracle/product/ias/6iserver/forms60/server/dev_rep.env
NO LUCK.
The only place that I can set the REPORTS60_PATH
is in "[6iserver home]/reports60_server" file when I start the reports server (did I even
get this right - I do have to have a reports server running don't I?)
Does this meaan I have to run multiple report servers for each of my environments?
Based on all the documentation I thought that REPORTS60_PATH as specified in the files relating
to the forms servlet would be the place to specify the path.
As you will understand I am getting really fustrated with this and it seems to
me that the reports servlet configuration in 6i is really half baked and since 9i
is coming out it will never be fixed.I am even not able to run forms servlets from two different forms60_path, Is there any configuration do you make other than what you have mentioned in this post.
I already open a TAR in this regard, I am still waiting reply from ORACLE.
Thanks,
Shaik Ather Ahmed -
Strange Problem In NWDS while devloping Adobe Offline Form
I am facing a strange problem in NWDS while devloping Offline Adobe Form, the implementation code gets erased once the project is deployed, even the source file also gets deleted.
self
-
Problem while resizing datafiles..
Hi Experts,
Im facing problems while resizing my datafiles. I am using Oracle 10g on Windows 2003 server.
I had a datafile of size 20GB.
I have 3 schemas sch1, sch2,sch3 and all have objects.
I dropped sch1 and truncated some tables in sch2.
I found the freespace available in my datafile 16GB.
When I try to resize the datafile to 5GB, I am getting ora-03297 error.
I checked for object that are beyond 5GB using the follwing query.
I found sch3 objects are present beyond 5GB mark on that datafile.
How can I resize the datafile to 5GB??
Is there any other way to resize the datafile?? Please help me.
SELECT owner, segment_name, segment_type, tablespace_name, file_id,
((block_id+1)*(SELECT value FROM v$parameter
WHERE UPPER(name)='DB_BLOCK_SIZE')+BYTES) end_of_extent_is_at_this_byte
FROM dba_extents
WHERE ((block_id+1)*(SELECT value FROM v$parameter
WHERE UPPER(name)='DB_BLOCK_SIZE')+BYTES) > (<needed size in MB>*1024*
1024)
AND tablespace_name='<tablespace_name>'
ORDER BY file_id, end_of_extent_is_at_this_byte;
Thanks in advance.take a look at the metalink docs...probably coz of high water marks u r not able to do that..
Note 130866.1 - How to Resolve ORA-03297 When Resizing a Datafile by Finding the Table Highwatermark
Note 237654.1 - Resizing a Datafile Returns Error ORA-03297 -
Copying scripts to our own form
Dear friends,
If we need to change the standard form(program) then we need to copy the standard form to our own form name here we will get all the coding too.
but when we migrate script to smartforms.... what happens here?How to migrate it ?hi
good
while you go to smartform you ll find below things, just follow them
1-go to smartforms
2-utilities->Migrate SAPScript Form
3-There you have to give the source name and than press enter it ll copy the source program to your target program, your target program must be start from z or y and than change your program as per your requirement.
thanks
mrutyun^ -
Hi All,
Is is possible to display the matrix output in forms, if is possible please guide me how?
Regards,
YKINGHI
Create table Matr(
RL_Name Varchar2(20),
Ob_Name Varchar2(15),
Ob_Ver Varchar2(15),
R_Num Number )
Values are
Insert Into Matr Values ('ABC', 'X','C1234',1111);
Insert Into Matr Values ('ABC', 'Y','C1235',2222);
Insert Into Matr Values ('ABC', 'Z','C1234',3333);
Insert Into Matr Values ('ABC', 'P','C1231',7777);
Insert Into Matr Values ('DEF', 'X','C3698',4444);
Insert Into Matr Values ('DEF', 'Y','C7895',5555);
Insert Into Matr Values ('DEF', 'Z','C4563',6666);
Insert Into Matr Values ('DEF', 'Q','C1238',9999);
Required output:
RL_Name 'ABC' | 'DEF'
-------------------------------------------------------------- |--------------------------------------------
Ob_Name Ob_Ver | R_Num | Ob_Ver | R_Num
------------------------------------------------------------- |---------------------------------------------
X C1234 1111 | C3698 4444
Y C1235 2222 | C7895 5555
Z C1234 3333 | C4563 6666
P C1231 7777 |
Q C1238 9999
Regards
YKING -
Labview resizes my matrix if the end has zeros
Basically, I have a VI that outputs a 2x65 matrix with all zeros past the 7th or so column. If I wire an indicator to the output of the VI that is functioning within a larger body of code, it removes all the zeros and resizes my matrix . There is literally nothing between the output matrix within in the VI and the indicator connected to the VI on the next level. Why is it reshaping my matricies?
Are you talking about a matrix or a 2D array?
What does the subVI do? are all required inputs wired? Can you attach it?
What does it do if the matrix does not end in zeroes?
What does the "larger body of code" do?
What does array size/matrix size say when probing the subVI output?
Are there any local variables or property nodes around? -
when creating my own form... is there a way to to link multiple drop down fields to other drop down fields?
And in what program? You need to be more specific. Creating conditional forms is of course possible, but the procedures will depend on the actual program and target medium. HTML forms work differently from PDF...
Mylenium -
Problem with AddRow() in custom matrix on System Form
Hello all,
I'm trying to add 1 row to a custom matrix on a system form (Sales Quotation).
However I always get a RPC_E_SERVERFAULT exception when calling pMatrix.AddRow() and SBO crashes...
My code is simple:
[B1Listener(BoEventTypes.et_CLICK, false)]
public virtual void OnAfterClick(ItemEvent pVal)
Form pForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
// Add matrix line
Matrix pMatrix = (Matrix) pForm.Items.Item("MATRIX").Specific;
pMatrix.AddRow();
// Set matrix line data
The matrix shows ok in the system form, inside a new folder.
What is the problem with my code?
Is there any way to add rows to a custom matrix in a system form?
This code runs ok if executed in a custom form...
Thanks!
Manuel Diashi.
R u facing any problem ...
actually add row and del row both are same.
in normal customization form and system form matrx...
Any problem are u facing... -
How to resize Matrix, button in form when Form Restore or Maximize
Hi Expert,
How to to resize my form when Forms are maximize or RestoreYou may check through these:
http://forums.sdn.sap.com/search.jspa?threadID=&q=%22resize+Matrix%22&objID=f56&dateRange=all&numResults=15 -
Problem creating items in a folder owned by another user
Hi
Iam getting an exception when i try to create a folder owned (or shall i say) created by another user.Let me explain what iam doing :
1. I have created a folder "INPRISE" under "/home".I have
created an ACL "MyAcl" having group INPRISEGROUP
as the ACE having all permissions.I have set the ACL "MyAcl" on the folder "INPRISE".
2. I have created two users i1 and i2
and placed them in the group INPRISEGROUP .Both these users have a link under thei home folder to "INPRISE" folder(achieved by using and addItem()).
3. I could successfully login as i1 and create a folder "WebApps" under "INPRISE" and upload a document "A.txt" under "WebApps".
4.But when i log in as "i2" and try to create a document "B.txt" under "WebApps" which was created by user "i1" i get the following exception :
javawebserver: Got the user
javawebserver: got the primary user profile
javawebserver: THE HOME FOLDER IS --> i1
javawebserver: The home folder name is --> i1
javawebserver: home folder
javawebserver: Got the user
javawebserver: got the primary user profile
javawebserver: THE HOME FOLDER IS --> i1
javawebserver: The home folder name is --> i1
javawebserver: home folder
javawebserver: Got the user
javawebserver: got the primary user profile
javawebserver: THE HOME FOLDER IS --> i1
javawebserver: The home folder name is --> i1
javawebserver: home folder
javawebserver: **********Creating document in /home/i1/INPRISE/WebApps
javawebserver: Created document..
javawebserver: Setting permissions for the document....
javawebserver: setting the access level
javawebserver: Got the user
javawebserver: got the primary user profile
javawebserver: THE HOME FOLDER IS --> i2
javawebserver: The home folder name is --> i2
javawebserver: home folder
javawebserver: Got the user
javawebserver: got the primary user profile
javawebserver: THE HOME FOLDER IS --> i2
javawebserver: The home folder name is --> i2
javawebserver: home folder
javawebserver: Got the user
javawebserver: got the primary user profile
javawebserver: THE HOME FOLDER IS --> i2
javawebserver: The home folder name is --> i2
javawebserver: home folder
javawebserver: **********Creating document in /home/i2/INPRISE/WebApps
javawebserver: Error while creating document.....
javawebserver: oracle.ifs.common.IfsException: IFS-30002: Unable to create new
LibraryObject
javawebserver: oracle.ifs.common.IfsException: IFS-30048: Insufficient access t
o add items to a Folder
javawebserver: oracle.ifs.common.IfsException: IFS-30030: Permission not grante
d on specified ACL
javawebserver: at java.lang.Throwable.<init>(Compiled Code)
javawebserver: at java.lang.Exception.<init>(Compiled Code)
javawebserver: at org.omg.CORBA.UserException.<init>(Compiled Code)
javawebserver: at oracle.ifs.common.IfsException.<init>(Compiled Code)
javawebserver: at oracle.ifs.common.IfsException.<init>(Compiled Code)
javawebserver: at oracle.ifs.common.IfsException.<init>(Compiled Code)
javawebserver: at oracle.ifs.server.S_AccessControlList.verifyStandardPermissi
onEnabled(S_AccessControlList.java:602)
javawebserver: at oracle.ifs.server.S_PublicObject.verifyPublicObjectPermissio
n(S_PublicObject.java:2169)
javawebserver: at oracle.ifs.server.S_Folder.verifyCanAddItem(S_Folder.java:10
05)
javawebserver: at oracle.ifs.server.S_Folder.addReference(S_Folder.java:719)
javawebserver: at oracle.ifs.server.S_Folder.addReference(S_Folder.java:697)
javawebserver: at oracle.ifs.server.S_PublicObject.postCreateAddToFolder(S_Pub
licObject.java:2753)
javawebserver: at oracle.ifs.server.S_PublicObject.extendedPostInsert(S_Public
Object.java:995)
javawebserver: at oracle.ifs.server.S_LibraryObject.postInsert(S_LibraryObject
.java:1341)
javawebserver: at oracle.ifs.server.OperationState.executeAtomicOperations(Com
piled Code)
javawebserver: at oracle.ifs.server.S_LibraryObject.createInstance(S_LibraryOb
ject.java:2348)
javawebserver: at oracle.ifs.server.S_LibrarySessio n.newLibraryObject(S_Librar
ySession.java:6596)
javawebserver: at oracle.ifs.server.S_LibrarySession.newPublicObject(S_Library
Session.java:6637)
javawebserver: at oracle.ifs.server.S_LibrarySession.newPublicObject(S_Library
Session.java:6619)
javawebserver: at oracle.ifs.server.S_LibrarySession.DMNewPublicObject(S_Libra
rySession.java:6407)
javawebserver: at oracle.ifs.beans.LibrarySession.DMNewPublicObject(LibrarySes
sion.java:6913)
javawebserver: at oracle.ifs.beans.LibrarySession.NewPublicObject(LibrarySessi
on.java:4564)
javawebserver: at oracle.ifs.beans.LibrarySession.createPublicObject(LibrarySe
ssion.java:2562)
javawebserver: at oracle.ifs.utils.common.PublicObjectUtilities.createDocument
(PublicObjectUtilities.java:537)
javawebserver: at oracle.ifs.utils.common.PublicObjectUtilities.putAsDocumentW
ithVersioning(PublicObjectUtilities.java:163)
javawebserver: at oracle.ifs.adk.filesystem.IfsFileSystem.createDocument(IfsFi
leSystem.java:922)
javawebserver: at dp.DPDocManager.uploadDocument(DPDocManager.java:374)
javawebserver: at ifs.jsp_sbin._dp._dpDoc._jspService(_dpDoc.java:115)
javawebserver: at oracle.ifs.protocols.http.jsp.pagecompile.jsp.runtime.HttpJs
pBase.service(HttpJspBase.java:94)
javawebserver: at javax.servlet.http.HttpServlet.service(Compiled Code)
javawebserver: at oracle.ifs.protocols.http.jsp.IfsJspServlet.runServlet(IfsJs
pServlet.java:865)
javawebserver: at oracle.ifs.protocols.http.jsp.IfsJspServlet.processJspPage(C
ompiled Code)
javawebserver: at oracle.ifs.protocols.http.jsp.IfsJspServlet.service(IfsJspSe
rvlet.java:240)
javawebserver: at javax.servlet.http.HttpServlet.service(Compiled Code)
javawebserver: at com.sun.server.ServletState.callService(ServletState.java:22
6)
javawebserver: at com.sun.server.ServletManager.callServletService(ServletMana
ger.java:936)
javawebserver: at com.sun.server.ProcessingState.invokeTargetServlet(Processin
gState.java:423)
javawebserver: at com.sun.server.http.HttpProcessingState.execute(HttpProcessi
ngState.java:79)
javawebserver: THE ERROR MESSAGE IS IFS-30002: Unable to create new LibraryObje
ct
javawebserver: Setting permissions for the document....
javawebserver: setting the access level
javawebserver: at com.sun.server.http.stages.Runner.process(Runner.java:79)
javawebserver: at com.sun.server.ProcessingSupport.process(Compiled Code)
javawebserver: at com.sun.server.Service.process(Service.java:204)
javawebserver: at com.sun.server.http.HttpServiceHandler.handleRequest(HttpSer
viceHandler.java:374)
javawebserver: at com.sun.server.http.HttpServiceHandler.handleRequest(Compile
d Code)
javawebserver: at com.sun.server.HandlerThread.run(Compiled Code)
javawebserver:
javawebserver:
javawebserver: Error during JSP page processing: /ifs/jsp-bin/dp/dpDoc.jsp
javawebserver: java.lang.NullPointerException
The Code is :
package dp;
import oracle.ifs.beans.*;
import oracle.ifs.common.*;
import oracle.ifs.beans.parsers.*;
import oracle.ifs.adk.security.*;
import oracle.ifs.adk.filesystem.*;
import java.io.*;
import java.util.Locale;
import javax.servlet.http.*;
* The document manager bean for the Deal Planner app.
* <p>
* This class provides a login session/creates a new account in the IFS. The class
* implements the <code>IfsHttpLogin</code> interface so it can share login data with other
* beans.
* @author Srinivas Sampige
* @version 1.0
* @see IfsHttpLogin
public class DPDocManager implements IfsHttpLogin
private String userName = "";
private LibrarySession ifsSession = null;
private FolderPathResolver fPathResolver = null;
private IfsFileSystem ifsFileSystem; // File System object
public DPDocManager()
{//does nothing
*Creates a new account in the IFS for
*a new deal when the deal code is passed in.
*@ param dealCode The deal code of the deal for which an account has to be created
*@ param password A system generate d password for the account being created.
*@ return String Will return "SUCCESS" on creating the account or the reason if an
* error occurrs.
public String createDealFolder(String dealCode)
String result = "SUCCESS";
try
ifsSession = getIfsConnection("system","manager","ServerManager","i5ifs");
ifsSession.setAdministrationMode(true);
//create a new folder for this deal
Folder dealFolder = createFolder("/home",dealCode);
//create a group for this deal;place the group as
//an access control entry in an access control list.
//Set the access control list to the folder.
AccessControlList acl = createDealGroup(dealCode);
dealFolder.setAcl(acl);
ifsSession.setAdministrationMode(false);
}catch(IfsException ie)
int code = ie.getErrorCode();
System.out.println("THE ERROR CODE WHILE CREATING DEAL FOLDER IS -- "+code);
ie.printStackTrace();
result = ie.getMessage();
return result;
}//createDealFolder
public String createUser(String userId,String password,String dealCode)
String result = "SUCCESS";
System.out.println("Creating user and adding to a group "+userId);
try
this.ifsSession = getIfsConnection("system","manager","ServerManager","i5ifs");
ifsSession.setAdministrationMode(true);
System.out.println("Logged in successully");
//form the XML necessary for creating the simple user;
//the new user in the IFS will be the Deal.User id will be the deal code;
//password is fetched from the DEALS table.
String simpleUserString = "<?xml version = '1.0' standalone = 'yes'?>\n"
+ "<SimpleUser>\n"
+ " <UserName>"+userId+"</UserName>\n"
+ " <Password>"+userId+"</Password>\n"
+ " <HomeFolderRoot>/home</HomeFolderRoot>\n"
+ "</SimpleUser>\n";
System.out.println("Parsing "+simpleUserString);
//invoke the XML parser for creating the new user
StringReader userDefinition = new StringReader(simpleUserString);
SimpleXmlParser xmlParser = new SimpleXmlParser(ifsSession);
xmlParser.parse(userDefinition,null,null);
//a valid user for a deal must belong to the deals group;add the user
//to the appropriate group for the deal
String userToGroupString = "<?xml version = '1.0' standalone = 'yes'?>\n"
+ "<DirectoryGroup>\n"
+ " <Update reftype='Name'>" + dealCode+"Group" + "</Update>\n"
+ " <Members>"
+ " <Member reftype='Name'>" + userId + "</Member>"
+ " </Members>"
+ "</DirectoryGroup>\n";
//invoke the XML parser for adding the new user to the group
StringReader groupUpdate = new StringReader(userToGroupString);
xmlParser = new SimpleXmlParser(ifsSession);
LibraryObject lo = xmlParser.parse(groupUpdate,null,null);
System.out.println ("The LO returned by parse is " + lo);
//link this user's home folder to the deal folder
Collection c = ifsSession.getDirectoryUserCollection();
DirectoryUser du = (DirectoryUser) c.getItems(userId);
System.out.println("The DirectoryUser created is " + du.getDistinguishedName());
//Folder homeFolder = (Folder) getIfsFileSystem().findPublicObjectByPath("/home/"+dealCode);
Folder homeFolder = du.getPrimaryUserProfile().getHomeFolder();
System.out.println("Home folder is"+homeFolder);
homeFolder.addItem((Folder)getIfsFileSystem().findPublicObjectByPath("/home/"+dealCode));
System.out.println("Created a link to the deal folder... ");
ifsSession.setAdministrationMode(false);
}catch(IfsException ie)
IfsException.setVerboseMessage(true);
ie.printStackTrace();
return result;
}//public
/* public String addUserToGroup(String groupName)
try
InternetFileSystem ifs = getFileSystem();
ifs.findPublicObjectByPath(goupName);
}catch(IfsException ie)
ie.setVerboseMessage(true);
System.out.println("Problem while adding user to the group "+ie.getMessage());
ie.printStackTrace();
}//addUserToGroup
*This method creates a group that for a particular deal.
*All members having access to this deal must belong to thi s
* group.
public AccessControlList createDealGroup(String dealCode)
AccessControlList acl = null;
try
DirectoryGroupDefinition def = new DirectoryGroupDefinition(ifsSession);
def.setAttribute("NAME",AttributeValue.newAttributeValue(dealCode+"Group"));
DirectoryGroup dealGroup = (DirectoryGroup)ifsSession.createPublicObject(def);
AccessControlListDefinition aclDef = new AccessControlListDefinition(ifsSession);
AccessControlEntryDefinition aceDef = new AccessControlEntryDefinition(ifsSession);
AccessLevel aLevel = new AccessLevel();
aLevel.enableAllStandardPermissions();
aLevel.disableStandardPermission(AccessLevel.ACCESSLEVEL_ADDITEM);
aLevel.disableStandardPermission(AccessLevel.ACCESSLEVEL_CREATE);
aLevel.disableStandardPermission(AccessLevel.ACCESSLEVEL_ALL);
aceDef.setGrantee(dealGroup);
aceDef.setDistinctAccessLevel(aLevel);
aclDef.addAceDefinition(aceDef);
acl = (AccessControlList) ifsSession.createPublicObject(aclDef);
acl.setName(dealCode+"ACL");
}catch(IfsException ie)
System.out.println("error while creating group for deal");
IfsException.setVerboseMessage(true);
ie.printStackTrace();
return acl;
}//createUser
*makes a connection the the IFS and returns the LibrarySession object.
*@param userName user name for a valid IFS account.
*@param password password for a valid IFS account.
*@param serviceName the IFS service name.
*@param schemaPassword the IFS schema password.
private LibrarySession getIfsConnection(String username, String password, String serviceName,
String schemaPassword) throws IfsException
LibraryService service = new LibraryService();
CleartextCredential me = new CleartextCredential(username, password);
ConnectOptions connection = new ConnectOptions();
connection.setLocale(Locale.getDefault());
connection.setServiceName(serviceName);
connection.setServicePassword(schemaPassword);
ifsSession = service.connect(me, connection);
fPathResolver = new FolderPathResolver(ifsSession);
ifsFileSystem = new IfsFileSystem(ifsSession);
return ifsSession;
}//getIfsConnection()
public String loginToIfs(String userName,String password,String serviceName,String schemaPassword)
String result = "SUCCESS";
try
getIfsConnection(userName,password,serviceName,schemaPassword);
this.userName = userName;
//getResolver().setHomeFolder("/home/"+userName);
}catch(IfsException ie)
int code = ie.getErrorCode();
System.out.println("ERROR CODE "+code);
result = "FAILED -- "+code+" -- "+ie.getMessage();
System.out.println("Failed to login "+ie.getMessage());
ie.printStackTrace();
return result;
}//loginToIfs
public LibrarySession getSession()
return ifsSession;
}//getSession()
public FolderPathResolver getResolver()
return fPathResolver;
public IfsFileSystem getIfsFileSystem()
return ifsFileSystem;
public Folder getHomeFolder()
Folder homeFolder = null;
try
DirectoryUser user = ifsSession.getUser();
System.out.println("Got the user");
PrimaryUserProfile primary = user.getPrimaryUserProfile();
System.out.println("got the primary user profile");
homeFolder = primary.getHomeFolder();
System.out.println("THE HOME FOLDER IS --> "+homeFolder);
System.out.println("The home folder name is --> "+homeFolder.getName());
}catch(IfsException ie)
ie.printStackTrace();
System.out.println("home folder");
return homeFolder;
}//getHomeFolderPath()
* Called when this object is bound to the HTTP session object.
* @param event The event when the object is bound to the Http session.
public void valueBound(HttpSessionBindingEvent event)
// do nothing
* Called when this object is unbound from the HTTP session object.
* @param event The event when the object is unbound to the Http session.
public void valueUnbound(HttpSessionBindingEvent event)
//release the reources like the ifsSession etc.
fPathResolver = null;
try
if (ifsSession != null)
ifsSession.di sconnect();
}catch (IfsException e)
e.printStackTrace();
finally
ifsSession = null; // release the resources
}//valueUnbound()
public Folder createFolder(Folder destinationFolder,String theNewFolderPath)
Folder createdFolder = null;
try
System.out.println("<*---*> IN THE FOLDER "+destinationFolder);
IfsFileSystem ifs = getIfsFileSystem();
System.out.println("Creating the folder..");
createdFolder = ifs.createFolder(theNewFolderPath,destinationFolder,true,null);
System.out.println("Created the folder..");
}catch(IfsException ie)
System.out.println("ERROR CREATING A FOLDER IN THE DESTINATION FOLDER");
IfsException.setVerboseMessage(true);
ie.printStackTrace();
return createdFolder;
}//createFolder(String inTheFolder,theNewFolder)
public Folder createFolder(String inTheFolder,String theNewFolderPath)
Folder createdFolder = null;
try
System.out.println("<*---*> IN THE FOLDER "+inTheFolder);
IfsFileSystem ifs = getIfsFileSystem();
System.out.println("Creating ANOTHER folder for test");
Folder destinationFolder = (Folder) ifs.findPublicObjectByPath("/"+inTheFolder);
System.out.println("The destination folder is "+destinationFolder);
/* Folder destinationFolderMyTest = (Folder) ifs.findPublicObjectByPath("/home/c6/COREL/MY-TEST/");
System.out.println("The destination folder my test is "+destinationFolderMyTest);*/
createdFolder = ifs.createFolder(theNewFolderPath,destinationFolder,true,null);
/* System.out.println("Created folder in destination folder ");
createdFolder = ifs.createFolder(theNewFolderPath,(Folder) ifs.findPublicObjectByPath(inTheFolder),true,null);
System.out.println("Created folder in MY-TEST ");*/
}catch(IfsException ie)
System.out.println("ERROR CREATING A FOLDER IN THE DESTINATION FOLDER");
IfsException.setVerboseMessage(true);
ie.printStackTrace();
return createdFolder;
}//createFolder(String inTheFolder,theNewFolder)
*Method creates a folder in the path specified(the path includes the name of the folder
*to be created).If a parent of any of the folders in the path
*is not found then that folder is automatically created.
public String createFolder(String folderPath)
System.out.println("*-*-*-*-* Creating folder *-*-*-*-*");
String result = "SUCCESS";
try
//ifsSession.setAdministrationMode(true);
IfsFileSystem ifs = new IfsFileSystem(ifsSession);
Folder folder = (Folder) ifs.findPublicObjectByPath("home/"+userName);
ifs.createFolder(folderPath,(Folder) folder,true,null);
}catch(IfsException ie)
result = ie.getMessage();
ie.printStackTrace();
return result;
}//createFolder
//Upload a document to the ifs
public Document uploadDocument(String localPath,String destinationPath)
Document document = null;
try
IfsFileSystem ifs = new IfsFileSystem(ifsSession);
FileInputStream fis = new FileInputStream(localPath);
System.out.println("**********Creating document in "+destinationPath);
document = ifs.createDocument("B.txt", fis, destinationPath, null, false, null);
System.out.println("Created document..");
}catch(IfsException e)
System.out.println("Error while creating document.....");
IfsException.setVerboseMessage(true);
e.printStackTrace();
System.out.println("THE ERROR MESSAGE IS "+e.getMessage());
catch(Exception e)
System.out.println("File not found/io exception ");
e.printStackTrace();
return document;
}//uploadDocument
* Adds an access control entry to the public object passed in.
*@param PublicObject the publicObject for which permissions have to be set.
public void setAccessControlOnObject(PublicObject publicObject)
try
System.out.println("Setting permissions for the document....");
AccessControlListDefinition aclDef = new AccessControlListDefinition();
aclDef.setName(publicObject+"ACL");
AccessControlEntryDefinition aceDef = new AccessControlEntryDefinition();
//this sets the acceess control entry's granntee as the "user" who ha s loggen on
aceDef.setGrantee(ifsSession.getDirectoryUser());
aceDef.enableGrantToWorld(false);
String[] permissions = {"ACCESSLEVEL_NONE"};
System.out.println("setting the access level");
AccessLevel accessLevel = new AccessLevel(permissions);
/*PermissionBundleDefinition pbDef = new PermissionBundleDefinition(ifsSession);
PermissionBundle pb = (PermissionBundle) ifsSession.createSystemObject(pbDef);
pbDef.setAccessLevel(accessLevel);
pbDef.setAccessLevel(accessLevel);
aceDef.addPermissionBundle(pb);*/
aceDef.setDistinctAccessLevel(accessLevel);
aclDef.addAceDefinition(aceDef);
AccessControlList acl = (AccessControlList) ifsSession.createPublicObject(aclDef);
publicObject.setAcl(acl);
}catch(IfsException ie)
System.out.println("The error while settin access control is -0> "+ie.getMessage());
ie.setVerboseMessage(true);
ie.printStackTrace();
}//createAccessControlList
}//class DPDocManager
Note : since iam still experimenting with the code please ignore any irrelevant/wrong commenting.Iam using method "CreateDealFolder()" to create the folder "INPRISE" and "CreateUser()" to create users "i1","i2"Iam not able to set the main folder's (i.e INPRISE) acl (MyAcl) on the subfolder "MyFolder" because the owner of MyAcl is "system" whereas the owner of MyFolder is user "i1" .Which is the best way of solving these ownership issue which iam running into ? I want to be able to create different folders ,assign a group of uers to each of the folders who can create as well as modify,delete each other's folders/documents (as i have mentioned in my first post in this thread) ?
thanks
Srinivas
Maybe you are looking for
-
How can I use eprint to print the my Outlook Calendar?
How can I print my Outlook Calendar using ePrint? I am running Windows 7, with Office 2007. the printer is a HPOfficeJet 6500A Plus.
-
Problem with transferring user account
Hi: We recently purchased a refurbished MacBook running 10.5.8 for my daughter to take to college. We set up only one account on the refurb, and installed a few applications like Microsoft Office (from disk) and Adobe Reader (from the web.) Everythin
-
When MSKA (Sales Order Stock) table get updated?
Hi, May I know when MSKA(Sales Order Stock) table get updated? Regards, thiyagu
-
Silently deploy Acrobat from CS6 source
My organization uses a single key to register our CS6 suite. We have the need to deploy Acrobat seperately from CS6 as not all users need the complete suite. Using Adobe Customization Wizard X and attempting to run the AcroPro.msi using the transform
-
My MacBook air 4 days old freezes up?
Mouse pad not working. Tried rebooting sever times. Taking it back tomorrow.