Fetch XML from Content server to Portlet and display as HTML

Hi,
I want to fetch the XML from the content server and display that XML in the Weblogic Portlet as HTML.
The main reason is that data will be contributed by the users in UCM and then I had to get that data from content server and display in portlet
Please Help........
Thanks,
Vinod

Vinod:
Probably what you're looking for is to bring the content over using the UCM SPI adapter for WLP's VCR:
[http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/ucm_adapter/intro.html]
And then to display the content using a custom template using Content Presenter:
[http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/cm/displaytemplatesCM.html]
[http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portlets/development.html]
When you say you want to fetch xml, is that because it's a contributor data file? You can either read the property values directly from the VCR, or use the info you get from the node (such as dDocName) to then use a UCM/WCM web service to retrieve formatted content and put it in an iframe. There are a lot of ways to go in formatting the data.
You can even add edit capabilities to your Presenter template by calling the 'edit data file' web service of WCM.

Similar Messages

  • Problem using content from content server in portlet.

    Hi all,
    I create a JSR286 portlet project, add a content server connection then drag content from those connection to jspx by selected create > document - content presenter.
    Problem occur when i deploy the project to portlet managed server.
    I'm not sure any mds they required because while deploying the Deploymeny Configuration was poped up to prompt me select mds repository.
    I don't know what mds repository they required.
    Please help.
    Regards.

    Hi ngsankar,
    Thanks for your reply.
    I have no idea about any schema ;(
    on the integrated weblogic server i can't deploy too.
    Is it possible to use any content from content server in portlet like on portal?
    Regards.

  • Options of fetching mails from mail server into PI and also from oracle system

    hi All,
    Pls extend your help in looking out the possiblity of fetching mails from mail server into SAP PI
    and also from oracle system into PI ,earliest help would be appreciated.
    and also the types of sources for both the scenarios.
    Regards
    Vidya Sagar Manda

    Hi Vidya,
    you can use the email adapter to read/pick up email from mail box.
    and use JDBC adapter to read data from table of any database. Please refer the links given to your old thread
    Fetch Mails From MailServer using PI and integrate the message into BPM
    regards,
    Harish

  • Error Displaying Portlet Preview created from Content Server templates

    I created portlet from content server announcement portlet template.Whet put on the page this portlet shows the following error message:
    Error Displaying Portlet Preview.Error Getting Content from Portlet.
    Same error with portlet created from the news template.

    If the link exists in TOA01, why is the dosumnet not visible ? When i use the Function Module ARCHIVOBJECT_DISPLAY, i get the error -
    Error when opening document with HTML control:DP_ERROR_GENERAL
    Can someone please let me know what are we doing wrong ??

  • Content Server News Portlet major design flaw ?!

    I ran into a Content Server 6.1 issue which is really frustrating me. I am wondering if I am doing something wrong or if it is a design flaw: 1. I created a content server news portlet "out of the box" and added it to my MyPage.2. I created and published 2 news articles.3. I edited the 1st article and just saved it. I did NOT PUBLISH it.4. I edited the 2nd article and PUBLISHED it. The news index is re-published automatically to reflect the changes of the 2nd article which has been published. But the index now displays the changes of BOTH articles, even the unpublished! Furthermore the 1st article can't be opened from the index anymore if the name property has been changed. As the published file name changes with each version and especially when the name is updated, the news index links to the new published file name - but it has never been created as I didn't publish the 1st article! I understand why this is happening: The index content item holds a list of all article content items and is published whenever an article is published / deleted / expired. But until now I thought that content server is holding the last published version and includes this into the list until a new version is published. That's not the case! Imagine this on a production environment with workflow activated: one article was approved and published while the other still needs to be reviewed, but it's (unreviewed) index data like headline etc. is already displayed in the index?! And in worst case the article can't even be opened. You just get the server error "page not found". Many of my content items for a current big project follow the idea of the news template, e.g. HR Staff Overview (persons = articles, overview = index), so I am kind of stressed by what I found out. Has anybody made similar a experience and found a workaround for this? Perhaps one of the support people could explain how the news portlet is intended to be used with this severe behaviour? Am I expecting too much? Is updating an already published article not possible? But why are version mechanisms included for content items then? I appreciate your comments. Thanks.

    Thanks for the quick reply.
    We are using Content Server 6.1 with all Hotfixes installed and we are not planning to upgrade to G6 at the moment.
    As far as I understood the 'filtered.published' property contains the date the content item was published the last time. So it will always be 'true' if the item has been published in the past, no matter if it's currently published or not.
    The index template with the code snippet you sent will display the currently not published (but changed) item properties whenever another item was published. Have you changed the design in 6.2 so that properties of an item in a list property of another item are just copied and not linked?
    As a workaround I now compare the 'modified' property with the 'published' property and if it is greater or equal I don't display it in the index. But that's not the way Content Server was designed to behave, is it? With this solution I can suppress the item in the list if it has been modified after the last publishing, but of course I rather want to have the data of the last published version.
    Isn't that possible? Is it possible in 6.2? Is there any way to update Content Server to 6.2 without acquiring G6?
    RegardsStefan

  • Unable to send email from content server

    Hi,
    I have a requirement of sending the notification email to user from the stellent when he subscribe to it.To test it i logged in to content server as sysadmin.
    Administration->Actions->Send test email.
    I had filled some dummy data and when i click on send it gives me a error
    Content Server Request Failed
    Unable to send email. Could not send mail message from [email protected] with subject line: Test email from Content Server.
    intradoc.common.ServiceException: !csMailCouldNotSend,[email protected],Test email from Content Server
         at intradoc.server.InternetFunctions.sendMailToEx(Unknown Source)
         at intradoc.server.SystemAuditHandler.sendEmail(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at intradoc.common.IdcMethodHolder.invokeMethod(Unknown Source)
         at intradoc.common.ClassHelperUtils.executeMethodReportStatus(Unknown Source)
         at intradoc.server.ServiceHandler.executeAction(Unknown Source)
         at intradoc.server.Service.doCodeEx(Unknown Source)
         at intradoc.server.Service.doCode(Unknown Source)
         at intradoc.server.ServiceRequestImplementor.doAction(Unknown Source)
         at intradoc.server.Service.doAction(Unknown Source)
         at intradoc.server.ServiceRequestImplementor.doActions(Unknown Source)
         at intradoc.server.Service.doActions(Unknown Source)
         at intradoc.server.ServiceRequestImplementor.executeActions(Unknown Source)
         at intradoc.server.Service.executeActions(Unknown Source)
         at intradoc.server.ServiceRequestImplementor.doRequest(Unknown Source)
         at intradoc.server.Service.doRequest(Unknown Source)
         at intradoc.server.ServiceManager.processCommand(Unknown Source)
         at intradoc.server.IdcServerThread.run(Unknown Source)
    Caused by: intradoc.common.ServiceException:
         at intradoc.common.SmtpClient.sendMail(Unknown Source)
         at intradoc.server.InternetFunctions.sendMail(Unknown Source)
         ... 21 more
    Caused by: java.lang.Exception: !csSMTPInvalidMessage,"System Administrator" <[email protected]>!csSMTPUnableToFindRecipients,1
         at intradoc.common.SmtpClient.writeMultiMsg(Unknown Source)
         ... 23 more
    Caused by: java.lang.Exception: !csSMTPResponseIndicatesFailure,550 5.7.1 Unable to relay for [email protected]
         at intradoc.common.SmtpClient.writeMsg(Unknown Source)
         ... 24 more
    I had set the internet configration in admin server to this values..
    HttpServerAddress=blrdxp-rchithul.corp.capgemini.com
    MailServer=BLREX002.corp.capgemini.com
    [email protected]
    SmtpPort=25
    HttpRelativeWebRoot=/idc/
    CgiFileName=idcplg
    UseSSL=No
    WebProxyAdminServer=true
    But i am still getting the error.kindly help me...
    Thanks in Advance
    Regards
    Rakesh

    Hi Rakesh,
    You have to request you Network team to add the ip address of the machine where you have installed content server to your Exchange Server.
    Let me know if it works.
    Deepak

  • How to convert JPG image to BMP ? (Printing jpg images in smartforms from content server)

    Hi,
    We have employee photos(JPG Format) stored in Content server. And now we want to print the photos in smartforms. For this I had written the below code to read the photo from content server in binary format as below.
    REPORT ZTEST1.
    PARAMETERS P_PERNR TYPE PERNR_D.
    DATA: PS_CONNECT_INFO TYPE TOAV0,
          IT_BINARY TYPE TABLE OF SDOKCNTBIN.
    CALL FUNCTION 'HR_IMAGE_EXISTS'
      EXPORTING
        P_PERNR                     = P_PERNR
    *   P_TCLAS                     = 'A'
    *   P_BEGDA                     = '18000101'
    *   P_ENDDA                     = '99991231'
    IMPORTING
    *   P_EXISTS                    =
       P_CONNECT_INFO              = PS_CONNECT_INFO
    * EXCEPTIONS
    * ERROR_CONNECTIONTABLE       = 1
    *   OTHERS                      = 2
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.
    IF PS_CONNECT_INFO IS NOT INITIAL.
      CALL FUNCTION 'SCMS_DOC_READ'
        EXPORTING
       STOR_CAT                    = SPACE
       CREP_ID                     = PS_CONNECT_INFO-ARCHIV_ID
          DOC_ID                      = PS_CONNECT_INFO-ARC_DOC_ID
    *   PHIO_ID                     =
    *   SIGNATURE                   = 'X'
    *   SECURITY                    = ' '
    *   NO_CACHE                    = ' '
    *   RAW_MODE                    = ' '
    * IMPORTING
    *   FROM_CACHE                  =
    *   CREA_TIME                   =
    *   CREA_DATE                   =
    *   CHNG_TIME                   =
    *   CHNG_DATE                   =
    *   STATUS                      =
    *   DOC_PROT                    =
    TABLES
    *   ACCESS_INFO                 =
    *   CONTENT_TXT                 =
       CONTENT_BIN                 = IT_BINARY
    * EXCEPTIONS
    * BAD_STORAGE_TYPE            = 1
    *   BAD_REQUEST                 = 2
    *   UNAUTHORIZED                = 3
    * COMP_NOT_FOUND              = 4
    *   NOT_FOUND                   = 5
    *   FORBIDDEN                   = 6
    *   CONFLICT                    = 7
    * INTERNAL_SERVER_ERROR       = 8
    *   ERROR_HTTP                  = 9
    * ERROR_SIGNATURE             = 10
    *   ERROR_CONFIG                = 11
    *   ERROR_FORMAT                = 12
    * ERROR_PARAMETER             = 13
    *   ERROR                       = 14
    *   OTHERS                      = 15
      IF SY-SUBRC <> 0.
    * Implement suitable error handling here
      ENDIF.
    ENDIF
    Now the issue is I want to convert that binary data to bitmap image and upload the same in to SE78. So that I can use that BMP image from SE78 in my smartforms.
    I had used the class CL_IGS_IMAGE_CONVERTER to covert the image into bmp but it is giving error that error in IMAGE DATA CORRUPT & Error Code 3. The conversion code used is as below.
    ******* CONVERT THE JPG IMAGE INTO BMP PHOTO. **********
      DATA: L_IGS_IMGCONV TYPE REF TO CL_IGS_IMAGE_CONVERTER,
    L_IMG_BLOB    TYPE W3MIMETABTYPE,
    L_IMG_SIZE    TYPE W3PARAM-CONT_LEN,
    L_IMG_TYPE    TYPE W3PARAM-CONT_TYPE,
             L_IMG_SUBTYPE TYPE W3PARAM-CONT_TYPE,
    L_IMG_URL     TYPE W3URL,
    L_ERR_CODE    TYPE I,
    L_ERR_TEXT    TYPE STRING,
             P_DEST TYPE CHAR32 VALUE 'IGS_RFC_DEST'.
      DATA: G_IMG_BLOB     TYPE W3MIMETABTYPE,
          G_IMG_TYPE     TYPE W3PARAM-CONT_TYPE,
          G_IMG_SIZE     TYPE W3PARAM-CONT_LEN.
      IF NOT IT_BINARY[] IS INITIAL.
        G_IMG_BLOB[] = IT_BINARY.
        CREATE OBJECT L_IGS_IMGCONV
          EXPORTING
            DESTINATION = P_DEST.
        CALL METHOD L_IGS_IMGCONV->SET_IMAGE
          EXPORTING
            BLOB      = G_IMG_BLOB
            BLOB_SIZE = G_IMG_SIZE.
        CASE PS_CONNECT_INFO-RESERVE.
          WHEN 'TIF'.
            G_IMG_TYPE = 'image/tiff'.
          WHEN 'JPG'.
            G_IMG_TYPE = 'image/jpeg'.
          WHEN 'PNG'.
            G_IMG_TYPE = 'image/png'.
          WHEN 'GIF'.
            G_IMG_TYPE = 'image/gif'.
          WHEN 'BMP'.
            G_IMG_TYPE = 'image/x-ms-bmp'.
          WHEN OTHERS.
            EXIT.
        ENDCASE.
    L_IGS_IMGCONV->INPUT  = G_IMG_TYPE.
        L_IGS_IMGCONV->OUTPUT = 'image/x-ms-bmp'.
    *    PERFORM GET_SIZE USING PICTURE_CONTAINER
    * L_IGS_IMGCONV->WIDTH
    * L_IGS_IMGCONV->HEIGHT.
        CALL METHOD L_IGS_IMGCONV->EXECUTE
          EXCEPTIONS
            OTHERS = 1.
        IF SY-SUBRC IS INITIAL.
          CALL METHOD L_IGS_IMGCONV->GET_IMAGE
            IMPORTING
              BLOB      = L_IMG_BLOB
              BLOB_SIZE = L_IMG_SIZE
              BLOB_TYPE = L_IMG_TYPE.
          SPLIT L_IMG_TYPE AT '/' INTO L_IMG_TYPE L_IMG_SUBTYPE.
        ELSE.
          CALL METHOD L_IGS_IMGCONV->GET_ERROR
            IMPORTING
              NUMBER  = L_ERR_CODE
              MESSAGE = L_ERR_TEXT.
          BREAK-POINT.
        ENDIF.
      ENDIF.
    ENDIF.
    So could you please some one help me how to convert JPEG Photo to BMP programatically.
    Regards,
    Mayur.

    johnandersonpalmdesert wrote:
    My printer is requesting a vector file.
    Jpeg File format does not support vectors.  Photoshop has limited vector support and tools.  Photoshop can not save vector file formats like SVG.  What File type does your printer want?
    Adobe Illustrator is Adobe vector application.

  • Copy any kind of file from content server to network directory

    Helli All
    The question:
    I nee to copy any kind of file from content server to any network directory.
    Explanation
    1. transaction CV02N
    2. There is attached file for a document in tab "Document data/Original"
    3. This file stored in content server
    4. I wrote program code that creates path of the stored file that finally looks like
    http://cont:8888/ContentServer.dll?get&Version=.....*...&compid=app1.doc
    where app1.doc is file's name and I have to copy this file into network directory.
    The problem is that this URL open the file instead of just pointing to him
    so that no function or method can't see this file and as the result I got message that
    the file doesn\t exist.
    Please, advice.
    Regards,
    Daniel.

    many many thanks for ur help. i really did not check the URLClassLoader properly.
    but i would like to hear a little more from u. i have another question. here in this code (provided earlier), i searched for attribute values in the manifest file, then again i load the required class file from the very url. is it not good to retrieve the whole jar file first, and then check attribute values inside manifest file and load the required class files from that jar file that is already downloaded without going to that url again? how can i do this?

  • Filename encoding from content server

    Dear gurus,
    I need your help. As storage our documents for ERP we use content server. I observe problem for example I try to open in sbwp in shared folders file with name "Роли-транзакции MM.xls". On first time it  opens without any problem. Then I try open this file or other I see message "file is not found <name of file>". When i go in sapworkdir (or sapgui) folder I see file with filename like  this "####-##########MM_20130919063339.006_X.xls". But the files with English letters in the file name opens correct. I understand that the problem is somewhere in the content server, but where?

    Hi Dmitry,
    Do you do all the activities with logon language RU and a Windows front end system where the system code page is based on Cyrillic? If not, please retry with a "completely localized" setup.
    The fact that the Russian characters are converted to #-symbols indicate that somewhere there is a conversion from Unicode --> Non-Unicode (probably Latin-1 - maybe based on logon language) and this fails.
    Unfortunately I am not familiar with content server - and these kind of problems are difficult to be analyzed without direct debugging on the system. Therefore I think it is the best if you raise a customer message  at SAP.
    Or maybe there is someone who knows content server very well and might be able to help ...
    Best regards,
    Nils

  • Reading the Excel from Content Server...

    Hello Experts
    I have a requirement to read the contents of the excel from DMS content server to Internal Table.
    I tried using the function module "SCMS_DOC_READ", but it is reading only the part of the contents and remaining contents are missing in the Internal Table.
    Is there any other way to read the content of excel file stored in content server.
    Many Thanks in advance!!!
    Regards,
    Benu

    Hi Christoph,
    Many thanks for your reply...
    Now I am using the same report for downloading the document from content server but my requirement is to read the contents directly from content server without downloading it to presentation server..
    The function module mentioned in the above post is not reading the complete contents of the excel sheet.
    Regards,
    Benu

  • Get files from Content server to Application server

    I want to Get few files from Content server to Application server, I have the required Archive ID. It is a HTTP Content server type. Can you please suggest the suitable method for this.
    Thanks
    Purna

    > I am new to SDN and SAP XI, can anyone tell me whether its possible to move the files (different strcuture files i.e. some are master data files and some are transaction data file) from FTP server to Application server with one interface.
    Hello Bob,
    Yes it is possible.
    There can be two ways of doing it.
    1. N:1 mapping, BPM will require for this.
    N:1 Mapping refer this blog
    IDOCs (Multiple Types) Collection in BPM
    BpmPatterns CollectMerge
    part1  BPM with Patterns explained Part-1
    part2  BPM with Patterns explained Part-2
    Second option
    Create 3 scanarios in integration directory and correspondingly in integration repositoy create different data types, message types, mappings & interface mappings and then in each of scenario us different message interface and interface mapping.
    > I know that if we create new configuration it will work but I question is does master data interface picks this transaction data file also.
    >
    If you are using N:1 scenario then use *.csv in your sender adapter under file name parameter and then all the files will be picked up from same directory.
    If you are using second option (3 different scenarios) then also you can pick the different files from same directory. You will be having 3 sender adapters in this case, So, one for picking master data, and another for product data and the last one for transaction data.
    So, in case of master data use "plant_*.csv" as a file name and directory name.
    In case of product data, use "product_*.csv " as a file name and source directory will remain same.
    similarly do it for transaction data.
    So by this way all 3 sender adapters will perform their job to pick the different files from same source directory.
    Regards,
    Sarvesh

  • Display different types of file formats from contents server on web UI

    Hi,
    I have to read different types of documents from content server and display it in web page using webdynpro abap.
    Different types of documents are : Tif, Jpeg, BMP, PNG etc. need to be convert into gif format and display
    Txt files as it is.
    PDF files as it is.
    Microsoft office documents as it is.
    ALF files i.e. printlists to be shown on web page.
    Please anyone has any information regarding this let me know ASAP.
    Thanks & Regards,
    Manali

    hi ,
    pls refer the below thread :
    Dynamic Use of Mime in component
    n check wid thomas reply in the thread :
    Create the cached response object that we will insert the  content
    Well you can manipulate the MIME content at runtime by using the API: CL_MIME_REPOSITORY_API. However if your content is temporary, it is more efficient to just place the content directly into the ICM cache. You don't have the overhead of having to both write and then delete it from the database. Here is an example of how you can do this:
    I hope it wud be helpful
    rgds,
    amit

  • Db connection from content server context through JSP

    Hi All,
    Can anyone tell me how to get ucm db connection from Content Server context through JSP file? Thanks.
    Joe
    FMW Team,iTech,Shenzhen

    Start by getting a sample JSP here:
    http://www.corecontentonly.com/Blog/UsingJavaServerPagesWithContentServerAndAnExample
    Then, you can use the Workspace object in the jsp to create resultsets from SQL.
    String sql = "SELECT * FROM REVISIONS";
    // Execute the sql
    rs = objWorkspace.createResultSetSQL(sql);
    drs = new DataResultSet();
    drs.copy(rs);
    for (drs.first(); drs.isRowPresent(); drs.next())
    String dDocName = ResultSetUtils.getValue(drs, "dDocName");
    System.out.println(dDocName);
    }

  • Is it possible to uninstall IE 11 from Windows Server 2012 R2 and replace it with the latest version of IE 10?

    Is it possible to uninstall IE 11 from Windows Server 2012 R2 and replace it with the latest version of IE 10? We have a remote desktop farm setup with 2012 R2 servers and we are publishing some web links that only work with IE10. As a result, we need to
    downgrade the remote desktop servers to IE10. I have a feeling that this isn't possible, but if I could get a definitive answer, I would greatly appreciate it, thank you!

    Hi,
    Agreed with DonPick.
    Internet Explorer 11 is preinstalled with Windows 8.1 and Windows Server 2012 R2.
    More information regarding Internet Explorer 11, please check:
    Internet Explorer 11 - FAQ for IT Pros
    http://msdn.microsoft.com/en-us/library/dn268945.aspx
    Best regards
    Michael Shao
    TechNet Community Support

  • Java XML-Reader (SAX)--How to read and display xml-element-data???

    hello all,
    i would like to display just some xml-data
    Which methods in java should i use to select just one character-data of this (for example: "deu" from the element <Language> or the attribut "version" of the element <catalog>).
    Here is the XML-document i want to parse and display it with System.out.print() :
    <BMECAT version="1.2">
         <HEADER>
              <GENERATOR_INFO>
                   e-proCat 2.1, e-pro solutions GmbH
              </GENERATOR_INFO>
              <CATALOG>
                   <LANGUAGE>deu</LANGUAGE>
                   <CATALOG_ID>Katalog 01</CATALOG_ID>
                   <CATALOG_VERSION>001.000</CATALOG_VERSION>
                   <CATALOG_NAME>ETIM</CATALOG_NAME>
                   <DATETIME type="generation_date">
                        <DATE>2002-05-22</DATE>
                   </DATETIME>
                   <TERRITORY>DE</TERRITORY>
                   <CURRENCY>EUR</CURRENCY>
                   <MIME_ROOT>ETIM-Daten</MIME_ROOT>
              </CATALOG>
    </HEADER>
    </BMECAT>
    Here is the java application i wrote and which doesn t work:
    import org.apache.xerces.parsers.SAXParser;
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
         public class XmlLeser implements ContentHandler {
    public XmlLeser(String fileName) {
    try {
    XMLReader myParser = new SAXParser(); // SAXParser (Xerces)
    myParser.setContentHandler(this);           
    myParser.parse(fileName);      } catch (Exception e) {
         System.out.println("Erreur " + e);     }
    }// End of constructor
    public void startDocument() {
         System.out.println(" start to parse " );
    } // startDocument()
    public void endDocument() {
    System.out.println(" End of Parse ");
    } // endDocument()
    public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
         System.out.println(localName) ;
    public void endElement(String namespaceURI, String localName, String qName) throws SAXException {           
    }// Endelement()
    public void characters(char ch[], int start, int length) {
    } // endCharacters(char[],int,int);
    public void processingInstruction(String target, String data) {
    } // processingInstruction(String,String)
    public void ignorableWhitespace(char ch[], int start, int length) {
              characters(ch, start, length);
    } // ignorableWhitespace(char[],int,int);
    public static void main(String args[]) {
    String xmlFileName = "";
    if (args.length == 0) {               
    System.out.println("Usage::java XmlLeser path/xmlFilename");
    System.exit(0);      } else {
    xmlFileName = args[0];
    XmlLeser pux = new XmlLeser(xmlFileName);
    }// end main()
    }//endClass

    You need to pass your filename String as a parameter to your functionality. It depends how you're currently set up though. We can't really see the top of your call so it's difficult to determine what you are calling and we don't really know from where you're calling either.
    If you're running standalone, then on launch of the application, you can feed in a file name as an argument that you can read in in String args[] in the main function and pass down to your XML splitter.
    If you're a method in a class that's part of a bigger pile, you can feed the file name as a String to the method from wherever you call from if it makes sense architecturally.
    You might also want to pass down a File object if that makes sense in your current code (i.e. if you're using your file for other purposes prior to the split, to avoid recreating closing/opening for no reason).
    Depends what you're trying to do. If I put together a piece like this, I would probably create an <yourcurrentrootpackage>.xml.splitter package.
    Also, on a side note, you're problem isn't really reading and writing XML in java, but seems more to be making your functionality generic so that any XML file can be split with your code.
    Regards
    JFM

Maybe you are looking for