Automating a Parse-and-Email Process

I have a 100-page report in Adobe Acrobat Pro 10. Each page includes a distinct email address and is intended for a distinct recipient. I need to extract each page from the report as a separate pdf file, rename each page with the email address contained within it and email each page separately in MS Outlook 2010.
If anyone has already written a script for this sort of task, I'd greatly appreciate seeing it! Otherwise, where should I begin in trying to automate this process? I figure its most appropriate to write a program to do this for me, if so, which language should I use?
Thanks!

AppleScript can do stuff like this, although you will need to be a bit more specific about your data formats. I read that your desired script will:
1) Read a specified (or asked for) data file;
2) Get specified (or asked for) file names;
3) Find a match between some part of a record in the data file and some part of a file name;
4) On a match, append a description text specified in the record to the file name;
5) Move the renamed file to a location specified in the record.
You will need to define the format of the records in the data file, including the line endings and item delimiters, and the various portions of each record that will be used. Other items that need some clarification are things like error handling, such as what if there is a file with the same name in the destination folder or what if a record does not have all of the items.

Similar Messages

  • Automate and email process report ??

    anyone know if there is a way to schedule (automate) the process monitor report and email it ??

    Hello,
    Both scripts are contained in the FDM Accellerators section in the workbench; and can be scheduled via the FDM TaskManager or 3rd party TaskManager via upsShell.exe
    Thank you,

  • Fully automated report generation and email

    I am trying to get a report (from a query) to run automatically every Tuesday morning.
    This is my job
    BEGIN
         dbms_scheduler.create_job (
              job_name          => 'GEN_XLS_RPT_AND_EMAIL',
              job_type          => 'STORED_PROCEDURE',
              job_action          => 'gen_bomreport_proc',
              start_date          => to_timestamp('05-12-2009 07:00','DD/MM/YYYY HH24:MI'),
              repeat_interval     => 'FREQ=DAILY; BYDAY=TUE; BYHOUR=7',
              enabled               => true,
              comments          => 'Weekly CSV Reports Output at 7:00AM'
    END;Then I have a procedure
    PROCEDURE gen_bomreport_proc IS
    DECLARE
        l_id number;
        l_document BLOB;
    BEGIN
         l_document := APEX_UTIL.GET_PRINT_DOCUMENT (
              p_application_id          => 109,
              p_report_query_name          => 'qry_Report_1week',
              p_report_layout_name     => 'qry_Report_1week',
              p_report_layout_type     => 'application/excel',
              p_document_format          => 'xls'
         l_id := APEX_MAIL.SEND (
              p_to        => 'to@me',
              p_from      => 'from@you',
              p_subj      => 'Weekly Report',
              p_body      => 'Please review the attachment.',
              p_body_html => 'Please review the attachment'
       APEX_MAIL.ADD_ATTACHMENT (
           p_mail_id    => l_id,
           p_attachment => l_document,
           p_filename   => 'report_' || to_char(sysdate-8, 'YYYY') || '_' || to_char(sysdate-8, 'DD-MM') || '-' || to_char(sysdate-1, 'DD-MM') || '.csv',
           p_mime_type  => 'application/excel');
    END;And the query that is supposed to get ran to generate the report saved as 'qry_Report_1week'
    SELECT organization_name, quote_description, quote_name, quote_pwd, user_id, contact_last_name || ', ' || contact_first_name contact_name,
      email, create_date, qty, unit_price, ext_price, discount_percent, company_name, item_no, supplier_name, product_category, mfg_part_no,
      quote_id, customer_id, exalt_user_id
    FROM bom_detail_cdw2
    where create_date BETWEEN sysdate-8 and sysdate-1 order by create_date;I tried running the job
    begin
    DBMS_SCHEDULER.RUN_JOB (
       job_name => 'GEN_XLS_RPT_AND_EMAIL',
       use_current_session => false);
    end;I read a lot about scheduler, APEX_UTIL.GET_PRINT_DOCUMENT and APEX_MAIL.ADD_ATTACHMENT, but I'm sure I missed something. Any help would be appreciated... Thanks

    Thanks Vorlon, your link was a bit helpful.
    Alright, I am making progress, but have had to come up with an alternative to the Report Query as found out that you need BI and we don't (and won't) have that.
    Option 1: dump the query result in a csv file
    Problem: I can't attach the csv to the email
    CREATE OR REPLACE PROCEDURE gen_bomreport_proc
    AS
         l_report  BLOB;
         f_report  UTL_FILE.file_type;
         bomdata_buf VARCHAR2(24000);
         bomdata_header VARCHAR2(512);
         l_id number;
         CURSOR bomdata_cur IS
              SELECT * FROM BOM_DETAIL_CDW2
              where create_date BETWEEN (sysdate-8) and (sysdate-2) order by create_date;
    BEGIN
         -- Create and populate file
         f_report := UTL_FILE.fopen ('TESTDIR','bom_output.csv', 'W');
         bomdata_header := 'Organization,Description,Quote Name,Quote PWD,User ID,Email,Created,QTY,Unit Price,Ext Price'||
              ',Disc. %,Address,' || 'Item No,Mfg Part No,Contact Name,Supplier Name,Product Category,Quote ID,Customer ID,Exalt User Id' || chr(10);
         UTL_FILE.PUT_LINE(f_report, bomdata_header);
         FOR bomdata_rec IN bomdata_cur LOOP
              bomdata_buf := bomdata_rec.organization_name || ',' || REPLACE(bomdata_rec.quote_description,',','') || ','
              || bomdata_rec.quote_name || ',' || bomdata_rec.quote_pwd || ',' || bomdata_rec.user_id || ','
              || bomdata_rec.contact_first_name || ' ' || bomdata_rec.contact_last_name || ',' || bomdata_rec.email || ','
              || bomdata_rec.create_date || ',' || bomdata_rec.qty || ',' || bomdata_rec.unit_price || ',' || bomdata_rec.ext_price
              || ',' || bomdata_rec.discount_percent || ',' || bomdata_rec.company_name || ',' || bomdata_rec.item_no || ','
              || bomdata_rec.supplier_name || ',' || bomdata_rec.product_category || ',' || bomdata_rec.mfg_part_no || ','
              || bomdata_rec.quote_id || ',' || bomdata_rec.customer_id || ',' || bomdata_rec.exalt_user_id;
          UTL_FILE.PUT_LINE(f_report, bomdata_buf);
        END LOOP;
         -- Part where I convert UTL_FILE.file_type into a BLOB and store in l_report ?? --
         UTL_FILE.FCLOSE(f_report);
         -- End
         -- email part - I'm ok here
    END;ok, so there's a line:      -- Part where I convert UTL_FILE.file_type into a BLOB and store in l_report ?? -- which I have searched for, to no avail
    Option 2: dump the query result in a BLOB
    Problem: I need to write strings/literals into the BLOB, but it keeps throwing the error PLS-00382: expression is of wrong type, when I write something like:
    DECLARE
         l_report BLOB;
         bomdata_buf VARCHAR2(24000);
         bomdata_header VARCHAR2(24000);
    BEGIN
         bomdata_header := 'Organization,Description,Quote Name,Quote PWD,User ID,Email,Created' || chr(10);
         l_report := bomdata_header;
    END;

  • File system usage report chart generation - automated via reports and email

    Hello,
    I have requirement where I have to generate a monthly file system usage chart (just like a tablespace total_mb, used_mb, free_mb....) and mail it directly to the client.....
    Any ideas or suggestions would be welcome....
    Thanks,
    S.

    It's a pretty open-ended question, because a number of things can be causing slow performance.  You mention needing to look at ODBC connection performance - I found that using ODBC drivers for iSeries was very slow in the past.  You might want to look at using the JDBC driver in the IBM JTOpen Toolkit - it made a big difference for us when we were querying iSeries in the past.
    When you refer to "reports" in this thread's title, do you mean reports from ColdFusion Report Builder?  Or to just ColdFusion .cfm pages?  How complex are these reports?  How much information is displayed, especially in tabular form?  Just rendering huge HTML tables (as in thousands of rows of data) will often cause browsers to become temporarily unresponsive or hang.  If you provide more details, we might better be able to target where the "pain point" really is.
    -Carl V.

  • I want to write a script or Automator workflow/app that emails a random shortcut of the day to three recipients. The source is from an Excel spreadsheet. One column is the shortcut, and the second column is the definition. Anyone have experience?

    I want to write a script or Automator workflow/app that automatically emails a random shortcut of the day to three recipients. The source is from an Excel spreadsheet. One column is the shortcut, and the second column is the definition. Anyone have similar experience and know that this would work?

    I have had a first stab at the script, below.  It uses a file to store the shortcuts and command [descriptions].  You should be able to see from the script annotations how to add a new one.  (I populated 1-4 with real data, but got lazy after that, so you have a few placeholders to work with first.
    As I have noted, once you are happy that you have all the data in the file, you can comment out part of the script for ongoing use.  (BTW, my reluctance to use Excel is that I don't currently have it installed and I don't want to offer wrong advice.  If you have Numbers, I do have that and could probably modify to work with a spreadsheet from there.  This might be especially useful if you have the data already sitting in Excel.)
    A few things came-up whilist I was writing the script:
    1.     Currently, all recipients will not only get the same tip at the same time, but they will see the names and email addresses of the others who receive them.  It is possible to modify this.
    2.     I have added a property gRandomCheck which keeps track of which shortcut has already been used (since the last time the script was compiled.  This will prevent the same tip being sent more than once.    When all tips have been sent once, the script will alert you and not send anything until reset.  It does not check on a per-addressee basis (which would be a refinement).  (If you add a new addressee at this stage, the whole process will start again, and you may not really want this to be the behaviour.)
    3.     The way that I have built the list, commandList, is deliberately cumbersome - it's for the sake of clarity.  If you prefer, you can construct the whole list as {{shortcut:"X", command:"X"}, {shortcut:"Y", command:"Y"}}
    Have a look - I am sure you will have questions!
    SCRIPT STARTS HERE  Paste the following lines (thru the end) into a new AppleScript Editor document and press RUN
    --The property gRandomCheck persists between runs and is used to stop sending the same hint twice.
    property gRandomCheck : {}
    --I am defining a file on the desktop.  It doesn't have to be in this location
    set theFolder to path to desktop
    set commandFile to (theFolder as text) & "CommandFile.csv"
    --(* Unless you need to change the file contents you do not need to write to it each time.  Remove the "--" on this line and before the asterisk about 18 lines below
    --Follow this format and enter as many records as you like on a new line - each with a unique name
    set record1 to {shortcut:"Z", command:"Undo"}
    set record2 to {shortcut:"R", command:"Record"}
    set record3 to {shortcut:"⇧R", command:"Record Toggle"}
    set record4 to {shortcut:"⌘.", command:"Discard Recording & Return to Last Play Position"}
    set record5 to {shortcut:"X", command:"x"}
    set record6 to {shortcut:"X", command:"x"}
    set record7 to {shortcut:"X", command:"x"}
    set record8 to {shortcut:"X", command:"x"}
    set record9 to {shortcut:"X", command:"x"}
    set record10 to {shortcut:"X", command:"x"}
    set record11 to {shortcut:"X", command:"x"}
    set record12 to {shortcut:"X", command:"x"}
    set record13 to {shortcut:"X", command:"x"}
    --Make sure you add the record name before randomCheck:
    set commandList to {record1, record2, record3, record4, record5, record6, record7, record8, record9, record10, record11, record12, record13}
    --This part writes the above records to the file each time.
    set fileRef to open for access commandFile with write permission
    set eof of fileRef to 0
    write commandList to fileRef starting at eof as list
    close access fileRef
    --remove "--" here to stop writing (see above)*)
    --This reads from the file
    set fileRef to open for access commandFile with write permission
    set commandList to read fileRef as list
    close access fileRef
    --Here's where the random record is chosen
    set selected to 0
    if (count of gRandomCheck) is not (count of commandList) then
              repeat
                        set selected to (random number from 1 to (count of commandList))
                        if selected is not in gRandomCheck then
                                  set gRandomCheck to gRandomCheck & selected
                                  exit repeat
                        end if
              end repeat
    else
              display dialog "You have sent all shortcuts to all recipients once.  Recompile to reset"
              return
    end if
    --This is setting-up the format of the mail contents
    set messageText to ("Shortcut: " & shortcut of record selected of commandList & return & "Command: " & command of record selected of commandList)
    tell application "Mail"
      --When you're ready to use, you probably will not want Mail popping to the front, so add "--" before activate
      activate
      --You can change the subject of the message here.  You can also set visible:true to visible:false when you are happy all is working OK
              set theMessage to (make new outgoing message with properties {visible:true, subject:"Today's Logic Pro Shortcut", content:messageText})
              tell theMessage
      --You can add new recipients here.  Just add a new line.  Modify the names and addresses here to real ones
                        make new to recipient with properties {name:"Fred Smith", address:"[email protected]"}
                        make new to recipient with properties {name:"John Smith", address:"[email protected]"}
      --When you are ready to start sending, remove the dashes before "send" below
      --send
              end tell
    end tell

  • I am using a MacBook Pro.  I simply cannot find a way to attach images adjusted in Lightroom as attachments and/or without massive degradation in quality.  I follow the LR attach email process as specified by LR, the photos appear in the email seemingly e

    I am using a MacBook Pro.  I simply cannot find a way to attach images adjusted in Lightroom as attachments and/or without massive degradation in quality.  I follow the LR attach email process as specified by LR, the photos appear in the email seemingly embedded and the recipients of the email cannot save the attachment.

    You are welcome.  Just finished a chat session with an Apple support rep and confirmed the matte option no longer available.  Seems lots has changed since I bought my 17” 19 months back:).  They did say that there were after market screen films available from places like amazon
    Have never used anything like that though.  My wife has a 2008 MBP 15” with gloss and I can say it is a nice screen finish, you just have to be careful of lighting from behind you.  All my iMacs were glossy and I did learn to compensate for the added brilliance the screen brought to the photos.  The new soft proofing feature of LR5 seems to better estimate the level of brightness of the printed work, compared to past versions of the s/ware.
    In any case, in my opinion you really can’t go wrong with the apple product.  I bought my first iMac in mid 1999 and have never looked back.  I donated that machine to a pre-school in 2008, it was running OSX version 2 or 3 I think.  I did run Photoshop 7.0 on an IBM laptop for a time (windows XP).  I think I had one of the very first versions of Adobe Camera Raw on that machine.  I digress, sorry.
    The chat representative did confirm that the 17” is out of production and I’m guessing Apple found the market for the big laptop just wasn’t there.  They did mention that 17” MBP’s show up as “certified refurbished” units from time to time.  Suggest you might explore that option with a local Apple store in the UK, assuming  Apple has store front operations off this continent of course.
    Please feel free to contact me with further questions if you wish.
    Take care, Gordy

  • Analysis Process Designer (APD) and EMail

    Hi,
    Following due to data discrepancy in PO value,We developed a re conciliation report based on  direct cube,The re conciliation report displays PO No,Po Value in BW and PO Value from ECC and a Difference column.
    My requirement is to develop a APD which executes this re conciliation report ,Based on the report tout i want to send 2 emails
    Email 1: With the list of PO Numbers where data discrepancy is <= $5 and
    Email 2: With the List of PO Numbers where data discrepancy is > 5
    How can i achieve this requirement.
    Thanks in advance

    Why do you want to create APD. You can create two reports and then schedule them for broadcast daily.
    1st report having list of PO Numbers where data discrepancy is <= $5
    2nd report having list of PO Numbers where data discrepancy is > $5
    These both wold be identical reports just with the change in conditon.You can then use the broadcasting feature to distribute these reports to end user.It would save your time in unnecessary creating the APD.
    You can also schedule the broadcst via PC  if you want to send this information daily once the delta loads are finished.
    Is there any specific reason you want to use APD ( for some calculation purpose) ?

  • Dynamic CRM 2013 Online how to execute Report, generate PDF and email

    Dear All,
    I am using Dynamic CRM 2013 online. For quote, I have workflow and Dialogue processes for review process. On approval, I want the system to generate a PDF of quote report, attach the PDF and email it to the Customer.
    Better I would like, When approver, clicks on the approve button, the system should auto generate a PDF of quote report, attach the PDF and email it to the Customer, without any further input from the user. If its not possible, I may have to put button on
    quote form.
    I am using the attached code, but facing various issues.
    1. Under prepare the SOAP Message coding part, I am not sure what should be the below URL for CRM 2013 Online?
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    2. What should be the emailid here? Is it Recepient Contact id(Guid) ?
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    3. Using this code, not able to create Entity for "ActivityMimeAttachment", I am getting newEntity as undefined.
    Below is the code I am using. Please check and help me out, where I am going wrong. Let me know if any better way to implement it. At present, I have put one button on quote form, on click event, below code will get executed.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script type="text/javascript">
    var Xrm;
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    function getReportingSession() {
    var reportName = "Quotation_Report"; //set this to the report you are trying to download
    var reportId = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var recordid = Xrm.Page.data.entity.getId();
    // recordid = recordid.substring(1, 37); //getting rid of curly brackets
    alert(recordid);
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    retrieveEntityReq.send("id=%7B" + reportId + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName + "&isScheduledReport=false");
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    function createEntity(ent, entName, upd) {
    var jsonEntity = JSON.stringify(ent);
    var createEntityReq = new XMLHttpRequest();
    var ODataPath = Xrm.Page.context.getServerUrl() + "XRMServices/2011/OrganizationData.svc";
    createEntityReq.open("POST", ODataPath + "/" + entName + "Set" + upd, false);
    createEntityReq.setRequestHeader("Accept", "application/json");
    createEntityReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    createEntityReq.send(jsonEntity);
    var newEntity = JSON.parse(createEntityReq.responseText).d;
    alert("new entity" + newEntity);
    return newEntity;
    function createAttachment() {
    var params = getReportingSession();
    var recordid = Xrm.Page.data.entity.getId();
    alert("recordid " + recordid);
    var orgName = Xrm.Page.context.getOrgUniqueName();
    var userID = Xrm.Page.context.getUserId();
    //create email record
    // Prepare the SOAP message.
    var xml = "<?xml version='1.0' encoding='utf-8'?>" +"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'" +
    " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" +
    " xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" +
    "<soap:Header>" +
    "</soap:Header>" +
    "<soap:Body>" +
    "<Create xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
    "<entity xsi:type='email'>" +
    "<regardingobjectid type='quote'>" + recordid + "</regardingobjectid>" +
    "<subject>" + "Email with Attachment4" + "</subject>" +
    "</entity>" +
    "</Create>" +
    "</soap:Body>" +
    "</soap:Envelope>";
    // Prepare the xmlHttpObject and send the request.
    var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xHReq.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Create");
    xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xHReq.setRequestHeader("Content-Length", xml.length);
    xHReq.send(xml);
    // Capture the result
    var resultXml = xHReq.responseXML;
    // alert("resultXml " + resultXml);
    // Check for errors.
    var errorCount = resultXml.selectNodes('//error').length;
    if (errorCount != 0) {
    alert("ERROR");
    var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
    alert(msg);
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    //var emailid = userID;
    var post = Object();
    post.Body = encodePdf(params);
    var email = new Array();
    email[0] =new Object();
    email[0].id = emailid;
    email[0].entityType ='email';
    post.Subject ="File Attachment";
    post.AttachmentNumber = 1;
    post.FileName ="Report.pdf";
    post.MimeType ="application/pdf";
    post.ObjectId = Object();
    post.ObjectId.LogicalName ="email";
    post.ObjectId.Id = email[0].id;
    post.ObjectTypeCode ="email";
    alert(post.ObjectId.Id);
    createEntity(post,"ActivityMimeAttachment", "");
    alert("created successfully");
    email.Subject = "Your Order";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: customerId, // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerId, // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity). activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] + "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    </SCRIPT>
    <SCRIPT type=text/vbscript>
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </SCRIPT>
    </head>
    <body>
    <input type="button" onclick="createAttachment();" value="Attach Report" />
    </body>
    </html>
    Thanks. and waiting for your valuable comments.
    - Mittal

    Hello,
    Yes, I was able to make my code working as below. Tested on CRM online 2013.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
    <script type="text/javascript">
    if (typeof (SDK) == "undefined")
    { SDK = { __namespace: true }; }
    SDK.JScriptRESTDataOperations = {
    _context: function () {
    if (typeof GetGlobalContext != "undefined")
    { return GetGlobalContext(); }
    else {
    if (typeof Xrm != "undefined") {
    return Xrm.Page.context;
    else { return new Error("Context is not available."); }
    _getServerUrl: function () {
    var serverUrl = this._context().getServerUrl()
    if (serverUrl.match(/\/$/)) {
    serverUrl = serverUrl.substring(0, serverUrl.length - 1);
    return serverUrl;
    _ODataPath: function () {
    return this._getServerUrl() + "/XRMServices/2011/OrganizationData.svc/";
    _errorHandler: function (req) {
    return new Error("Error : " +
    req.status + ": " +
    req.statusText + ": " +
    JSON.parse(req.responseText).error.message.value);
    _dateReviver: function (key, value) {
    var a;
    if (typeof value === 'string') {
    a = /Date\(([-+]?\d+)\)/.exec(value);
    if (a) {
    return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
    return value;
    Create: function (object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 201) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Retrieve: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    Update: function (id, object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "MERGE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Delete: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "DELETE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    RetrieveMultiple: function (type, filter, successCallback, errorCallback) {
    if (filter != null) {
    filter = "?" + filter;
    else { filter = ""; }
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set" + filter, true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d.results);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    __namespace: true
    </script>
    <script type="text/javascript">
    //Create Email and link it with Order as Regarding field
    var Xrm;
    var email = new Object();
    var ownerID = "";
    var CustomerId = "";
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    //Get ownerid who send email of quotation to customer
    function GetOwnerID() {
    var owner = Xrm.Page.getAttribute("ownerid").getValue();
    ownerID = owner[0].id;
    var ownerName = owner[0].name;
    var entityType = owner[0].entityType;
    GetToEmailGUID();
    //Get customerid who receive email of quotation from owner
    function GetToEmailGUID() {
    var Customer = Xrm.Page.getAttribute('customerid').getValue();
    CustomerId = Customer[0].id;
    var CustomerName = Customer[0].name;
    var entityType = Customer[0].entityType;
    //if CustomerId is type of "Account" then get Primary Contact id of that account
    if (entityType == "account") {
    var contact = Xrm.Page.getAttribute("customerid").getValue();
    if (contact === null) return;
    var serverUrl = Xrm.Page.context.getClientUrl();
    var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" + contact[0].id + "')?$select=PrimaryContactId";
    var req = new XMLHttpRequest();
    req.open("GET", oDataSelect, false);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
    req.onreadystatechange = function () {
    if (req.readyState === 4) {
    if (req.status === 200) {
    var retrieved = JSON.parse(req.responseText).d;
    CustomerId = retrieved.PrimaryContactId.Id;
    else {
    alert(this.statusText);
    req.send();
    function CreateEmail() {
    GetOwnerID();
    email.Subject = "Email with Report Attachment";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: CustomerId, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerID, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    GetReportId('Quotation');
    //Create attachment for the created email
    function CreateEmailAttachment() {
    //get reporting session and use the params to convert a report in PDF
    var params = getReportingSession();
    //Email attachment parameters
    var activitymimeattachment = Object();
    activitymimeattachment.ObjectId = Object();
    activitymimeattachment.ObjectId.LogicalName = "email";
    activitymimeattachment.ObjectId.Id = email.ActivityId;
    activitymimeattachment.ObjectTypeCode = "email",
    activitymimeattachment.Subject = "File Attachment";
    activitymimeattachment.Body = encodePdf(params);
    activitymimeattachment.FileName = "Report.pdf";
    activitymimeattachment.MimeType = "application/pdf";
    //Attachment call
    SDK.JScriptRESTDataOperations.Create(activitymimeattachment, "ActivityMimeAttachment", ActivityMimeAttachmentCallBack, function (error) { alert(error.message); });
    //ActivityMimeAttachment CallBack function
    function ActivityMimeAttachmentCallBack(result) {
    var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";
    var width = "800px";
    var height = "600px";
    window.open(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", features);
    // To open window which works in outlook and IE both
    //openStdWin(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", width, height, features);
    //This method will get the reportId based on a report name that will be used in getReportingSession() function
    function GetReportId(reportName) {
    var oDataSetName = "ReportSet";
    var columns = "ReportId";
    var filter = "Name eq '" + reportName + "'";
    retrieveMultiple(oDataSetName, columns, filter, onSuccess);
    function retrieveMultiple(odataSetName, select, filter, successCallback) {
    var serverUrl = Xrm.Page.context.getServerUrl();
    var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
    var odataUri = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "?";
    if (select) {
    odataUri += "$select=" + select + "&";
    if (filter) {
    odataUri += "$filter=" + filter;
    $.ajax({
    type: "GET",
    contentType: "application/json; charset=utf-8",
    datatype: "json",
    url: odataUri,
    beforeSend: function (XMLHttpRequest) {
    XMLHttpRequest.setRequestHeader("Accept", "application/json");
    success: function (data) {
    if (successCallback) {
    if (data && data.d && data.d.results) {
    successCallback(data.d.results);
    else if (data && data.d) {
    successCallback(data.d);
    else {
    successCallback(data);
    error: function (XmlHttpRequest, errorThrown) {
    if (XmlHttpRequest && XmlHttpRequest.responseText) {
    alert("Error while retrieval ; Error – " + XmlHttpRequest.responseText);
    function onSuccess(data) {
    reportId = data[0].ReportId.replace('{', ").replace('}', ");
    CreateEmailAttachment(); // Create Email Attachment
    //Gets the report contents
    function getReportingSession() {
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    var Id = Xrm.Page.data.entity.getId();
    var quotationGUID = Id.replace('{', ""); //set this to selected quotation GUID
    quotationGUID = quotationGUID.replace('}', "");
    var reportName = "Quotation"; //set this to the report you are trying to download
    var reportID = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var rptPathString = ""; //set this to the CRMF_Filtered parameter
    var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition attribute='quoteid' operator='eq' uitype='quote' value='" + quotationGUID + "' /> </filter></entity></fetch>";
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" +
    reportName + "&isScheduledReport=false&p:CRMAF_Filteredquote=" + strParameterXML;
    //remove the part starting from &p:salesorderid if your report has no parameters
    retrieveEntityReq.send(rptPathString);
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] +
    "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] +
    "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    } else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    </script>
    <script type="text/vbscript">
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </script>
    </head>
    <body>
    <input type="button" onclick="CreateEmail();" value="Attach Report" />
    </body>
    </html>
    Thank you,
    Mittal.

  • Unit tests and QA process

    Hello,
    (disclaimer : if you agree that this topic does not really belong to this forum please vote for a new Development Process forum there:
    http://forum.java.sun.com/thread.jspa?forumID=53&threadID=504658 ;-)
    My current organization has a dedicated QA team.
    They ensure end-user functional testing but also run and monitor "technical" tests as well.
    In particular they would want to run developer-written junit tests as sanity tests before the functional tests.
    I'm wondering whether this is such a good idea, and how to handle failed unit tests:
    1) Well , indeed, I think this is a good idea: even if developer all abide by the practice of ensuring 100% of their test pass before promoting their code (which is unfortunately not the case), integration of independant development may cause regression or interactions that make some test fail.
    Any reason against QA running junit tests at this stage?
    However the next question is, what do they do with failed tests : QA has no clue how important a given unit test is with regard to the whole application.
    Maybe a single unit test failed out of 3500 means a complete outage of a 24x7 application. Or maybe 20% of failed tests only means a few misaligned icons...
    2) The developer of the failed package may know, but how can he communicate this to QA?
    Javadocing their unit testing code ("This test is mandatory before entering user acceptance") seems a bit fragile.
    Are there recommended methods?
    3) Even the developer of the failed package may not realize the importance of the failure. So what should be the process when unit tests fail in QA?
    Block the process until 100% tests pass? Or, start acceptance anyway but notify the developper through the bug tracking system?
    4) Does your acceptance process require 100% pass before user acceptance starts?
    Indeed I have ruled out requiring 100% pass, but is this a widespread practice?
    I rule it out because maybe the failed test indeed points out a bad test, or a temporary unavailability of a dependent or simulated resource.
    This has to be analyzed of course, as tests have to be maintained as well, but this can be a parallel process to the user acceptance (accepting that the software may have to be patched at some point during the acceptance).
    Thank you for your inputs.
    J.

    >
    Any reason against QA running junit tests at this
    stage?
    Actually running them seems pointless to me.
    QA could be interested in the following
    - That unit tests do actually exist
    - That the unit tests are actually being run
    - That the unit tests pass.
    This can all be achieved as part of the build process however. It can either be done for every cm build (like automated nightly) or for just for release builds.
    This would require that the following information was logged
    - An id unique to each test
    - Pass fail
    - A collection system.
    Obviously doing this is going to require more work and probably code than if QA was not tracking it.
    However the next question is, what do they do with
    failed tests : QA has no clue how important a given
    unit test is with regard to the whole application.
    Maybe a single unit test failed out of 3500 means a
    complete outage of a 24x7 application. Or maybe 20%
    of failed tests only means a few misaligned icons...
    To me that question is like asking what happens if one class fails to build for a release build.
    To my mind any unit test failure is logged as a severe exception (the entire system is unusable.)
    2) The developer of the failed package may know, but
    how can he communicate this to QA?
    Javadocing their unit testing code ("This test is
    mandatory before entering user acceptance") seems a
    bit fragile.
    Are there recommended methods?Automatic collection obviously. This has to be planned for.
    One way is to just log success and failure for each test which is gathered in one or more files. Then a seperate process munges the result file to collect the data.
    I know that there is a java build engine (add on to ant or a wrapper to ant) which will do periodic builds and email reports to developers. I think it even allows for categorization so the correct developer gets the correct error.
    >
    3) Even the developer of the failed package may not
    realize the importance of the failure. So what
    should be the process when unit tests fail in
    QA?
    Block the process until 100% tests pass? Or, start
    acceptance anyway but notify the developper through
    the bug tracking system?
    I would block it.
    4) Does your acceptance process require 100% pass
    before user acceptance starts?
    No. But I am not sure what that has to do with what you were discussing above. I consider unit tests and acceptance testing to be two seperate things.
    Indeed I have ruled out requiring 100% pass, but is
    this a widespread practice?
    I rule it out because maybe the failed test indeed
    points out a bad test, or a temporary unavailability
    of a dependent or simulated resource.Then something is wrong with your process.
    When you create a release build you should include those things that should be in the release. If they are not done, missing, have build errors, then they shouldn't be in the release.
    If some dependent piece is missing for the release build then the build process has failed. And so it should not be released to QA.
    I have used version control/debug systems which made this relatively easy by allowing control over which bug/enhancements are included in a release. And of course requiring that anything checked in must be done so under a bug/enhancement. They will even control dependencies as well (the files for bug 7 might require that bug 8 is added as well.)

  • Storer: Error in parsing:Could not process

    ZENworks for Desktops 6.5 SP2
    Netware 6.5 SP2
    Sybase DB 8.0.2 (4339)
    ZENworks Agents (still) 4.01xxx
    ZENworks Inventory Service Console Massages:
    Starting the Upgrade service.
    The database has already been set to the Ready state.
    The Upgrade service is trying to free the resources.
    Stopping the upgrade service.
    Starting Storer Service
    Obtaining dbdir from service object: VOL1:\\Zenworks\\ScanDir\\DbDir
    Trying to connect to the database -> MW_DBA
    jdbc:sybase:Tds:xxx.xxx.xxx.xxx:2638?ServiceName=m gmtdb&JCONNECT_VERSION=4
    Successfully connected to the database
    Storer: Database is initialized.
    Storer: started storing 0008028F9BBE_1060751520000_75.STR (2686 bytes)
    Starting STRConverter service
    Storer: Successfully stored the information for
    CN=WKSTA2.OU=Workstations.OU=BO2.O=CORP time taken: 12486
    Storer: started storing 000BCDC3AF5E_1070456883000_81.STR (95778 bytes)
    Receiver Service Started
    Starting Selector Service
    Inventory Sync Service started
    Storer: Full scan being processed for CN=WKSTA1.OU=Workstations.OU=BO1.O=CORP
    Error in parsing:Could not process 000BCDC3AF5E_1070456883000_81.STR due to
    DB Operation failure..will retry
    TCP Receiver Service Started
    There are several workstations that send .STR files to the Inventory
    Service (Leaf->Root) that causes Storer in Root DB server to stop. It says
    "..will retry" but it never does that. So, I have to manually stop the Inv
    Service & db, remove the "corrupt" .STR file from the
    \ZENworks\ScanDir\DBDir\temp folder, and start the db and InvService again.
    Then the process continues until the next "corrupt" .STR file. They seem to
    be Full Scan files according to the size of them.
    Question: What can be wrong? How can make Storer just to skip those corrupt
    ..STR files?
    Below: Part of Storer debug log file from root db server.
    [11/11/05 09:34:28.208] ZENInv - Storer: Total Memory = 8126464 Free Memory
    = 5182912
    [11/11/05 09:34:28.208] ZENInv - Storer: Unlocking
    VOL1:\Zenworks\ScanDir\DbDir\temp\0008028F9BBE_106 0751520000_75.STR
    [11/11/05 09:34:28.801] ZENInv - Storer: Loading Storer test properties file
    [11/11/05 09:34:28.810] ZENInv - Storer: Storer: started storing
    000BCDC3AF5E_1070456883000_81.STR (95778 bytes)
    [11/11/05 09:34:28.848] ZENInv - Storer: dn:
    CN=WKSTA1.OU=Workstations.OU=BO1.O=CORP tree: TREE123
    [11/11/05 09:34:28.848] ZENInv - Storer: tree: TREE123wsdn:
    CN=WKSTA1.OU=Workstations.OU=BO1.O=CORPtime: 1131612609000
    [11/11/05 09:34:28.848] ZENInv - Storer: Initial WS statusrecord is found
    [11/11/05 09:34:28.848] ZENInv - Storer: got the status log
    [11/11/05 09:34:29.138] ZENInv - Storer: [FULL]DELETING ALL PRODUCTS
    [11/11/05 09:34:32.091] ZENInv - SendRec Common: entPushDir =
    VOL1:\Zenworks\ScanDir\EntPushDir
    [11/11/05 09:34:32.091] ZENInv - SendRec Common: entMergeDirD =
    VOL1:\Zenworks\ScanDir\EntMergeDir
    [11/11/05 09:34:32.091] ZENInv - SendRec Common: dbDirD =
    VOL1:\Zenworks\ScanDir\DbDir
    [11/11/05 09:34:32.091] ZENInv - SendRec Common: serverName = SERVER01
    [11/11/05 09:34:32.091] ZENInv - SendRec Common: serviceDN =
    CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:32.092] ZENInv - SendRec Common: treeName = TREE123
    [11/11/05 09:34:32.092] ZENInv - SendRec Common: hasSSD = false
    [11/11/05 09:34:32.092] ZENInv - SendRec Common: hasISD = true
    [11/11/05 09:34:32.092] ZENInv - SendRec Common: hasESD = true
    [11/11/05 09:34:32.092] ZENInv - SendRec Common: hasDB = true
    [11/11/05 09:34:32.092] ZENInv - SendRec Common: securityDir =
    SYS:\PUBLIC\ZENWORKS\WMINV\PROPERTIES
    [11/11/05 09:34:32.109] Service Manager: start(ServiceDataAccessor,
    String[]) not found in
    'com.novell.zenworks.desktop.inventory.selector.Se lectorServiceInit'
    [11/11/05 09:34:32.162] ZENInv - Selector: Selector Services Started
    Successfully
    [11/11/05 09:34:32.164] Service Manager: start(ServiceDataAccessor,
    String[]) not found in
    'com.novell.zenworks.common.inventory.scancollecto r.ScanCollector'
    [11/11/05 09:34:32.184] ZENInv - Selector: Selector StrFileDelay Not Set
    [11/11/05 09:34:32.185] ZENInv - Selector: Selector Code Profiling disabled
    [11/11/05 09:34:32.276] ZENInv - IFS Server: zenInvScanCollector:
    FileServiceController: Startup Properties: {chunksize=4096,
    lockfactory=com.novell.zenworks.common.inventory.i fs.utils.MemoryFileLockFactory,
    lockseed=ScanSelectorLock, transfers=100,
    rootdirectory=VOL1:\Zenworks\ScanDir, timeout=60000,
    servicename=zenInvScanCollector, portnumber=0}
    [11/11/05 09:34:32.429] ZENInv - CascadedBaseTime Server:
    zenInvCascadeBaseTimeService: CBTServiceController: Startup Properties:
    {basetime=Sat Jan 01 00:05:09 EET 2005,
    servicename=zenInvCascadeBaseTimeService, portnumber=0}
    [11/11/05 09:34:32.436] Service Manager: start(ServiceDataAccessor,
    String[]) not found in
    'com.novell.zenworks.desktop.inventory.InvSyncServ ice.ManagableSyncService'
    [11/11/05 09:34:32.457] ZENInv - Inventory Sync Service: SyncService thread
    started
    [11/11/05 09:34:32.466] ZENInv - Inventory Sync Service: NEW
    SyncServiceTable Constructor Invoked
    [11/11/05 09:34:32.466] ZENInv - Inventory Sync Service: Creating-Verifying
    Serialize-Deserialize Location VOL1:\Zenworks\ScanDir\stable\
    [11/11/05 09:34:32.467] ZENInv - Inventory Sync Service: Checking for
    VOL1:\Zenworks\ScanDir\stable\
    [11/11/05 09:34:32.469] Service Manager: start(ServiceDataAccessor,
    String[]) not found in
    'com.novell.zenworks3x.desktop.inventory.senderrec eiver.control.ReceiverServiceInit'
    [11/11/05 09:34:32.472] ZENInv - Inventory Sync Service: synchTableDir
    exists. Check wether this is a directory or File
    [11/11/05 09:34:32.474] ZENInv - Inventory Sync Service: Directory
    ExistsVOL1:\Zenworks\ScanDir\stable\
    [11/11/05 09:34:32.478] ZENInv - Inventory Sync Service: Directory
    Existence ConfirmedVOL1:\Zenworks\ScanDir\stable\
    [11/11/05 09:34:32.478] ZENInv - Inventory Sync Service:
    Serialize-Deserialize File VOL1:\Zenworks\ScanDir\stable\STABLE.SER
    [11/11/05 09:34:32.478] ZENInv - Inventory Sync Service: Initializing
    SyncServiceTable
    [11/11/05 09:34:32.478] ZENInv - Inventory Sync Service: SynchTable Does
    not Exist
    [11/11/05 09:34:32.478] ZENInv - Inventory Sync Service: Attempting to Load
    SynchTable From Serialized File
    [11/11/05 09:34:32.479] ZENInv - Inventory Sync Service: DeSerializing
    hashTable FromVOL1:\Zenworks\ScanDir\stable\STABLE.SER
    [11/11/05 09:34:32.480] ZENInv - Inventory Sync Service: DeSerializing
    SyncService HashTable
    [11/11/05 09:34:32.483] ZENInv - Inventory Sync Service: SynchTable Loaded
    Sucessfully From Serialized File
    [11/11/05 09:34:32.487] ZENInv - IFS Server: zeninvReceiverService:
    FileServiceController: Startup Properties: {chunksize=4096, transfers=100,
    rootdirectory=VOL1:\Zenworks\ScanDir\EntPushDir\Zi pDir, timeout=60000,
    servicename=zeninvReceiverService, portnumber=0}
    [11/11/05 09:34:38.169] ZENInv - Storer: Products=379 Sw_Times = 2361 379 0
    0 1354 379 0 0 944 379 0 0 TotalTime=8983
    [11/11/05 09:34:40.136] ZENInv - Storer: ws deletetime : 1774
    [11/11/05 09:34:40.435] ZENInv - Storer: Some Database Exception
    com.novell.zenworks.desktop.inventory.storer.Datab aseException: ASA Error
    -194: No primary key value for foreign key 'id$' in table 't$LockTable'
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.connectEx(DatabaseOperator.java:1164)
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.reTryExecute(DatabaseOperator.java:122 7)
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.updateLockTable(DatabaseOperator.java: 6130)
    at
    com.novell.zenworks.desktop.inventory.storer.Parse .writeToDB(Parse.java:2360)
    at com.novell.zenworks.desktop.inventory.storer.Parse .parse(Parse.java:4113)
    at
    com.novell.zenworks.desktop.inventory.storer.MainT hread.run(MainThread.java:976)
    [11/11/05 09:34:40.440] ZENInv - Storer: DatabaseException:DB operation
    failed..could not process 000BCDC3AF5E_1070456883000_81.STR due to
    com.novell.zenworks.desktop.inventory.storer.Datab aseException: ASA Error
    -194: No primary key value for foreign key 'id$' in table 't$LockTable'
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.connectEx(DatabaseOperator.java:1164)
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.reTryExecute(DatabaseOperator.java:122 7)
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.updateLockTable(DatabaseOperator.java: 6130)
    at
    com.novell.zenworks.desktop.inventory.storer.Parse .writeToDB(Parse.java:2360)
    at com.novell.zenworks.desktop.inventory.storer.Parse .parse(Parse.java:4113)
    at
    com.novell.zenworks.desktop.inventory.storer.MainT hread.run(MainThread.java:976)
    [11/11/05 09:34:40.444] ZENInv - Storer: MainThread-1 position:
    com.novell.zenworks.desktop.inventory.storer.Datab aseException: ASA Error
    -194: No primary key value for foreign key 'id$' in table 't$LockTable'
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.connectEx(DatabaseOperator.java:1164)
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.reTryExecute(DatabaseOperator.java:122 7)
    at
    com.novell.zenworks.desktop.inventory.storer.Datab aseOperator.updateLockTable(DatabaseOperator.java: 6130)
    at
    com.novell.zenworks.desktop.inventory.storer.Parse .writeToDB(Parse.java:2360)
    at com.novell.zenworks.desktop.inventory.storer.Parse .parse(Parse.java:4113)
    at
    com.novell.zenworks.desktop.inventory.storer.MainT hread.run(MainThread.java:976)
    [11/11/05 09:34:40.448] ZENInv - Status Reporting: Messages are written
    into XML file for DN=CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:40.485] ZENInv - Status Reporting: Number of records to add
    are: 1 for DN=CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:40.520] ZENInv - Status Reporting: Adding record 0 for
    DN=CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:40.661] ZENInv - Status Reporting: Number of modified
    records are: 0 for DN=CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:40.661] ZENInv - Storer: MainThread-2 position:
    [11/11/05 09:34:42.136] ZENInv - Selector: Getting ServerConfig HashTable
    [11/11/05 09:34:42.136] ZENInv - Selector: Getting InvServiceObj from HashTable
    [11/11/05 09:34:42.136] ZENInv - Selector: Getting NDSTree from ServiceObject
    [11/11/05 09:34:42.136] ZENInv - Selector: NDSTree=null
    [11/11/05 09:34:42.136] ZENInv - Selector: Getting InventoryServiceDN from
    ServiceObject
    [11/11/05 09:34:42.136] ZENInv - Selector:
    InventoryServiceDN=CN=SERVER01_ZenInvService.O=COR P
    [11/11/05 09:34:42.136] ZENInv - Selector: Getting ScanDir from ServiceObject
    [11/11/05 09:34:42.136] ZENInv - Selector: ScanDir=VOL1:\Zenworks\ScanDir
    [11/11/05 09:34:42.137] ZENInv - Selector: NEW SyncServiceTable Constructor
    Invoked
    [11/11/05 09:34:42.137] ZENInv - Selector: Creating-Verifying
    Serialize-Deserialize Location VOL1:\Zenworks\ScanDir\stable\
    [11/11/05 09:34:42.137] ZENInv - Selector: Checking for
    VOL1:\Zenworks\ScanDir\stable\
    [11/11/05 09:34:42.137] ZENInv - Selector: synchTableDir exists. Check
    wether this is a directory or File
    [11/11/05 09:34:42.138] ZENInv - Selector: Directory
    ExistsVOL1:\Zenworks\ScanDir\stable\
    [11/11/05 09:34:42.138] ZENInv - Selector: Directory Existence
    ConfirmedVOL1:\Zenworks\ScanDir\stable\
    [11/11/05 09:34:42.138] ZENInv - Selector: Serialize-Deserialize File
    VOL1:\Zenworks\ScanDir\stable\STABLE.SER
    [11/11/05 09:34:42.138] ZENInv - Selector: Initializing SyncServiceTable
    [11/11/05 09:34:42.138] ZENInv - Selector: Will Use the existing
    SyncServiceTable
    [11/11/05 09:34:42.138] ZENInv - Selector: Getting hasDatabase status from
    ServiceObject
    [11/11/05 09:34:42.138] ZENInv - Selector: hasDatabase is true from
    ServiceObject
    [11/11/05 09:34:42.138] ZENInv - Selector: Getting isStandAlone status from
    ServiceObject
    [11/11/05 09:34:42.138] ZENInv - Selector: isStandAlone is true from
    ServiceObject
    [11/11/05 09:34:42.139] ZENInv - Selector: ConvDir VOL1:\Zenworks\ScanDir\conv\
    [11/11/05 09:34:42.139] ZENInv - Selector: ConvDir exists. Check wether
    this is a directory or File
    [11/11/05 09:34:42.139] ZENInv - Selector: VOL1:\Zenworks\ScanDir
    [11/11/05 09:34:42.139] ZENInv - Selector: VOL1:\Zenworks\ScanDir\DbDir
    [11/11/05 09:34:42.139] ZENInv - Selector:
    [11/11/05 09:34:42.139] ZENInv - Selector: Getting SELECTOR_STORER Synch Object
    [11/11/05 09:34:42.139] ZENInv - Selector: Getting SELECTOR_COLLECTOR Synch
    Object
    [11/11/05 09:34:42.139] ZENInv - Selector: Getting SELECTOR_CONVERTER Synch
    Object
    [11/11/05 09:34:42.140] ZENInv - Selector: Getting CONVERTER_SELECTOR Synch
    Object
    [11/11/05 09:34:42.140] ZENInv - Selector: Getting SYNCHSERVICE_SELECTOR
    Synch Object
    [11/11/05 09:34:42.442] ZENInv - TCPReceiver: cascadingBaseTime = 1104530709000
    [11/11/05 09:34:42.442] ZENInv - TCPReceiver: entPushDir =
    VOL1:\Zenworks\ScanDir\EntPushDir
    [11/11/05 09:34:42.442] ZENInv - TCPReceiver: serverName = SERVER01
    [11/11/05 09:34:42.442] ZENInv - TCPReceiver: serviceDN =
    CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:42.442] ZENInv - TCPReceiver: treeName = TREE123
    [11/11/05 09:34:42.443] ZENInv - TCPReceiver: hasDB = true
    [11/11/05 09:34:42.483] ZENInv - TCPReceiver: Receiver Started without CLUSTER
    [11/11/05 09:34:42.484] ZENInv - TCPReceiver: Receiver Binds to Port Number
    : 65432
    [11/11/05 09:34:42.486] Service Manager: start(ServiceDataAccessor,
    String[]) not found in
    'com.novell.zenworks.common.inventory.dictionaryup date.provider.DictProvider'
    [11/11/05 09:34:42.514] ZENInv - IFS Server: zenInvDictProvider:
    FileServiceController: Startup Properties: {chunksize=4096, transfers=100,
    rootdirectory=VOL1:\ZENWORKS\Inv\server\DictDir, timeout=60000,
    servicename=zenInvDictProvider, portnumber=0}
    [11/11/05 09:34:42.542] Service Manager: start(ServiceDataAccessor,
    String[]) not found in
    'com.novell.zenworks.common.inventory.dictionaryup date.consumer.DictConsumer'
    [11/11/05 09:34:42.859] ZENInv - Dictionary Consumer:
    DictConsumerUtility::getUpdatePolicyDN: getDictionaryUpdatePolicy returned
    attribs.returnValue = 0
    [11/11/05 09:34:42.859] ZENInv - Dictionary Consumer:
    DictConsumerService::DictDownloadThread::run: UpdatePolicyNotFoundException.
    com.novell.zenworks.common.inventory.dictionaryupd ate.consumer.UpdatePolicyNotFoundException
    at
    com.novell.zenworks.common.inventory.dictionaryupd ate.consumer.DictConsumerUtility.getUpdatePolicyDN (DictConsumerUtility.java:237)
    at
    com.novell.zenworks.common.inventory.dictionaryupd ate.consumer.DictConsumerService$DictDownloadThrea d.setUpdatePolicyAttribs(DictConsumerService.java: 688)
    at
    com.novell.zenworks.common.inventory.dictionaryupd ate.consumer.DictConsumerService$DictDownloadThrea d.getFileClientProperties(DictConsumerService.java :616)
    at
    com.novell.zenworks.common.inventory.dictionaryupd ate.consumer.DictConsumerService$DictDownloadThrea d.transferFiles(DictConsumerService.java:429)
    at
    com.novell.zenworks.common.inventory.dictionaryupd ate.consumer.DictConsumerService$DictDownloadThrea d.run(DictConsumerService.java:211)
    [11/11/05 09:34:42.862] ZENInv - Status Reporting: Messages are written
    into XML file for DN=CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:42.955] ZENInv - Status Reporting: Number of records to add
    are: 1 for DN=CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:42.989] ZENInv - Status Reporting: Adding record 0 for
    DN=CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:43.132] ZENInv - Status Reporting: Number of modified
    records are: 0 for DN=CN=SERVER01_ZenInvService.O=CORP
    [11/11/05 09:34:43.134] ZENInv - Dictionary Consumer:
    DictConsumerService::FileDownloadListener::downloa dFailed.
    [11/11/05 09:39:25.639] Service Manager: Stopping Service Server
    Configuration Service
    [11/11/05 09:39:25.640] Service Manager: Service Server Configuration
    Service stopped successfully
    [11/11/05 09:39:25.645] Service Manager: Stopping Service Dictionary
    Consumer Service
    [11/11/05 09:39:25.645] Service Manager: Service Dictionary Consumer
    Service stopped successfully
    [11/11/05 09:39:25.652] Service Manager: Stopping Service TCPReceiver Service
    [11/11/05 09:39:25.656] Service Manager: Service TCPReceiver Service
    stopped successfully
    [11/11/05 09:39:25.659] Service Manager: Stopping Service STRConverter Service
    [11/11/05 09:39:25.969] ZENInv - STRConverter: STRConverter service is stopped
    [11/11/05 09:39:25.969] Service Manager: Service STRConverter Service
    stopped successfully
    [11/11/05 09:39:25.975] Service Manager: Stopping Service Selector Service
    [11/11/05 09:39:28.894] ZENInv - Selector: Selector Will Now Serialize
    SynchTable[Stop Slector Invoked]
    [11/11/05 09:39:28.894] ZENInv - Selector: Serializing hashTable
    ToVOL1:\Zenworks\ScanDir\stable\STABLE.SER
    [11/11/05 09:39:28.896] ZENInv - Selector: Selector Services are stopped -
    Exiting
    [11/11/05 09:39:28.896] ZENInv - Selector: STOP_PENDING message sent to
    StatusChangeListener
    [11/11/05 09:39:28.896] ZENInv - Selector: STOPPED message sent to
    StatusChangeListener
    [11/11/05 09:39:28.896] ZENInv - Selector: Selector Services Stopped
    [11/11/05 09:39:28.896] Service Manager: Service Selector Service stopped
    successfully
    [11/11/05 09:39:28.900] Service Manager: Stopping Service Scan Collector
    Service
    [11/11/05 09:39:28.923] Service Manager: Service Scan Collector Service
    stopped successfully
    [11/11/05 09:39:28.928] Service Manager: Stopping Service Receiver Service
    [11/11/05 09:39:29.001] Service Manager: Service Receiver Service stopped
    successfully
    [11/11/05 09:39:29.002] Service Manager: Stopping Service InventorySync
    Scheduler Service
    [11/11/05 09:39:29.002] Service Manager: Service InventorySync Scheduler
    Service stopped successfully
    [11/11/05 09:39:29.009] Service Manager: Stopping Service Storer Service
    [11/11/05 09:39:29.009] Service Manager: Service Storer Service stopped
    successfully
    [11/11/05 09:39:29.016] Service Manager: Stopping Service InvDBSync Service
    [11/11/05 09:39:29.016] ZENInv - Inventory Sync Service: Cleanup()
    operation completed
    [11/11/05 09:39:29.016] Service Manager: Service InvDBSync Service stopped
    successfully
    [11/11/05 09:39:29.022] Service Manager: Stopping Service Dictionary
    Provider Service
    [11/11/05 09:39:29.050] Service Manager: Service Dictionary Provider
    Service stopped successfully

    > On Fri, 11 Nov 2005 13:23:13 GMT, [email protected] wrote:
    >
    > > Storer: Full scan being processed for
    CN=WKSTA1.OU=Workstations.OU=BO1.O=CORP
    > > Error in parsing:Could not process 000BCDC3AF5E_1070456883000_81.STR due to
    > > DB Operation failure..will retry
    > > TCP Receiver Service Started
    >
    > it COULD be
    > http://support.novell.com/cgi-bin/se...i?10099394.htm
    > --
    >
    >
    > Marcus Breiden
    >
    > Please change -- to - to mail me.
    > The content of this mail is my private and personal opinion.
    > http://www.edu-magic.net
    Marcus, thanx for the quick answer (the weekend is over, back to work...),
    but the fact of the TID does not match. Anyway, I think I should still try
    that fix (have to try something...). Why those programs are not public? Is
    there a way to make Storer to skip bad .STR files? That would be handy in
    the future if any new problems occurs. What do ya think, should I try to
    remove those problem workstations from the root database? Would that
    correct (I mean delete and then recreate) the faulty tables in database if
    the TID is right?
    P.S. How do ya check if the Sybase DB is healthy, I mean the the way you
    check DS with DSRepair...?
    -tommi-

  • Creating script to take picture and email it

    I recently read an article about someone who created an automator script that would take a picture using a MacBook iSight camera and email it each time the MacBook awoke from sleep. Several laptops have been stolen from my workplace and I thought this would be a great way of figuring out the thief were my laptop ever stolen.
    When I looked at the script, I noticed that it opens up PhotoBooth and Mail so that the user in front of the computer would see that their picture was being taken and that an email message was sent.
    In the name of stealthness, I was hoping to duplicate this process in a unix script. I have a few pieces figured out, but I need some guidance on other issues.
    What I know:
    1. How to use sleepwatcher to call a unix script upon the MacBook waking.
    2. How to take a stealth image using the commandline command "camcapture".
    What I would like to know
    1. What unix command could I use to check to see if the MacBook has a viable internet connection?
    2. If there is a viable connection, send an email with the image taken to a particular email address and with a particular subjectline.
    3. If there is not a viable internet connection, save the email and check for a viable internet connection each 5 minutes (or so) and send the email as soon as an internet connection is achieved.
    Thank you in advance for any guidance you can offer.

    Hi Mahongue,
       I'm sorry for being absent for a while but in your case that seems to have been a good idea. I think you deserve the star more than I because you seemed to have worked it all out. Of course I couldn't tell you what server your e-mail account uses but it doesn't matter that much in the ping statement. If you can ping mail.yahoo.com, I'm sure that would indicate that you have an internet connection that would allow you to send mail to a yahoo account. I see your point about e-mail being the best solution in case you don't have a reliable server of your own. Of course you can get around the dynamic IP address the way I do, with DynDNS.org. They allow you to change your DNS listing programmatically and you do that at boot. Of course that wouldn't allow you to reliably scp to that machine unless it's always up.
       Your idea of testing the return value of ping command will work in principle. I tested it and ping returns an error if either the lookup fails or the ping times out. I've never used the syntax you did in the if clause. What shell are you using? In a Bourne-type shell, you shouldn't need the parentheses. You could use something like:
    if ping -c 1 mail.yahoo.com >/dev/null 2>&1; then
       <Invoke Network Usage>
    fi
    The redirection avoids cluttering the output of your script with the ping output.
    If you're interested, the CheckForNetwork function in the /etc/rc.common script is:
    # Determine if the network is up by looking for any non-loopback
    # internet network interfaces.
    CheckForNetwork()
       local test
       if [ -z "${NETWORKUP:=}" ]; then
       test=$(ifconfig -a inet 2>/dev/null | sed -n -e '/127.0.0.1/d' -e '/0.0.0.0/d' -e '/inet/p' | wc -l)
       if [ "${test}" -gt 0 ]; then
          NETWORKUP="-YES-"
       else
          NETWORKUP="-NO-"
       fi
       fi
    and usage is:
    CheckForNetwork
    if [ "${NETWORKUP}" = "-YES-" ]; then
       <Invoke Network Usage>
    fi
    If you copy-and-paste any of this code, be sure to replace the non-breaking spaces used for indention with real spaces.
       Thanks for the link to the mail_files script!! That is really impressive! Naturally I saved it. The link you posted is broken at the moment but it's probably one of those sites that throttle traffic by shutting it down for a while when it's "overused". Maybe you've made him popular. Anyway, I got a version of the same script elsewhere but mine says that the uuencoding is untested. Yours doesn't say that, does it? Have you tested that with your version?
       Dave's script still uses Perl to do base64 encoding. It should still be possible to do this in Perl and there are advantages to letting library code handle certain tasks. That way, if a protocol changes someone will likely upgrade the library for you. I think that on another thread you asked about how to add an attachment in the code that we were discussing on that other thread. However, I thought you said that you had Perl code to do that. I was just suggesting that you put the two together.
    Gary
    ~~~~
       The party adjourned to a hot tub, yes.
       Fully clothed, I might add.
             -- IBM employee, testifying in California State Supreme Court

  • I've already changed email for my apple id more than 6 months. But 2-3 months ago until now I've recieved and email to ask apple id confirmation from me. I never confirm anything because I don't know,the link's attached, it's legal or illegal.

    Dear Apple support team,
    I've already changed email for my apple id more than 6 months. But 2-3 months ago until now I've recieved and email to ask my apple id confirmation from me about 6-8 emails. I never confirm anything because I don't know,the link's attached, it's legal or illegal.
    The latest link (just be sent to my email 1 hr. ago) : http://www.smartpixeladv.com/proma/Login/index.html 
    Text is:
    Dear Customer,
    We recently noticed an unusual activity in your iTunes account. Please complete the process to confirm your
    informations.
    Confirm Now>
    This link will expire three days after this email was sent.
    If you don’t make this request, your account will be blocked for security reasons.
    Apple Support​
    In my opinion, i think      "http://"   should be   "https://"  right?  Or Apple should show the link on your website  that we can find, re- check and click by ourselve. Or  Apple should do "How to confirm apple id" on your main page. ( in fact  i'm not sure you already done "How to" on your website yes or not, because I cannot find it)
    The apple id is sensitive security, it's concerned personal security and any credit card payment so please understand me that's why i must to interrupt your team to help me to solve this problem. I'm scared my account will be blocked. Please advice me.
    Wassa. (BKK)

    It is a phishing attempt to get your Apple ID and Password.
    You should forward it to Apple : [email protected]

  • Parse and output XML document while preserving attribute order

    QUESTION: How can I take in an element with attributes from an XML and output the same element and attributes while preserving the order of those attributes?
    The following code will parse and XML document and generate (practically) unchanged output. However, all attributes are ordered a-z
    Example: The following element
    <work_item_type work_item_db_site="0000000000000000" work_item_db_id="0" work_item_type_code="3" user_tag_ident="Step" name="Work Step" gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1">
    </work_item_type>is output as:
    <work_item_type gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_id="0" last_upd_db_site="0000000000000000" name="Work Step" rstat_type_code="1" user_tag_ident="Step" work_item_db_id="0" work_item_db_site="0000000000000000" work_item_type_code="3">
    </work_item_type>As you may notice, there is no difference in these besides order of the attributes!
    I am convened that the problem is not in the stylesheet.xslt but if you are not then it is posted bellow.
    Please, someone help me out with this! I have a feeling the solution is simple
    The following take the XML from source.xml and outputs it to DEST_filename with attributes in a-z order
    Code:
    private void OutputFile(String DEST_filename, String style_filename){
         //StreamSource stylesheet = new StreamSource(style_filename);
         try{
              File dest_file = new File(DEST_filename);
              if(!dest_file.exists())
                  dest_file.createNewFile();
              TransformerFactory tranFactory = TransformerFactory.newInstance();
              Transformer aTransformer = tranFactory.newTransformer();
              aTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
              Source src = new DOMSource("source.xml");
              Result dest = new StreamResult(dest_file);
              aTransformer.transform(src, dest);
              System.out.println("Finished");
         catch(Exception e){
              System.err.print(e);
              System.exit(-1);
        }

    You can't. The reason is, the XML Recommendation explicitly says the order of attributes is not significant. Therefore conforming XML serializers won't treat it as if it were significant.
    If you have an environment where you think that the order of attributes is significant, your first step should be to reconsider. Possibly it isn't really significant and you are over-reaching in some way. Or possibly someone writing requirements is ignorant of this fact and the requirement can be discarded.
    Or possibly your output is being given to somebody else who has a defective parser which expects the attributes to be in a particular order. You could quote the XML Recommendation to those people but often XML bozos are resistant to change. If you're stuck writing for that parser then you'll have to apply some non-XML processing to your output to fix it up on their behalf.

  • Can I email photos w/o templates Iphoto provides? I used to be able to choose a few photos and email them. Now I have to work with these templates and can barely see what I'm writing!

    I used to be able to choose a few photos and email them. Now I have to work with these templates and often do no want to. Could someone tell me the process for choosing to send photos without the templates?

    Like Larry pointed out in iPhoto's General Preferences pane:
    Click to view full size
    OT

  • Editable, Savable and Email-able PDFs from Reader!

    Hello all,
    so today I got an PDF from a web design firm. It contains a questionnaire with combo boxes and input forms. I was really surprised to find that, within Adobe Reader I can edit and save this PDF locally.
    Further, another nice feature is that you can email an XML document of the form data (not the PDF itself). When you click the email button, the following is pasted into the body of the email:
    The attached file contains data that was entered into a
    form. It is not the form itself.
    The recipient of this data file should save it locally
    with a unique name. Adobe Acrobat Professional 7 or later can process this data
    by importing it back into the blank form or creating a spreadsheet from several
    data files. See Help in Adobe Acrobat Professional 7 or later for more details.
    Maybe its old news here but I never knew that was possible through Reader! How can you make a document so its ready for editing, saving and emailing like this? Does someone has a tutorial on this please? Can the 'source' be read from the PDF?
    Any advice / suggestions?
    Thanks!
    Marv

    Not much of a tutorial needed. You create your form then you specially enable it in Acorbat Pro or better. The option is found under the "advanced" menu.
    It's sort of old news. It's only been around the last two versions.
    If you decide to use forms that are enabled like this, keep in mind that there are strict limitations on how many times they can be used. You can find those limitations in section 15 of the license agreement (There's a subsection in there. I think it's 15.12 but am not positive.)

Maybe you are looking for

  • Error when trying to create tables using "asant create-db_common"

    Hi, I'm attempting to run asant create-db_common to use a .sql file to create a table in Pointbase. However I keep getting this error: Buildfile: build.xml init: create-db_common:      [java] java.lang.NoClassDefFoundError: com/pointbase/tools/toolsC

  • Dbms_metadata.GET_DDL for all procedures for a schema

    I am trying to capture all the procedure DDLs for schema CUSTOM I am using 11g on Linux. I run this command... SELECT dbms_metadata.GET_DDL('PROCEDURE',NULL,'CUSTOM') FROM DUAL; And get this error: ORA-31600: invalid input value NULL for parameter VA

  • How do I get iOS 5 upgrade for my iPad?

    How do I get iOS 5 upgrade for my iPad?

  • Urgent ( Case about USER EXIT)

    I need to place a Botton in CN20J (Project Builder). How can I proceed, Can there are User Exit for this , If It is there Plz Try to Add a button to aopen an URL, I got aprocedure for URL. I need to place a button............ If possible Plz send the

  • Adjusting size and resolution question!

    I'm trying to adjust size/resolution of a collage that I created so that it will look good when printed on a 20 X 30 canvas.  How do I know the proper size and resolution to change it to?