How to pretty print XML alerts

Hi!
I'd like to generate mail alerts in OSB which include a XML content. I need XML to be human friendly printed (that is with indentation) but XML is printed in a single line.
Is there any way to pretty print XML content in alerts (and also in alerts emails).
Thank you in advance.

The example of what the OP wants it to look like I thought was quite plain. Its right at the top of the post.
Unfortunately it is also quite difficult to accomplish using System.out.print statements.
You have to print out the root of the tree first (its at the top)
However you don't know how far along to the right you need to print it without traversing the child nodes already (you need to know how deep the tree is, and how far to the left the tree extends from the root)
So you will need to traverse the tree at least twice.
Once to work out the offsets, and again to print out the values.
The working out of offsets would have to be a depth search traversal I think
The printing of the values in this fashion would be a breadth first traversal.
I remember (ages ago) doing a similar assignment, except we printed the tree sideways.
ie the root was on the left, the leaves of the tree on the right of the screen.
That meant you could do an inorder depth traversal of the tree to just print it once.
hope this helps,
evnafets

Similar Messages

  • Pretty printing xml with sql

    Hello
    I have to pretty print xml which is stored in data base column ( clob)
    My table
    create table mytab
    myxml clob);mydata
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Us name="Step">
    <my name ="st">
    <colol name="t"/>
    </my>
    </Us>any idea/suggestion?
    Edited by: user10647455 on Dec 19, 2011 2:04 PM

    Thanks !
    I tired this as well
    select XMLSerialize( document xmltype(myxml) as CLOB INDENT ) from mytab;

  • Pretty-print xml

    Anybody has any idea how can I do a pretty-print of an xml which is stored in the oracle database as CLOB.
    I tried LSSerializer, but could not get it work. I am using jdeveloper10.1.2
    Thanks
    MM

    Have you tried this:
    StringWriter sw = new StringWriter();
    org.apache.xml.serialize.OutputFormat outFormat = new org.apache.xml.
    serialize.OutputFormat();
    outFormat.setIndenting(true);
    outFormat.setIndent(4);
    org.apache.xml.serialize.XMLSerializer xmlser = new org.apache.xml.serialize.XMLSerializer(sw, outFormat);
    try {
    xmlser.serialize(your_document); //replace your_document with reference to document you want to serialize
    catch (Exception ex1) {
    }

  • How to pretty printer of a code in enhance framework of a standard FM

    Hi,
           I have written a code in a <b>enhancement point of a standard Function Module</b>. But i am unable to pretty printer that portion of code. Doed any one have any idea how to do that??
    Thanks & Regards,
    Abhishek Sarkar

    Hi,
    Pritty printer gives a pritty view to your code, so that it can be easily readable.
    You can set the functionality of pritty printer by doing some setting.
    The path for setting is
    Utilities>Setting>ABAP Editor-->Pritty Printer.
    Thanks.

  • Really no way to pretty print XML???

    I wonder if there is really no way to pretty print a DOM, using Java's standard API (http://java.sun.com/j2se/1.4.2/docs/api/index.html).
    What I've tried is (assume having a org.w3c.dom.Document instance doc:
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer transformer = tf.newTransformer();
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");
    transformer.setOutputProperty("encoding", encoding);
    transformer.setOutputProperty(OutputKeys.INDENT,"yes");
    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "3" );
    DOMSource source = new DOMSource(doc);
    FileOutputStream os = new FileOutputStream(file);
    StreamResult result = new StreamResult(os);
    transformer.transform(source,result);which gives, e.g. something like
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <documentData>
    <Asset assetID="229609"/>
       <Picturedescription>
    <Asset assetID="229609"/>
    </Picturedescription>
    </documentData>which is not even proper indent. I can't believe that there is no way in pretty prenting an XML document, using Java's Standard API....
    Does anybody know more about it?
    Urs

    Have you tried this:
    StringWriter sw = new StringWriter();
    org.apache.xml.serialize.OutputFormat outFormat = new org.apache.xml.
    serialize.OutputFormat();
    outFormat.setIndenting(true);
    outFormat.setIndent(4);
    org.apache.xml.serialize.XMLSerializer xmlser = new org.apache.xml.serialize.XMLSerializer(sw, outFormat);
    try {
    xmlser.serialize(your_document); //replace your_document with reference to document you want to serialize
    catch (Exception ex1) {
    }

  • How to Pretty Print a Binary Tree?

    I'm trying to display a Binary Tree in such a way:
    ________26
    ___13_________2
    1_______4 3_________1
    (without the underscores)
    however I cannot figure out the display method.
    class BinaryNode
              //Constructors
              BinaryNode leftChild, rightChild;
    Object data;
         BinaryNode()
    leftChild = null;
    data = null;
    rightChild = null;
              BinaryNode( Object d, BinaryNode left, BinaryNode right)
    leftChild = left;
    data = d;
    rightChild = right;
              //Height
              public static int Height(BinaryNode root)
    if (root == null)
    return 0;
    if ((Height(root.leftChild)) > Height(root.rightChild))
    return 1 + Height(root.leftChild);
    return 1 + Height(root.rightChild);
              //Count
    public static int Count(BinaryNode root)
    if(root==null)
    return 0;
    return 1 + Count(root.leftChild) + Count(root.rightChild);
              //Display
              public static void Display(BinaryNode root)
              int level = 2^(Level(root)-1)
              for (int i = 1; i<Height(root)+1; i++)
              System.out.printf("%-4s%
              Display(root, i);
              System.out.println();
              public static void Display(BinaryNode root, int level)
              if (root!=null)
              if(level==1)
              System.out.print(root.data + " ");
              else
              Display(root.leftChild, level-1);
              Display(root.rightChild, level-1);
              //Level
              public static int Level(BinaryNode root)
              if(root==null)
              return 0;
              if(root.leftChild == null && root.rightChild == null)
              return 1;
              return Level(root.leftChild) + Level(root.rightChild);
    Edited by: 815035 on Nov 23, 2010 12:27 PM

    The example of what the OP wants it to look like I thought was quite plain. Its right at the top of the post.
    Unfortunately it is also quite difficult to accomplish using System.out.print statements.
    You have to print out the root of the tree first (its at the top)
    However you don't know how far along to the right you need to print it without traversing the child nodes already (you need to know how deep the tree is, and how far to the left the tree extends from the root)
    So you will need to traverse the tree at least twice.
    Once to work out the offsets, and again to print out the values.
    The working out of offsets would have to be a depth search traversal I think
    The printing of the values in this fashion would be a breadth first traversal.
    I remember (ages ago) doing a similar assignment, except we printed the tree sideways.
    ie the root was on the left, the leaves of the tree on the right of the screen.
    That meant you could do an inorder depth traversal of the tree to just print it once.
    hope this helps,
    evnafets

  • Printing XML

    Hello ,
    how do I print XML data using Java?
    Example:
    <segmentGroup>
    <segment> a</segment>
    <segment>b</segment>
    </segmentGroup
    PLease help
    thanks

    try reading docs on DOM API..
    and javax.xml.parsers ..
    u can either use any SAXParser or a DOM based parser to parse ur XML file ..

  • Is there better way to do this?  (Xml Pretty Print | node removing)

    Hi all, I have been working at home on a small project to help my Java Jedi training. :-)
    My app saves quotes from authors in an xml file.
    I have a class [XmlRepository extends Thread] that holds control of an xml file to handle requests for Nodes.
    When I remove a node I get a Line Space above the node that was removed, or better put my node gets replaced by a empty line.
    Pretty print or correct Node removing.
    part of my xml is like this (I have resumed it for readability):
        <entities forUser="ffffffff-ffff-ffff-ffff-ffffffffffff">
            <quotes/>
            <authors>
                <author id="f156c570-c676-4d69-9b15-ae7d859ff771" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Poe</lastNames>
                    <firstNames>Edgar Allan</firstNames>
                </author>
                <author id="35dc0c5a-3813-4a10-af49-8d4ea1c2cee0" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Wilde</lastNames>
                    <firstNames>Oscar</firstNames>
                </author>
                <author id="317f72ea-add6-4bd2-8c63-d8b373a830ab" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Christie</lastNames>
                    <firstNames>Agatha</firstNames>
                </author>
                <author id="28047c89-b647-4c40-b6c7-677feaf2dfda" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Shakespeare</lastNames>
                    <firstNames>William</firstNames>
                </author>
            </authors>
        </entities>If I remove A Node ( Edgar Allan Poe (1st in this case)) the resulting Xml when saved is like this (I have added the space indentation just as it is outputted by my code):
        <entities forUser="ffffffff-ffff-ffff-ffff-ffffffffffff">
            <quotes/>
                <author id="35dc0c5a-3813-4a10-af49-8d4ea1c2cee0" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Wilde</lastNames>
                    <firstNames>Oscar</firstNames>
                </author>
                <author id="317f72ea-add6-4bd2-8c63-d8b373a830ab" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Christie</lastNames>
                    <firstNames>Agatha</firstNames>
                </author>
                <author id="28047c89-b647-4c40-b6c7-677feaf2dfda" languageCode="en" regenerateAs="com.fdt.cognoscere.entities.sources.Author">
                    <lastNames>Shakespeare</lastNames>
                    <firstNames>William</firstNames>
                </author>
            </authors>
        </entities>this is how I initialize the XML DOM Handlers, and the method for removing a Node:
         * Initializes factory instances and member variables.
        private void initialize() {
            //obtain an instance of a documentFactory create a document documentBuilder
            this.documentFactory = DocumentBuilderFactory.newInstance();
            //Configure the documentFactory to be name-space aware and validate trough an xsd file
            this.documentFactory.setNamespaceAware(true);
            this.documentFactory.setValidating(true);
            this.documentFactory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
            try {
                //obtain an instance of an XPathFactory
                this.xpathFactory = XPathFactory.newInstance(XPathFactory.DEFAULT_OBJECT_MODEL_URI);
                //obtain an instance of the xpath evaluator object
                this.xpathEvaluator = this.xpathFactory.newXPath();
                //set namespace mapping configurations
                NamespaceContextMap namespaceMappings = new NamespaceContextMap();
                namespaceMappings.put("xml", "http://www.w3.org/XML/1998/namespace");
                namespaceMappings.put("xmlns", "http://www.w3.org/2000/xmlns/");
                namespaceMappings.put("xsd", "http://www.w3.org/2001/XMLSchema");
                namespaceMappings.put("xsi", "http://www.w3.org/2001/XMLSchema-instance");
                namespaceMappings.put(this.schemaNamespaceMapping, this.schemaNamespace);
                //add mappings
                this.xpathEvaluator.setNamespaceContext(namespaceMappings);
            } catch (XPathFactoryConfigurationException ex) {
                Logger.getLogger(XmlRepository.class.getName()).log(Level.SEVERE, null, ex);
            try {
                //obtain a trasformer factory to save the file
                this.transformerFactory = TransformerFactory.newInstance();
                this.transformerFactory.setAttribute("indent-number", 4);
                //obtain the transforme
                this.transformer = this.transformerFactory.newTransformer();
                //setup transformer
                this.transformer.setOutputProperty(OutputKeys.METHOD, "xml");
                this.transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                this.transformer.setOutputProperty(OutputKeys.MEDIA_TYPE, "text");
                this.transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
            } catch (TransformerConfigurationException tcex) {
                Logger.getLogger(XmlRepository.class.getName()).log(Level.SEVERE, null, tcex);
         * Removes a node by evaluating the XPATH expression.
         * @param xpath A String instance with the XPATH expression representing the element to remove.
         * @throws com.fdt.cognoscere.storage.exceptions.UnableToRemoveException When an exception occurs that prevents the repository to execute the remove statement.
        public void removeNode(final String xpath) throws UnableToRemoveException {
            Node nodeToRemove = null;
            Node parentNode = null;
            //verify xpath
            if (xpath == null)
                throw new IllegalArgumentException("The xpath argument cannot be null.");
            //verify that the repository is loaded
            if (!this.loaded)
                throw new IllegalStateException("The XmlRepository faild to load properly and it is in an invalid state. It cannot perfom any operation.");
            try {
                //get the node to remove out of the xpath expression
                nodeToRemove = this.getNode(xpath);
                //throw an exception if no node was found to remove
                if (nodeToRemove == null)
                    throw new UnableToFindException("The node element trying to be remove does not exist.");
                //obtain the parent node to remove its child
                parentNode = nodeToRemove.getParentNode();
                //remove the node from the parent node
                nodeToRemove = parentNode.removeChild(nodeToRemove);
            } catch.......removed to save space{
            } finally {
                //normalize document
                this.document.normalize();
        }Please tell me if I could do this better,
    thanks,
    f(t)

    franciscodiaztrepat wrote:
    When I remove a node I get a Line Space above the node that was removed, or better put my node gets replaced by a empty line.Replaced? No, there's already a new-line character after the node that was removed. And there was one before that node too. You didn't remove either of those, so after the removal there are two consecutive new-line characters. As you can see.
    And no, trying to pretty-print the XML document won't remove any of those. It might add whitespace to make the document nicely indented, but it won't ever remove whitespace. If you want whitespace removed then you'll have to do it yourself.
    For example, after you remove a node, also remove the node following it if it's a whitespace text node. Or something like that.

  • Xerces 2.6, setIndent(0), 1.4.2 not working. XML always pretty printing

    Hello.
    I would like to take a string that contains xml and strip out all new lines, whitespace between tags, etc. So basically everything will be on one line.
    So I thought one simple way would be to run an XMLSerializer or use a Transformer. However, it's turning out to be a nightmare. I probably could have written a parser already. :)
    I've tried all possible combinations of
    XMLSerializer
    outputFormat.setIndenting(false)
    outputFormat.setIndent(0)
    outputFormat.setLineWidth(0)
    Transformer
    transformer.setOutputProperty("indent", "no")
    transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "0");For some reason, my XML is always pretty printed. And I can't figure it why. I was able to get the XMLSerializer version all on one line with an indent of 1, but the minute I switch to 0 it gets pretty printed.
    Here's some Transformer code I'm using:
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse( new InputSource( new StringReader(input)) );                      
    DOMSource source = new DOMSource(doc);
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "no");
    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "0");
    transformer.transform(source, new StreamResult(System.out));Output:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <trans_data>
      <input_data>
        <cc>1</cc>
      </input_data>
    </trans_data>I've tried both 2.6.2 and 2.5.0 of Xerces and my classpath only has XercesImpl.jar and xml-apis.jar in it. I'm using 1.4.2-07.
    Thanks,
    -- Jason

    public class XMLPrinter
         private static final String CLASSNAME = "XMLPrinter(): ";
         public static String print( String input )
            String methodName = "print(): ";
               String output = "";
            try
                DocumentBuilderFactory docBuilderFactory =
                    DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder =
                    docBuilderFactory.newDocumentBuilder();
                Document doc = docBuilder.parse(
                    new InputSource( new StringReader(input)) );
                StringWriter stringWriter = new StringWriter();
                OutputFormat format = new OutputFormat( doc );
                                                 format.setIndenting( false );
                format.setLineWidth( 0 );
                format.setIndent( 0 );
                XMLSerializer serializer =
                   new XMLSerializer( stringWriter, format );
                serializer.serialize(doc);
                output = stringWriter.toString();
            catch (Exception e)
                output = null;
            return output;
         public static void main(String[] args)
            String XML =
            "<xml> <output>junk</output>    <output2>junk2</output2>\r\n<output3>output3</output3>\r\n</xml>\r\n";
            System.out.println(XMLPrinter.print(XML));
         }returns
    <?xml version="1.0" encoding="UTF-8"?>
    <xml> <output>junk</output>    <output2>junk2</output2> <output3>output3</output3> </xml>Switching to
    format.setLineWidth( 0 );
    format.setIndenting( true );
    format.setIndent( 10 );returns
    <?xml version="1.0" encoding="UTF-8"?>
    <xml>
              <output>junk</output>
              <output2>junk2</output2>
              <output3>output3</output3>
    </xml>

  • Xml formatting (pretty print, etc)

    Our MXML is getting a bit messy. (we also need a pretty
    printer and simple
    xml exploration and editing) for soap feeds.
    1. Is there something in Eclipse now that does this?
    2. Is there a publicly available plug-in
    3. Is there some simple (i.e. cheap or free tool) for doing
    this. XMLSpy
    would be overkill.

    Excellent directions, Yes, this is exactly what I needed to
    know. It now
    works fine.
    Only one item to note. Even though I did not set XMLBuddy as
    the default for
    *.mxml
    -- If I do the context menu (right click) and choose xml
    buddy, then it will
    stay sticky for that file the next time. The same as with
    using the
    FlexBuilder mxml editor. Not a real problem but what does
    "default" mean any
    more if the IDE is trying to be so smart as to decide for me
    what my default
    should be :-)
    "Mark Shepherd" <[email protected]> wrote in message
    news:[email protected]...
    > There is no XML or MXML formatting built-in to
    FlexBuilder or Eclipse.
    >
    > But don't despair, there are 100's of plugins available
    for eclipse, here
    > is one way that works...
    >
    > 1. install the XMLBuddy eclipse plug-in from
    xmlbuddy.com
    > 2. in flexbuilder, go to Window > Preferences >
    General > Editors > File
    > Associations
    > 3. select *.mxml in the top panel, then click "Add" in
    the bottom panel
    > 4. choose XMLBuddy, then OK, then OK
    >
    > You can now open any MXML file using the XML editor
    (xmlbuddy) rather than
    > FlexBuilder's normal MXML editor. To do this, select the
    file in the
    > Navigator panel, then right-click and choose Open With
    > XMLBuddy. Once
    > you are in the XML editor, you can select a range of
    text (or the entire
    > file, if you like) and choose Format from the XML menu.
    >
    > This technique will work for any XML-based file format,
    including MXML,
    > soap documents, RSS feeds, etc.
    >
    > There are probably other way to do this. Does anybody
    have other
    > suggestions?
    >
    > Mark Shepherd
    > FlexBuilder Engineering
    >
    >
    > Yechezkal Gutfreund wrote:
    >> Our MXML is getting a bit messy. (we also need a
    pretty printer and
    >> simple xml exploration and editing) for soap feeds.
    >>
    >> 1. Is there something in Eclipse now that does this?
    >>
    >> 2. Is there a publicly available plug-in
    >>
    >> 3. Is there some simple (i.e. cheap or free tool)
    for doing this. XMLSpy
    >> would be overkill.
    >>
    >>

  • How rman backup messages printed in alert file?

    surprised how the messages of rman getting printed in alert file?
    i am using 10.2.0.4 on AIX and using veritas net backups.....from rman.....
    ORA-19624: operation failed, retry possible
    ORA-19506: failed to create sequential file, name="c-1650503797-20091118-0c", parms=""
    ORA-27028: skgfqcre: sbtbackup returned error
    ORA-19511: Error received from media manager layer, error text:

    Raman wrote:
    Well. i agree. we have logs to capture media backups....so wanted to cut only these media backups failure out of alert file...else what is happening here is our monitoring reports these as alerts as already we know from media backup logs...So why not modify your monitoring of the alert log to exclude that particular error?
    Personally, I'd allow both systems to continue to report the error from their perspective.
    >
    in nutshell...just exploring any options to turn off the media backup failures like any rman parameters or can anything to do with veritas parameters?
    Anyway thanks to all for your valuable opinions.
    Thanks,
    Raman.

  • How to print XML report in French Language?

    Hi,
    I need to print XML report in French language, currently it display in English language.
    I have used following steps:
    1. I enabled French language on my oracle apps instance.
    2. Created the concurrent program with output type as XML
    3. Created Data Definition using XML Publisher Responsibility
    4. Created template. At the time of creation of templete, enabled Translatable check box and click Apply
    5. Once template is uploaded, you will find two buttons. Export Translation and Upload Translation.
    6. Clickd on Export Translation. XLF file opened.
    7. In XLF file - e. g. source-language="en-US" target-language="fr-FR".Source is English and fr is for French language and FR is territory.
    8. Update the target fields in French language. In the below example source field is in English language and target is in French language. This indicates that wherever the Invoice Date is present in RTF template it will be
    replaced by the target field in french language.
    <source>Invoice Date:</source>
    <target>Date de facture:</target>
    9. Updated the same for all fields and finally import the updated translation file.
    10. But When i run report , output display in English not in French.
    Please any one can help, what should in do next to print in French Language.
    Thanks,
    Sunil Mane
    Edited by: 973411 on Nov 30, 2012 6:56 AM

    Are you selecting the Template at the time of Program submission?
    Check in the Options while submitting the Program

  • Turn off 'pretty print' output from XLST processor

    How do I turn-off the "pretty-print" type output that the XSLT processor seems to generate? The XSLT processor seems intent on generating very pretty xml markup, all nicely indented. The problem is that if the markup is XHTML and you are feeding it to browsers they render things quite differently based on the white space between tags...annoying, but true. I have struggled with every swicth I could find on the parsers/processor or embedded in tags in the XSLT files....but nothing seems to work. All I want to do is have the markup I have created in the XSLT template be output 'as is' with the exception of any <xsl:> tag data substitution. How do I do this so things render correctly in my browser i.e maintain the white space and formatting I used in creating the XHTML tags?

    The only way that <xsl:output indent="no"> can behave as you are seeing is:
    (1) You're using a release before 2.0.2.6
    (2) Your program calls the processXSL()
    that returns a DocumentFragment instead
    of the one that writes to a PrintWriter
    (3) You are using our .\sample\XSLSample
    program which calls the processXSL
    to get a DocumentFragment (not the
    one that writes to the PrintWriter)
    Are you saying that our command-line oraxsl
    for version 2.0.2.6 on your stylesheet
    which includes <xsl:output> in the correct location in the stylesheet (outside of
    any template but inside the "top-level"
    <xsl:stylesheet> element) is not
    working properly? If so, will need
    a simple testcase.
    null

  • BODS 3.1 : How to trigger an email alert for the jobs on BODS server ?

    Hi All.
    I have this request.
    BODS 3.1 : How to trigger an email alert for the jobs on BODS server ?
    We have jobs scheduled on BODS running smoothly and absolutely fine.
    But to check, i am logging into the admin console and check for the jobs status.
    I would like to have an email to be received from BODS after each job is finished.
    It could succuessful. Or it could fail.
    Whatsoever, i wish to receive an email alert as soon as a job is finished.
    Can anyone advise me as to whether this could be made possible.
    And if yes, how this could be done.
    Thanks for your help in advance.
    In BOE CMC / for webi / schedule / we find an option to send email for a job success or a job failure.
    Is there any option similar to that in BODS ?
    Also would like to know :
    how to use the smtp_to or mail_to functions ?
    how to set up the smtp server for this ?
    thanks
    REgards
    indu
    Edited by: Indumathy Narayanan on May 31, 2011 3:47 PM

    Hi.
    Since am new to this BODS. I need some help.
    I already have many jobs which are running absolutely fine.
    And when a job runs, and finishes, am able to see the trace saying
    e.g. :
    Job_abc is completed successfully.
    We got the smtp service activated for our test server.
    and we hae a group email id.
    I have put the details of the smtp server / ip address / and said apply restarted.
    The i created a simple test script as below :
    print (' Before email ' );
    smtp_to('abc@company_name.com', 'Job ' || job_name() ||' on ' || host_name() || ' has FAILED',
    ' the job has failed', 0, 0);
    print('After Email ');
    It does send a email to as per smtp_to whatever email is specified.
    But how to differentiate between a job success
    And a job which has failed.
    I wish to have a mail which says on the subject :
    'Job ' || job_name() ||' on ' || host_name() || ' has completed successfully'
    ==> IF it is a success
    OR
    'Job ' || job_name() ||' on ' || host_name() || ' has failed'
    ==> if it has failed
    How to make the system identify, whether
    to send a success message or a error message whatever
    Could anyone advise.
    thanks
    indu

  • YES! How to make PRINT QUOTAS WORK with 10.4

    How to make PRINT QUOTAS WORK in 10.4
    After struggling for quite some time, I finally found a pretty simple way to make print quotas work.
    First, I’ll tell you our setup. We have 3 different computer centers with a variety of eMacs and new Intel iMacs, all clients are running 10.4.8, and each of those 3 centers has its own HP Laserjet 4200 printer. Our dual G5 server is running Server v.10.4.8. Client computers and printers have static IP addresses. All clients are bound to the server with the standard WorkGroup Manager/ LDAPv3 Directory Access scheme - such that all students login to the clients with their network username/password to mount their home directory on the client.
    Next, I’ll tell you what does not work. IF YOU WANT PRINT QUOTAS TO WORK, you cannot use Workgroup Manager to assign a printer to any managed user account, user group, or computer group. Why? Because when you go to a client, and Show Info on the printer that is being pushed by Workgroup Manager, you’ll see that the queue name is not the queue that you’ve setup in Server Admin. Instead, you’ll see the queue name is “MCX” or something along those lines. Even if you manually edit the Workgroup print preference file that is being pushed to clients, it still will not work.
    Drawbacks of my technique: In my case, students will see all 3 printers (1 from each lab) available to them no matter which lab they are in. Not the best, but for now I think it’ll be worth it to be able to control wasteful printing. Students may be able to move/delete the preference file (see below), but they’ll only be hurting themselves, as they won’t have any printers at all then.
    Okay, here’s how I did it:
    1. If you have setup any printers to be pushed out via Workgroup Manager’s preference enforcement to individual users, usergroups, or computer groups, turn those preferences off and leave them off.
    2. Delete any existing printers in your Printer Setup Utility and/or Server Admin. Add and setup a new printer queue using the Server Admin> Print service. I added the printer through the Server Admin application, not Printer Setup Utility (may not matter). However, I did go into that latter utility to set the model of the printer. Now, back in Server Admin, edit the printer queue to turn on these services IPP, LPR (bonjour off), and of course check off the enforce quotas box. (No student Windows clients, so I didn’t tinker with SMB print service). I went ahead and specified the standard cover sheet – it will be handy while troubleshooting.
    3. In Workgroup Manager, select the users that you want to enforce quotas upon, go to the Printer Quota tab (not the preference pane) and, in my case, I selected All Queues and specified a quota, and clicked Save.
    4. Delete all printers that appear in the Printer Setup Utility from each client computer (I know, UGH).
    5. For all network users, you need to edit a preference file and put it into each user’s home directory. That file is “com.apple.print.favorites.plist” and as you guessed, it needs to go into the Library> Preferences folder of every one of your network users’ home directories. Now, the content of that file is crucial… what it should show is the name of the queue(s) you created in Server Admin above, and be immediately followed by an “@” and the address of the server that is hosting that queue. For example, my queue’s name is TCStudentQ and the server’s address is student.mydomain.org… so my preference file has this entry: [email protected]. If you have more than one queue, you’ll have more entries. Be sure that the network user has at least Read level access under Group or Others. I’d recommend making the server System account the Owner of the file, and be sure to lock the file so the users can’t easily trash it. If you don’t know how to create this file in the first place, what you can do is go to a client computer, and log into the client with a dummy network account. Then open Printer Setup Utility, and you should see the queue you created in step 2. Add that printer, and then the file will be created in your dummy account’s home directory under Library> Preferences. Now you can use that file to distribute to other user’s folders… but don’t forget that each user needs Read level access.
    6. That’s it. Works for me. When they exceed the quota, all that spits out is the cover page. It’d be nice if there was a quota monitor utility on the client side so users can see how many pages they have remaining and when the quota will automatically reset. I plan to start the quota on a Monday morning and go on a weekly duration. Not sure what a good starting point is… perhaps 25 pages every school week.
    7. Hey Apple Computer, Inc. Server Developers & Project Managers, I truly hope you’re reading this and can explain why print quotas don’t function as you have documented and advertised. I don’t mean to toot my own horn, but I’ve spent way too much time discovering this workaround, and I know it will help thousands of others with the same problem. I can see where your Print Quota system breaks down, and I think you need to fix these issues or at least document them. Don’t forget to fix serious 10.4 Server bugs before leaving it behind for 10.5 Server – many of us will continue using 10.4 Server for at least another year or two.

    David,
    Your assumption that I didn't read the documentation is incorrect. I read that 10.4 documentation over and over - followed it to the letter to no avail. Perhaps it was updated in the last few weeks? So, do you have a fully operable printer quota system in conjunction with a managed computer or user group that has a managed printer pushed to the group via Workgroup Manager? I can push a managed printer to a managed group without a problem, but the quotas won't be enforced unless I use the workaround above and cut Workgroup Manager's managed/pushed printer out of the picture.
    I know this is a user-to-user forum - however, I'm also aware that Apple tech support often chime in here, so it doesn't hurt to post a message to them in the context of a larger posting about a 'known issue'. I have used the server feedback form... hasn't seemed to me to be very helpful in the past.

Maybe you are looking for

  • Apple newbie with dummy question

    I have a question about my 3 day old Core Duo. I'm connecting just fine and love my machine, but before I go paying bills/banking/etc online, I want to make sure my connection is secure. I'm connecting wirelessly via a Lynksis WRT54G router. The very

  • Calendar SDK on Win XP

    Hi, I have problems to run my java program on XP to access the calendar via calendar sdk. I got the error message: java.lang.UnsatisfiedLinkError: C:\Java\Calendar\capi\java\csdkjni.dll: %1 is not a valid Win32 application Any idea what could be happ

  • Resend 'successful' messages from message monitering

    Hi All I have a situation where i have to resend some of the messages which are successfully processed by XI. In message monitoring, when i select the required message and click on 'resend' button, i get this message: 'Unable to schedule 1 of 1 messa

  • System programming in Java

    Hai!!! Actully I'm working in Automatic distinction between the system progam & application programs. Is there any samples/source code of the system programs available in java???is it possible to distiguish between the system program & Application pr

  • Running OS Command on NT from a pakage

    Hi every body, I want to write a pakage that contain - a procedure to run an OS commnad on NT platform. - and another procedure that copy a table to a text file on NT disk Can you help me?????