Profile picture for user rllasera

Hi,

I need to upload files to a DMS (Sharepoint) with an Aris script. I'm looking for information but I don't find any information about it. I think that it's possible to use the JCR (Java Content Repository) but I don't know which is the way.

I've installed the Entropy Federation Server and setup Aris for use DMS. Now I can upload documents from Aris using the link attributes, but I need to do this by script and not manually.

 

Anybody can help me?.

 

Thanks.

by Jens Heylmann
Posted on Fri, 04/19/2013 - 14:07

Hello Rafael,

first navigate to aris.softwareag.com to download the DMS Add-on and the DMS documentation

http://aris.softwareag.com/ARISDownloadCenter/ADCCart?downloadfile=ARIS724_DBMS_759374.zip&downloadfileindex=132&fileSize=71.24%20KB&groupname=ARIS%20Platform%207.2.x&protocol=http&path=smb://aris.softwareag.com/ARIS_Download_Center/released/ARIS_720/DBMS/ARIS724_DBMS_759374.zip&buildversion=7.2.4.759374&dlanguage=null

Use the "DMSIntegration" component in ARIS script to access the DMS API methods:

var dmscomponent = Context.getComponent("DMSIntegration");

Regards,

Jens

0
by Rafael César Llasera Fantova Author
Posted on Fri, 04/19/2013 - 15:05

Hello Jens,

 

First of all, thank you very much for your help.

This link you give me is for download the dbms scripts for setup a external database, like Oracle or others. I saw that exists a zip with the dms documentation, but I can't find it. Would you give me it?.

I found the DMS API (DMSIntegration) description. Can you give me an example of dms connection with ARIS scripting?.

 

Best regards,

Rafa.

0
by Jens Heylmann
Posted on Fri, 04/19/2013 - 15:35

Ok the link is not working. Try this link:

http://aris.softwareag.com/ARISDownloadCenter?groupname=ARIS%20Platform%207.2.x&language=en

Search in the list for "ARIS Document Management System" and download the ZIP.

And here is an example how to connect to a DMS system within script:

var dmscomponent = Context.getComponent("DMSIntegration");
var availableSystems = dmscomponent.getAvailableDMSSystems();
var testSystem = availableSystems.get(0);
dmscomponent.connectToDMS(testSystem, "", "");

Regards,

Jens

0
by Jens Heylmann
Posted on Fri, 04/19/2013 - 15:55

In addtion to the further post.

Sorry, the DMS documentation is no longer available on ARIS download center. 

0
by Rafael César Llasera Fantova Author
Posted on Mon, 04/22/2013 - 13:23

Hi,

The connection with DMS seem that runs ok using your code. Once I'm connected I use the writeToDMS function to upload a document to the DMS.

I don't know how to pass the first parameter to the function.

 

This is my code:

 var dmscomponent = Context.getComponent("DMSIntegration"); 
 var availableSystems = dmscomponent.getAvailableDMSSystems(); 
 var testSystem = availableSystems.get(0); 
 var miconexion = dmscomponent.connectToDMS(testSystem, "dmadmin", "dmadmin");  
 
 // Get file from client
 var selectedFiles = Dialogs.getFilePath(null, "DOC files|*.doc||", null, "Seleccionar archivo", 0);
 if(selectedFiles==null){
        Dialogs.MsgBox("Please, select a file.");
 }
 
 var miresultwrite=dmscomponent.writeToDMS (selectedFiles[0].getData(), 'Prueba upload mi manual', '/demo/cesar/' );

 

Thank you.

0
by Jens Heylmann
Posted on Mon, 04/22/2013 - 15:40

The first parameter has to be a java.io.File object.

Look at this example.

/**
    * Creates a new version of a already exisiting document when there is a valid document ID {documentID} 
    * If the document ID {documentID} is null a new document is created in the path specified in parameter {filepath}
    * @param {String} filepath The path of the file from the client to upload
    * @param {String} filename The filename of the file from the client to upload 
    * @param {String} documentType The DMS document type
    * @param {String} dmspath The DMS path where to save the document in the DMS path structure
    * @param {String} checkInComment The DMS checkin comment for the new version of the document
    * @param {String} versionKind The kind of version (minor / major ) as com.idsscheer.aris.cltech.common.core.dmsintegration.DMSVersionKind constant
    * @param {String} documentID The ID of the document in the DMS
    * @return {DMSFileItem}
    */  
    this.uploadVersion = function( filepath, filename, documentType, dmsPath, checkInComment, versionKind, documentID ) {
        if( this.isConnected() ) {
            var fileItemObject = new Packages.com.idsscheer.aris.cscommon.dmsintegration.data.ADMSFileItem();
            var versionOptions = new Packages.com.idsscheer.aris.cscommon.dmsintegration.data.ADMSVersionCreationOptions();
            
            var file = new Packages.java.io.File(filepath, filename); 
            
            //var dmsFileItem = m_DMSComponent.getMetadata ( dmsPath, filename, documentType );            
            
            if( documentID == null || documentID == "" ) {
                var dmsFileItem = m_DMSComponent.readFromDMS ( dmsPath, filename, documentType, documentID );
                //create new file and upload the file to DMS       
                return m_DMSComponent.writeToDMS ( file, documentType, dmsPath );                               
            }
            var dmsFileItem = m_DMSComponent.readFromDMS ( "", "", documentType, documentID );
            if( dmsFileItem == null ) {
                //invalid documentID found
                var dmsFileItem = m_DMSComponent.readFromDMS ( dmsPath, filename, documentType, "" );
                //create new file and upload the file to DMS       
                return m_DMSComponent.writeToDMS ( file, documentType, dmsPath );                   
            }
                                            
            versionOptions.setVersionKind(versionKind);       
            versionOptions.setCheckinComment(checkInComment);
            fileItemObject.setName(filename);
            fileItemObject.setGuid( dmsFileItem.getGuid() );
            
            var dmsVersion =  m_DMSComponent.createVersion(fileItemObject, file, versionOptions);
            return m_DMSComponent.getMetadata ( dmsPath, filename, documentType );
        }
        return null;
    }
