Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
9 years ago

Access to ARAS's source Code

Hello, I’am sorry for my bad english. I’am new developer in ARAS and i can’t find the ARAS’s source Code to access to different Classes mention on Aras Innovator 11.0 – Programmers Guide. Thank you. cordially.

16 Replies

  • To search document:
    Item docItem = inn.applyAML("<AML> <Item action='get' type='Document'> <item_number>{DOCUMENT_NUMBER}</item_number> <Relationships> <Item action='get' type='Document File' /> </Relationships> </Item> </AML>");
    to each document can be linked one or more files, so you need to loop the result and "checkout" the file
    Item files = docItem.getItemsByXPath( "/Item[@type='File']" ); int fcount = files.getItemCount(); for( int i = 0; i < fcount; i++ ) { Item file = files.getItemByIndex( i ); Item result = file.checkout( "c:\\temp" ); if( result.isError() ) { Console.WriteLine( string.Format( "Failed to checkout file '{0}'", file.getProperty( "filename" ) ) ); } }
       
  • Ok that is fine. But where can i store the result of the search? and if i'am searching for a real document that exists in the database, how can i display his number and properties? Thank you. cordially.
  • I think  your questions are implementation questions - and not related to Aras. You need to create an interface to allow users to input they search criteria. After that you need to query the db based on user input (my previous answer)and then checkout the file. Then you need to save the data from Aras to document properties, so you will be able to upload the file back to the server. Creating integration between PLM (or other DB centric systems) with Office is not an easy task for beginner. You need to create interface and be able download and upload files. Check videos of this  Aras Office Integration  or this  Office Integration by Aras partner XPLM  or this Office Integration by MinveraPLM (Aras partner)  
  • Hello, I have  executed the code writen by you: Item docItem = inn.applyAML(“<AML> <Item action=’get’ type=’Document’> <item_number>{DOCUMENT_NUMBER}</item_number> <Relationships> <Item action=’get’ type=’Document File’ /> </Relationships> </Item> </AML>”); Item files = docItem.getItemsByXPath( “/Item[@type=’File’]” ); int fcount = files.getItemCount(); for( int i = 0; i < fcount; i++ ) { Item file = files.getItemByIndex( i ); Item result = file.checkout( “c:\\temp” ); if( result.isError() ) { Console.WriteLine( string.Format( “Failed to checkout file ‘{0}'”, file.getProperty( “filename” ) ) ); } }   with a real document name exists in my database. But i don't have any results ( no  Failed to checkout  file And no files downloaded in the temp folder) Should I create the folder "temp" or he will be created automatically?   thank you very much
  • the variable "fcount"  returns 0 despite of i am sure that i have two files(.doc and .pdf)  in the DB who are in relationship with the document. for the search with  "Item docItemm = inn.applyAML" i have done: Console.WriteLine(docItem); to see the result of search and i noticed that there is a mistake in the XML returned by the "docItemm ". So in the result i see: <thumbnail>vault:///?fileId=9429CCD4280644C0966893B14F45A671</thumbnail> But the vault:///?fileId=9429CCD4280644C0966893B14F45A671 should be between the symbole "" . What should i do? And thanks a lot!!