Clarity

 View Only
  • 1.  XOG in Attachments to Project (Missing ID)

    Posted Apr 01, 2016 01:44 AM

    Hi All,

     

    I'm having one issue with XOG in attachment to project because of missing project ID in XOG write XML file.... I was able to XOG read attachments from my project, however couldn't XOG in to project then.

     

    Overview: I have a process which XOG read some project, change some attributes, then creates new project and put those attributes there. That works fine for me.

    The problem comes when source project (call it proj1) contains also attachment (We have some custom attachment attributes on project). I have just found it's not possible to XOG read those attachments within a standard XOG project read. I've used your article and was able to XOG read attachments then:

     

    Attachments XOG read:

     

    <?xml version="1.0" encoding="UTF-8"?>  
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">  
      <Header action="read" externalSource="NIKU" objectType="customObjectInstance" version="13.3">  
              <args name="documentLocation" value="/home/clarity/mnt2/filestore"/>  
        </Header>  
      <CustomObjectInstanceQuery>  
        <Filter name="objectCode" criteria="EQUALS">project</Filter>  
        <Filter name="instanceCode" criteria="OR">022249</Filter>  
      </CustomObjectInstanceQuery>  
    </NikuDataBus> 
    
    

     

    XOG read output then was:

     


    <?xml version="1.0" encoding="UTF-8"?> 
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd"> 
      <Header action="write" externalSource="NIKU" objectType="customObjectInstance" version="13.3.0.286"/> 
      <customObjectInstances objectCode="project"> <!-- MISSING Project Code/ID for me there --> 
        <instance objectCode="project"> 
          <CustomInformation> 
            <ColumnValue name="hen_chargeable_stat">1</ColumnValue> 
      . 
      <!-- Some attributes were also there, deleted for better view.. --> 
      . 
            <ColumnValue name="hen_proj_brief_uploa">  <!-- ATTACHMENT 1 --> 
              <Documents> 
                <Parent documentLocation="/home/clarity/mnt2/filestore"> 
                  <Document fileCreatedDate="2016-03-29T10:52:28" language="en" mimeType="image/pjpeg" name="dsds.jpg"> 
                    <Version id="8425049" versionNumber="1"/> 
                  </Document> 
                </Parent> 
              </Documents> 
            </ColumnValue> 
            <ColumnValue name="z_del_fit_attachment">   <!-- ATTACHMENT 2 --> 
              <Documents> 
                <Parent documentLocation="/home/clarity/mnt2/filestore"> 
                  <Document fileCreatedDate="2016-03-29T11:06:17" language="en" 
                    mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" name="Shared UserID Activity Log_2016.xlsx"> 
                    <Version id="8425056" versionNumber="1"/> 
                  </Document> 
                </Parent> 
              </Documents> 
            </ColumnValue> 
          </CustomInformation> 
          <OBSAssocs complete="false"/> 
          <Security/> 
        </instance> 
      </customObjectInstances> 
    </NikuDataBus>
    
    

    Question is how can I update my new project (call it proj2) with those attachments? In XOG write (returned from xog.client) is not mentioned any Project ID,

    where I'd like to put my new project ID (proj2).

     

    Thanks for your advices,

    Matej



  • 2.  Re: XOG in Attachments to Project (Missing ID)

    Posted Apr 01, 2016 04:10 AM

    I'm little confused to see that the objectType in the header is customObjectInstance and not project.



  • 3.  Re: XOG in Attachments to Project (Missing ID)

    Posted Apr 01, 2016 04:14 AM

    Hi Sridhar,

     

    It's due to fact that with "project" you can't XOG read Attachments...with "customObjectInstance" it's then presented in XOG read as it's shown in my XML...

     

    Matej



  • 4.  Re: XOG in Attachments to Project (Missing ID)

    Posted Apr 01, 2016 07:58 AM

    Strange to hear.... I use the one in template prj_projects_read.xml and it works.



  • 5.  Re: XOG in Attachments to Project (Missing ID)

    Posted Apr 01, 2016 08:09 AM

    So please share me your XML read file, I can try it.

    When I used just this for project, no Attachments were read:

     

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header version="6.0.11" action="read" objectType="project" externalSource="NIKU">
    </Header>
      <Query>
      <Filter name="projectID" criteria="EQUALS">${project_id}</Filter>
      </Query>
    </NikuDataBus>
    

     

    Matej



  • 6.  Re: XOG in Attachments to Project (Missing ID)
    Best Answer

    Posted Apr 01, 2016 08:24 AM

    You missed to specify document location. You may try this

     

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd"> 

    <Header version="6.0.11" action="read" objectType="project" externalSource="NIKU"> 

         <args name="documentLocation" value="/home/clarity/mnt2/filestore"/> 

    </Header> 

      <Query> 

      <Filter name="projectID" criteria="EQUALS">${project_id}</Filter> 

      </Query> 

    </NikuDataBus> 



  • 7.  Re: XOG in Attachments to Project (Missing ID)

    Posted Apr 01, 2016 09:02 AM

    Hi Sridhar,

     

    Yes!, definitely.... Sorry, I was not aware about this "documentLocation" tag within Project XML document... Just found some thread where Suman Pramanik

    recommended to use "customObjectInstance" XML doc for retrieving attachments from project.... So thanks again.

     

    Matej