0
by Rafael César Llasera Fantova Author
Posted on Tue, 04/23/2013 - 09:39

Hi,

I tried create folders with createNewFolder method and to move files from one folder to other in DMS and runs Ok, but I can't upload files using java.io.File with readFromDMS method, I obtain a null pointer exception and all seems ok.

 

This is my code:

 var dmscomponent = Context.getComponent("DMSIntegration");
 var availableSystems = dmscomponent.getAvailableDMSSystems();
 var testSystem = availableSystems.get(0);
 var miconexion = dmscomponent.connectToDMS(testSystem, "dmadmin", "dmadmin"); 
 var miFile = new Packages.java.io.File("c:\\a\\","Informe.pdf");


 if (miFile.exists())
 {   
  if (miFile.canRead())
  {     
   var miLogitud = miFile.length();   
   var miprueba= dmscomponent.writeToDMS(miFile, 'prueba', '/demo/myfolder/');
  }  

In the log file 'contentrepository.log' this is the error:

2013-04-22T18:03:50,452  com.idsscheer.contentrepository.core.exception.helper.CRExceptionHelper.handleNoSuchObjectException

Error writing to DMS!

com.idsscheer.contentrepository.core.exception.CRNoSuchObjectException: No such object; nested exception is java.lang.NullPointerException

- Repository: demo

- Requested type: class com.idsscheer.contentrepository.provider.entropysoft.implementation.CRESDocument

- Init args: [com.idsscheer.contentrepository.provider.entropysoft.implementation.CRESService@6cd5c1ba, ]

 at com.idsscheer.contentrepository.core.exception.helper.CRExceptionHelper.handleNoSuchObjectException(CRExceptionHelper.java:186)

 at com.idsscheer.contentrepository.core.configuration.implementation.CRContentServiceBase.createItem(CRContentServiceBase.java:310)

 at com.idsscheer.contentrepository.provider.entropysoft.implementation.CRESService.createImpl(CRESService.java:325)

 at com.idsscheer.contentrepository.core.configuration.implementation.CRContentServiceBase.create(CRContentServiceBase.java:342)

 at com.idsscheer.aris.server.bl.logic.dmsintegration.ADMSIntegrationEngine.writeToDMS(Unknown Source)

 at com.idsscheer.aris.server.bl.logic.dmsintegration.ADMSIntegrationScriptInterface.writeToDMS(Unknown Source)

 at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)

 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

 at java.lang.reflect.Method.invoke(Method.java:601)

 at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160)

 at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)

 at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)

 at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)

 at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)

 at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)

 at com.idsscheer.report.execution.javascript.AScriptContextFactory.doTopCall(AScriptContextFactory.java:226)

 at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003)

 at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:173)

 at com.idsscheer.report.execution.debugger.backend.AScriptDebugger.startScript(AScriptDebugger.java:162)

 at com.idsscheer.report.execution.interpreter.AJReportDebugger.executeReport(AJReportDebugger.java:134)

 at com.idsscheer.aris.server.bl.logic.webreport.scripting.AJavaScriptReportThread.run(Unknown Source)

 at com.idsscheer.aris.server.bl.logic.webreport.scripting.AJavaScriptDebuggerThread.run(Unknown Source)

 at java.lang.Thread.run(Thread.java:722)

Caused by: java.lang.NullPointerException

 at com.idsscheer.contentrepository.core.configuration.implementation.CRContentServiceBase.createItem(CRContentServiceBase.java:301)

 ... 21 more

 

 

I don't know what's the problem, I don't see differences between your code.

 

 

Best regards.

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks
  • SS
  • MZ
  • Profile picture for user kbiront
  • Profile picture for user Tony Iliev
  • Profile picture for user amandeep.7.singh
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock