Preview XMLForms content via KM API

Hello, i have created an application which retrieve my IResources, XML News.
IResourceListIterator iter = list.listIterator();
String str = "";
String text = "";
while (iter.hasNext()) {
IResource ires = (IResource) iter.next();
while (ip.hasNext()) {
BufferedReader in = new BufferedReader(new InputStreamReader(ires.getContent().getInputStream(), ires.getContent().getEncoding()));
while ((text = in.readLine()) != null) {
     str = str + text + "\n";     
I output this in html file and recieve full XML News, how can i render it to NewsBrowser (only header like home->news)
I need to do this via KM API.
Edited by: Nikita Kravtsov on Aug 12, 2008 11:39 PM

Hi Nikita,
in my understanding you wanna display xml forms content via KM API in a HTML output file?
In Content Administration -> KM Content -> etc -> xmlforms -> <your xml forms application> you can find all relevant created XML-Files for a XML Forms Application. According to this there are also some XSL-Files available. These are stylesheet files that will transform you xml-files in an html file.
For more information for xsl see following link:
[http://www.w3schools.com/xsl/]
What you can do now is to get the corresponding XML File (<yourApplication>-GUIModelShow.xml) and the XSL File (<yourapplication>Show.xsl).
To transform it in a HTML File, try the following code sample:
// create XML-File
File xmlFile = new File( new URI("http://<portalpath>:<port>/irj/go/km/docs/etc/xmlforms/<yourapp>/<yourapp>-GUIModelShow.xml") );
// create XSL-File
File xslFile = new File( new URI("http://<portalpath>:<port>/irj/go/km/docs/etc/xmlforms/<yourapp>/<yourapp>-Show.xsl")  );
// create sources for both files
Source xmlSource = new StreamSource(xmlFile);
Source xslSource = new StreamSource(xslFile);
// get new instance of factory class
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans;  
// write HTML-output
FileOutputStream out = new FileOutputStream( "<custom path in KM>" );
// get new transformer for XSL-File
trans = transFact.newTransformer(xslSource);
// transform XML-File to HTML-File
trans.transform(xmlSource, new StreamResult(out));
// flush and close OutputStream
out.flush();
out.close();
I don't know exactly if this will work, but try it out.
Best regards,
Denis

Similar Messages

  • Newly created Image not listed via REST API

    Hi,
    I have created a image in azure console .Its created successfully and i could see the created image under "Image" tab in console.Also, the image created with the name appending current date, it was not before.But when I am trying to list images by
    using the below REST API its listing images except the newly created images that have the  name appended with current date.
    https://management.core.windows.net/5f2fe4c3-23b3-45c0-a70c-9560b79dcf56/services/images
    header values:
    x-ms-version : 2012-03-01
    Content-Type : application/xml
    Host: management.core.windows.net
    This makes me fail to launch new VM via REST api.I got the response as follows
    <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>BadRequest</Code><Message>The image vmyffdd-20140605-813455l does not exist.</Message></Error>
    Please look into this.

    hi,
    From the error, your request parameter was incorrect. I guess your image name may be wrong. How did you write your Image name and url? I suggest you don't forget the '.VHD'. Also,if you use the
    VMImageName element which is only available using version 2014-02-01 or higher
    And I suggest you could try this code sample about how to using REST api to create VM :Simple Windows Azure REST API Sample Tool
    Please try it.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to generate the User-Input XML Body for executing workflows via REST APIs: The Solution

    I see that executing a workflow via REST APIs requires lot of work to be done just to prepare the right User-input XML body. Any mistake and you have some major debugging to do. Larger the number of User-Inputs, the bigger is the problem.Life is so much easier at the WFA GUI with Display names and tooltip help for User Inputs which are very easy for reading and providing the right values. I don't have any such privileges when manually preparing the User-Input XML body.It’s been asked numerous times how to provide User-Input values for type table, or Query (Multi-Select) etc. These are complex User-Input types and has lots of scope for user mistakes.I can have User-input dependency at WFA GUI which allows me to make the right selection, but while preparing my XML body I need to take care of it myself.An operator is allowed to execute workflows, but the same Display names which help him make the right user-inputs, makes it impossible for him to prepare the user-input body xml. Display names can't be used in in XML body and he can't know the exact parameter names by looking at the Display names. So he need to always contact the Admins/Architects for this. And Architects/Admins can't be expected to keep providing User-Input XML body to operators every operator. How about if I could enter all the User-Input values in my workflow execution at WFA GUI, I can do a preview which passed to my satisfaction and then I can magically get the XML body for it which I can use to execute my workflow from REST APIs from any client. It could be so very much easy for me than building my User-Input XML body manually. This is exactly what I'm going to give you right now. You open the WFA in browser, Go to your workflow, Start execution, you input values from GUI reading carefully the display names, preview it to your satisfaction and then get the XML body. Assume your workflow is called “Workflow to Print a given Message”. It’s a simple workflow with only 1 user-input Displayed as "Message to Print" Prerequisites:  The following are the one-time prerequisites. You need PowerShell 3.0 on your WFA server.Import the attached Generate_Workflow_User_Input_Body_in_XML.dar in your WFA. It’s our magical command called "Generate Workflow User Input Body in XML"Add credentials of a WFA Admin/Architect in you WFA itself with Name/IP: localhostMatch: ExactType: OtherName/IP: localhostUsername: <WFA Admin/Architect Username>Password: <User Password>   Steps: Suppose you have a workflow called "Workflow to Print a given Message". You want to execute it from REST apis and need to prepare the user input XML body.  Select this workflow and clone it. The workflow clone is the exact copy of your original workflow word by word, input-by-input. It will open in Edit mode with name "Workflow to Print a given Message - copy".Add the command "Generate Workflow User Input Body in XML" at the beginning of your workflow. This is a must. This command need to be the first command in your cloned workflow.This command requires no input. So for its Parameters just press okay and save the workflow.You are done.Now Execute the clone workflow. You'll see all the user-inputs available to you. Make your choices as you wish. Preview it to confirm that planning is passed and u have no errors.Execute it now.You'll see that the our magical command "Generate Workflow User Input Body in XML" has failed in our clone workflow execution. Don't worry, its fate was decided to be so. But it didn't fail before giving me what I really wanted. i.e. my XML body for my real workflow. It displayed it in the GUI as well as saved it in your WFA server @ C:\temp\<workflow_name_dd_MM_yyyy_hh_mm_ss_.xmlIt also deleted all the reservations of this particular failed job. So NO major residue left to be cleaned.To summarize: Clone Your workflow and Add the command "Generate Workflow User Input Body in XML" as your first command.    Start Execution, provide your User-inputs and preview it. Be satisfied and Press Okay.   Now Execute it.  After a few scconds this cloned workflow will fail with Error "All done. The Workflow will fail now."     See the command execution logs for this command. You'll see the User-Input XML body. It has also saved the XML file at C:\temp in your WFA server.   Have fun. sinhaa  

    Providing a new version 1.1.0 of the command "WFA Schedular" Changes made: Added conditional String Representation based on the Scheduling parameter provided. Provided check for the right number of parameters passed into the command.Added a new parameter "Expiry Date" to automatically stop the recurring execution upon expiry.Check for Posh3.0 version in code.Have Fun!! sinhaa Below example for:Schedule a workflow for recurring execution every alternate day i.e. once in 2 days at 10:30 PM starting 06-Jul-2015 (Today's date is 02-Jul-2015) . The recurring workflow execution  should expire on 31-Dec-2015 and stop.  

  • Access Thread Overview via the api

    Is it possible to access the content of System Administration --> Monitoring --> Portal --> Thread Overview via the api?

    Solution found:
    IPortalMonitor portalMonitor =
                   (IPortalMonitor) PortalRuntime.getRuntimeResources().getService(
                        "com.sap.portal.runtime.application.monitor.PortalMonitor");
              IPSMData psmData = portalMonitor.getIPSMDataInstance();
               * Overviewtype 4 are the threads that are running on the server
              psmData.setOverviewType(4);
              psmData.setMaxLines(100);
              ArrayList alATOs = new ArrayList();
              Hashtable htData = portalMonitor.getMonitorData(request, psmData);
              alATOs = psmData.getData(htData, "TO_");

  • A black airplay info window floats around on my HDTV screen when sending audio content via airplay up to sound system w Apple TV.  How can I get rid of this?

    A black airplay info window floats around on my HDTV screen when sending audio content via airplay up to sound system w Apple TV.  How can I get rid of this?

    Had this happen to me after a recent update, was super annoying.  To turn off, go to Settings > AirPlay > Conference Room Display > Off.

  • To get Document content via RFC

    Hi forum,
    I have a small bsp-application to show documents for a material-number stored in the SAP-tresor (via ftp).
    The SAP-tresor is installed in the core-system, the WEB-AS is another server.
    I developed a remote-enabled function module called get_doc_content_rfc. This function module reads some customizing to get all values for calling the function module CV120_DOC_CHECKOUT_TO_TABLE.
    Now, when I call my get_doc_content_rfc in the core-system, I get the document content via the function module CV120_DOC_CHECKOUT_TO_TABLE. When I call my function module get_doc_content_rfc form the developer-system via RFC in the core-system, the function module CV120_DOC_CHECKOUT_TO_TABLE dosn't deliver the document content.
    In the debugger, I can see, the function module CV120_DOC_CHECKOUT_TO_TABLE opens a ftp-connection to the server with the tresor and then reads the document content. Do I use my function module get_doc_content_rfc in the core-sysem, the ftp-connect can be established. Do I use my function module get_doc_content_rfc via RFC to the core-system, the ftp-connection opend by the function module CV120_DOC_CHECKOUT_TO_TABLE gets a time out.
    Now, my question. what can I do, to get the document content via RFC from the core-system.
    Thank you for help
    Meinolf

    Hi,
    Did you check RFC Adresses in SM59 both of two systems.
    May be different.
    ibrahim

  • Corrupt Credit Note created via DI API

    Hello,
    when i try to create a credit note via di api i get the error message "one of the base documents has been closed", even if the source document is not closed. But this is not the main problem. After this i have a corrupt credit memo in my system, that means a credit memo with out any detail lines. The error occurs only on one customer systems, on a lot of other systems the creation of credit notes works fine. Had anybody the same effect or clue what causes this problem.
    Regards

    Hello we found the problem, i can reproduce it on a belgium database.
    I want you to inform about a critical error in the SBO_SP_TransactionNotification.
    If you check the line data of a document and send an error for this data the front end works fine. But if you use the DI-API the header data of document will be saved and the lines will be not saved.
    if @object_type in ('14','19') and @transaction_type = 'A'
    begin
    declare @corrCRD as varchar(8)
    if @object_type = '14'
    set @corrCRD = (select distinct(correction) from ovtg where code in (select vatgroup from RIN1 where docentry = @list_of_cols_val_tab_del) and correction = 'N')
    else if @object_type = '19'
    set @corrCRD = (select distinct(correction) from ovtg where code in (select vatgroup from RPC1 where docentry = @list_of_cols_val_tab_del) and correction = 'N')
    if @corrCRD = 'N'
    begin
    set @error = 1
    set @error_message = 'You have entered a regular VAT Code on the document, this is not allowed'
    end
    end

  • PO from SO via DI API:Base document card and target document card do not ..

    HI All,
    I am trying to create Purchase Order from Sales Order. This is possible by GUI (on Sales Order on logistics tabs Click On Purcase Orders CheckBox.
    I got the error message: -5002-Base document card and target document card do not match.
    The message itself can be understandable, because the Customer and Supplier has a different CardCode.
    I am sure I am using a correct code
    oPo.Lines.BaseType = BoObjectTypes.oOrders
    oPo.Lines.BaseEntry = sDocEntry
    oPo.Lines.BaseLine = iLineNum
    Where oPo is a Purchase Order document.
    sDocEntry is a Sales Order docentry and iLineNum is a Line number of Sales Order
    For other A/R to A/R and A/P to A/P documents are working fine.
    Has anybody found this error or has anybody created application like this?
    I am using sbo2007PL46
    Regards,
    J.

    Hi guys,
    this is still on the suggestion page:
    Link existing Purchase Orders to (Sales) Orders via DI API : View Idea
    I tryed with 9.1 PL 4 and it didn't work.

  • Creating a Good Receipt PO via DI API No matching records found (ODBC -2028)

    Hi,
    I trying to create a Good Receipt PO via DI API.  It is working when the user I used to log in to SAP via the DI API is a Professional User but when I changed it to a Limited Logistics User, I'm receiving the No matching records found (ODBC -2028). I have already added the SDK Tools license to that user but still I'm receiving that error.
    So is it that the DI API will only work with a Professional User license or I can still use a Limited Logistics User?

    HI J S L,
    I get same error when I use different user that I just now add the SDK Tools without restarting the database server.  But previous user that I added SDK Tools before restart, no error.
    Today
    User 1 - add SDK Tools, no restart, error
    Last Wednesday
    User 2 - add SDK Tools, no restart, error
    Today - database server restarted this morning
    User 2 - no more error
    Both User 1 and 2 are Limited Logistics User.
    Best regards,
    Dennis

  • How to determine host status in a task via python api

    Hello all,
    using the python api I am having some issues trying to determine the status of a host within a task. For example I have a job, with one task and 10 hosts associated with that task. Eight hosts finish the task, 2 fail. However via the api I can only seem to determine the status of the job and the task. What I want is to be able to generate a report that basically matches what you see via the gui (ie 8 hosts ok, 2 hosts failed). The data structure OnStageTaskData gives me a status and a list of hosts, but not a status for each host. (Note I am not using any of the depricated functions/data structures). Currently my code looks like (minus the api init, etc)...
    # list all the jobs for last week
    joblist = api.GetJobs()
    for job in joblist:
    # if the job occured in the last week
    if job.c_time > reportstarttime:
    print "\nJob name %s Time %s " %(job.name, time.ctime(job.c_time))
    try:
    jobdetails = api.GetOnStageJob(job.id)
    except COsApiJobNotFoundException:
    print "Can't find job %s details" %job.name
    continue
    for tasks in jobdetails.job_data.tasks:
    for hostid in tasks.task_data.target:
    try:
    hostinfo = api.GetHostGroup(hostid)
    except OsApiHostNotFoundException:
    print "Can't find host details %s" %tasks.task_data.name
    print "Hostname %s Status %s" %(hostinfo.name, tasks.status)
    which generates output like...
    Job name chg233146-sol9 Time Sun Jan 13 10:31:42 2008
    Hostname tacnomsrv02 Status Failed
    Hostname tacpthsrv01 Status Failed
    anyone have another way to doing this or suggestions? Or is this kind of info not available via the api? Thank you.

    Hi ConnectSolutions,
    As you correctly pointed out, there is some bug in our code
    that keeps the room active and you dont receive any events or
    notification if you are entering as guest and waiting and the host
    arrives. Also, since you havent entered yet i.e your role is still
    5 i.e. UserRoles.LOBBY , you can't access any of the UserManager's
    collections and will get a length of 0 always. We will be fixing
    this with priority .
    But you can get around the problem as of now, by having a
    small shared model of yours ( any collectionNode or sharedModel
    will do) where you create a node and publish a message on it from
    the Owner's side whenever the owner/host enters to notify everyone
    that he has entered. Just remember to set the accessmodel of
    NodeConfiguration of node on which you are publishing to LOBBY ie.
    role = 5 , and make the publishModel = 100 so that only owners can
    publish on this node. In this way , any users waiting will be
    receiving this message and will know the host has arrived. If you
    can't get this sharedModel concept to work, let me know. I will try
    to run on my side.
    And as of our side regarding actual fix, we will fix this use
    case and put in the next drop of SDK and also update in forum about
    it.
    On the host side though, he is always notified when he enters
    if there are pending users knocking to enter. See the KnockingQueue
    example in case you want to explore that.
    Thanks
    Hironmay Basu

  • I have just upgraded from an iPhone 3Gs to an iPhone 5. I am trying to transfer all my content via icloud but having problems logging in - it keeps telling me the server is not responding. Nano sim hasn't yet been registered - does this affect things?

    i have just upgraded from an iPhone 3Gs to an iPhone 5. I am trying to transfer all my content via icloud but having problems logging in - it keeps telling me the server is not responding. Nano sim hasn't yet been registered - does this affect things?

    Have you activated your phone with your carrier yet?

  • Which cable (original apple usb or bmw y) shall i use to connect my 4th gen iPod photo 60 gb to bmw f10 (with com box) is it going to work with the apple usb cable and how long does it take till I can access the 33gb content via the bmw display?

    Which cable (original apple usb or bmw y) shall I use to connect my 4th gen iPod photo 60 gb (old but still working ok) to bmw f10 (with com box), build december 2010 > is it going to work with the apple usb cable and if so, how long does it take till I should be able to access the 33gb content via the bmw display?
    Alternatively: How long does it take if I would have to use the bmw y cable till I can access the 33gb content via the bmw display?

    Which cable (original apple usb or bmw y) shall I use to connect my 4th gen iPod photo 60 gb (old but still working ok) to bmw f10 (with com box), build december 2010 > is it going to work with the apple usb cable and if so, how long does it take till I should be able to access the 33gb content via the bmw display?
    Alternatively: How long does it take if I would have to use the bmw y cable till I can access the 33gb content via the bmw display?

  • Cannot create AR Invoice negative amount with WithHolding Tax negative amount via DI API

    Hi All,
    I tried to create AR Invoice Document via DI API, but with negative amount and negative withholding tax amount.
    Document added successfully, but when i open the document in SAP, and i open WTax Table information, withholding tax amount become zero,
    Please see image below.
    But when i add the same document through SAP Screen, i can fill WTax Amount with negative amount.
    SAP Version 9.0 PL 5
    Please kindly help,
    Thanks
    Best Regards
    Siddharta

    Hello.
    If this is different to the behavior of the B1 application it should be considered a bug - like any such difference between DI API and app.
    HTH

  • I just installed ios8.0 on my iPad, and now I can't preview my content in iBooks Author. What does "No ATC" mean? That's the message I get.

    I just installed iOS 8.0 on my iPad, and now I can't preview my content on iBooks Author. I get the message "No ATC". What does that mean?

    I am geting the same message when updating to IOS-5.  "Please re-insert you SIM, or visit your carrier store to receive a replacement SIM card."  Unfortunately we are stuck as well and I have not found anyone yet to give a solution???  Will end up going to Apple tomorrow :-(

  • Unable to start process via GP API in which group is exposed as input

    Hi,
         I am not been able to start process using GP API for the particular senario.
    I created Process at design time.
    In this process I mapped parameters to a group and exposed this group, So that input is required for initiating the process.
    Now I want to initiate this process via GP API.
    I got sucess in starting processes which takes parameters as inputs or which does not need any inputs, but i was not been able to start process where group is exposed.
    it's giving me GP INVOCATION Exception.
    Please Help ASAP
    Regards,
    Pratik

    Pratik,
    I try to simulate with scenario described by you and I got success with my test.
    Follow my java code:
         public boolean initiateProcessSDN () {
              boolean ret = false;
              try {
                   IUser user = UMFactory.getUserFactory().getUserByLogonID("uces");
                   IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user);
                   IGPProcess processTemplate
                        = GPProcessFactory.getDesigntimeManager().getActiveTemplate(
                                  "8DC0B411957D11DDB7910017F2EBE4A5", userContext);
                   IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
                   IGPStructure params     = GPStructureFactory.getStructure(processTemplate.getInputParameters());
                   params.setAttributeValue("NameGroup", "Pedro");
                   params.setAttributeValue("AddressGroup", "XPTO");
                   IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
                   IGPProcessInstance prInstance
                        = rtm.startProcess(     processTemplate,
                                            "Test 1",
                                            "Test 2",
                                            user,
                                            roles,
                                            params,
                                            user);
                   ret = true;
                   } catch (Exception ex) {
                        ret = false;
              return ret;
    Print screen about my GP design:
    Callable Object with 4 parameters
    http://img530.imageshack.us/img530/16/sdngpgroup001bt5.jpg
    Action grouping CO parameters into 2 groups
    http://img147.imageshack.us/img147/2006/sdngpgroup002xy3.jpg
    Process reflecting these groups as input parameters
    http://img147.imageshack.us/img147/9184/sdngpgroup003pp0.jpg
    Process started by java code above
    http://img530.imageshack.us/img530/8833/sdngpgroup004no4.jpg
    Best Regards,
    Pedro Nunes

Maybe you are looking for

  • Animating Pictures or Text Captions

    Hi Guys Is there any way of getting more animation of Text Captions or pictures, other than simply fading them in?  I know there is the option of setting up and using the 'Text Animations' but I find the text formatting options very limited.  Notwith

  • How to invite people in my calendar on iphone

    I don't see an option to invite people from my calendar event on my iPhone 5. I followed the manual but the option to invite is not there once I hit "edit" on a event. Any help is appreciated.

  • IPhoto stopped working after upgrading to 9.3

    I upgraded to iPhoto 9.3 and iPhoto stopped working.  So I dragged it to the trash and went to reinstall from the original iLife'11. The reinstall finished normally, but when I tried to open iPhoto it instructed me to run Software Update.  I did and

  • The whole audio sync/weird sample rate/drift issue (FCP6)

    I can tell this question is doomed to fail on account of viewing the other unanswered questions on the subject in the forums, but I'll try nonetheless! So yeah, importing longer DV clips....audio rate winds up being 'weird' (as in 48003.9kHz instead

  • Como eliminar contactos del FACETIME en IPAD

    como eliminar contactos del FACETIME del IPAD