Forum Stats

  • 3,781,163 Users
  • 2,254,485 Discussions
  • 7,879,599 Comments

Discussions

How to implement Serializable

3004
3004 Member Posts: 204,171
import oracle.ifs.beans.*;


public class MyDocument extends TieDocument implements Serializable{


public MyDocument(params)
{
super(params);
.....
}

public void myMethod1() {}
public void myMethod2() {}
public void myMethod3() {}
...
}


With respect to the above code ,i would like to know if its possible for me to extend a
Tie class (ex TieDocument,TieFolder)and give my own implementation for it...The above code gives
me a compilation error becoz the constructor arguements never matched and
i dont know a way to get the proper parameters like the id and data.Seeking you help at the earliest.
Thanks!!

Yours truly,
Ram
null

Comments

  • 3004
    3004 Member Posts: 204,171
    Here is an example

    package ifs.demo.typeDefinition;

    import oracle.ifs.beans.TieDocument;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.server.S_LibraryObjectData;
    import oracle.ifs.common.IfsException;


    public class SimpleImage extends TieDocument


    public SimpleImage(LibrarySession ifs,
    java.lang.Long id,
    java.lang.Long classId,
    S_LibraryObjectData data)
    throws IfsException
    {
    // Construct a Document object - standard variant.
    super(ifs,id,classId,data);
    }

    }

    null
  • 3004
    3004 Member Posts: 204,171
    Thanks again for your efforts.But still the problem persists.
    I dont know a way to get the values for the parameters like id, classid and S_LibraryObjectData when i invoke this constructor to create an object of this SimpleImage component from the client .
    for ex

    import ifs.demo.typeDefinition.SimpleImage;

    public class Client
    {
    public Client()
    {
    SimpleImage image = new SimpleImage(ifs, ? ,? ,?);
    }
    }
    null
  • 3004
    3004 Member Posts: 204,171
    I do not think that you can ever do this. These objects can not be created on a client, they can only be obtained using methods on LibrarySession

    Eg to create a new Document

    LibrarySesion ifs

    DocumentDefinition myDocDef = new DocumentDefintion(ifs);
    Document myDoc = ifs.createPublicObject(myDocDef);

    null
  • 3004
    3004 Member Posts: 204,171
    Thanks once agin for your prompt response.
    Well, my requirement is we are using the rmi and have to serialize the objects and for that we have this problem as we are not able
    to serialize the tiedocument objects.
    So what could be the best possible solution?
    Looking forward for your response as usual.
  • 3004
    3004 Member Posts: 204,171
    Ram

    I think I need to understand what you are trying to do with iFS from a higher level.

    Can you please outline what the application requirement is that means you need to create an instance of an IFS document and then serialize it, without being attached to the repository. If you are using RMI to create a document locally and then move it accross the network to some server you are going to have to have a repository connection to get the LibrarySession object.

    If you want to create documents locally and then pass them over the network I suspect that you should look at serializing the definition object and then have the server side componant use the definition object to create the document object.

    null
This discussion has been closed.