@@ -661,9 +661,9 @@ public OASISResult<IOAPPDNA> UnPublishOAPP(Guid OAPPId, ProviderType providerTyp
661661 // return result;
662662 //}
663663
664- public async Task < OASISResult < IOAPPDNA > > InstallOAPPAsync ( string fullPathToPublishedOAPPFile , string fullInstallPath , ProviderType providerType = ProviderType . Default )
664+ public async Task < OASISResult < IInstalledOAPP > > InstallOAPPAsync ( Guid avatarId , string fullPathToPublishedOAPPFile , string fullInstallPath , ProviderType providerType = ProviderType . Default )
665665 {
666- OASISResult < IOAPPDNA > result = new OASISResult < IOAPPDNA > ( ) ;
666+ OASISResult < IInstalledOAPP > result = new OASISResult < IInstalledOAPP > ( ) ;
667667 string errorMessage = "Error occured in OAPPManager.InstallOAPPAsync. Reason: " ;
668668
669669 try
@@ -674,13 +674,20 @@ public async Task<OASISResult<IOAPPDNA>> InstallOAPPAsync(string fullPathToPubli
674674
675675 if ( OAPPDNA != null )
676676 {
677- InstalledOAPP installedOAPP = new InstalledOAPP ( ) { OAPPDNA = OAPPDNA } ;
677+ InstalledOAPP installedOAPP = new InstalledOAPP ( )
678+ {
679+ OAPPDNA = OAPPDNA ,
680+ InstalledBy = avatarId ,
681+ InstalledOn = DateTime . Now ,
682+ InstalledPath = fullInstallPath
683+ } ;
684+
678685 OASISResult < IHolon > saveResult = await installedOAPP . SaveAsync ( ) ;
679686
680687 if ( saveResult != null && saveResult . Result != null && ! saveResult . IsError )
681688 {
682689 result . Message = "OAPP Installed" ;
683- result . Result = OAPPDNA ;
690+ result . Result = installedOAPP ;
684691 }
685692 else
686693 OASISErrorHandling . HandleError ( ref result , $ "{ errorMessage } Error occured calling SaveAsync method. Reason: { saveResult . Message } ") ;
@@ -694,9 +701,9 @@ public async Task<OASISResult<IOAPPDNA>> InstallOAPPAsync(string fullPathToPubli
694701 return result ;
695702 }
696703
697- public OASISResult < IOAPPDNA > InstallOAPP ( string fullPathToPublishedOAPPFile , string fullInstallPath , ProviderType providerType = ProviderType . Default )
704+ public OASISResult < IInstalledOAPP > InstallOAPP ( Guid avatarId , string fullPathToPublishedOAPPFile , string fullInstallPath , ProviderType providerType = ProviderType . Default )
698705 {
699- OASISResult < IOAPPDNA > result = new OASISResult < IOAPPDNA > ( ) ;
706+ OASISResult < IInstalledOAPP > result = new OASISResult < IInstalledOAPP > ( ) ;
700707 string errorMessage = "Error occured in OAPPManager.InstallOAPP. Reason: " ;
701708
702709 try
@@ -707,13 +714,20 @@ public OASISResult<IOAPPDNA> InstallOAPP(string fullPathToPublishedOAPPFile, str
707714
708715 if ( OAPPDNA != null )
709716 {
710- InstalledOAPP installedOAPP = new InstalledOAPP ( ) { OAPPDNA = OAPPDNA } ;
717+ InstalledOAPP installedOAPP = new InstalledOAPP ( )
718+ {
719+ OAPPDNA = OAPPDNA ,
720+ InstalledBy = avatarId ,
721+ InstalledOn = DateTime . Now ,
722+ InstalledPath = fullInstallPath
723+ } ;
724+
711725 OASISResult < IHolon > saveResult = installedOAPP . Save ( ) ;
712726
713727 if ( saveResult != null && saveResult . Result != null && ! saveResult . IsError )
714728 {
715729 result . Message = "OAPP Installed" ;
716- result . Result = OAPPDNA ;
730+ result . Result = installedOAPP ;
717731 }
718732 else
719733 OASISErrorHandling . HandleError ( ref result , $ "{ errorMessage } Error occured calling Save method. Reason: { saveResult . Message } ") ;
@@ -727,16 +741,16 @@ public OASISResult<IOAPPDNA> InstallOAPP(string fullPathToPublishedOAPPFile, str
727741 return result ;
728742 }
729743
730- public async Task < OASISResult < IOAPPDNA > > InstallOAPPAsync ( IOAPP OAPP , string fullInstallPath , ProviderType providerType = ProviderType . Default )
744+ public async Task < OASISResult < IInstalledOAPP > > InstallOAPPAsync ( Guid avatarId , IOAPP OAPP , string fullInstallPath , ProviderType providerType = ProviderType . Default )
731745 {
732- OASISResult < IOAPPDNA > result = new OASISResult < IOAPPDNA > ( ) ;
746+ OASISResult < IInstalledOAPP > result = new OASISResult < IInstalledOAPP > ( ) ;
733747 string errorMessage = "Error occured in OAPPManager.InstallOAPPAsync. Reason: " ;
734748
735749 try
736750 {
737751 string OAPPPath = Path . Combine ( "temp" , OAPP . Name , ".oapp" ) ;
738752 await File . WriteAllBytesAsync ( OAPPPath , OAPP . PublishedOAPP ) ;
739- result = await InstallOAPPAsync ( OAPPPath , fullInstallPath , providerType ) ;
753+ result = await InstallOAPPAsync ( avatarId , OAPPPath , fullInstallPath , providerType ) ;
740754 }
741755 catch ( Exception ex )
742756 {
@@ -746,16 +760,16 @@ public async Task<OASISResult<IOAPPDNA>> InstallOAPPAsync(IOAPP OAPP, string ful
746760 return result ;
747761 }
748762
749- public OASISResult < IOAPPDNA > InstallOAPP ( IOAPP OAPP , string fullInstallPath , ProviderType providerType = ProviderType . Default )
763+ public OASISResult < IInstalledOAPP > InstallOAPP ( Guid avatarId , IOAPP OAPP , string fullInstallPath , ProviderType providerType = ProviderType . Default )
750764 {
751- OASISResult < IOAPPDNA > result = new OASISResult < IOAPPDNA > ( ) ;
765+ OASISResult < IInstalledOAPP > result = new OASISResult < IInstalledOAPP > ( ) ;
752766 string errorMessage = "Error occured in OAPPManager.InstallOAPP. Reason: " ;
753767
754768 try
755769 {
756770 string OAPPPath = Path . Combine ( "temp" , OAPP . Name , ".oapp" ) ;
757771 File . WriteAllBytes ( OAPPPath , OAPP . PublishedOAPP ) ;
758- result = InstallOAPP ( OAPPPath , fullInstallPath , providerType ) ;
772+ result = InstallOAPP ( avatarId , OAPPPath , fullInstallPath , providerType ) ;
759773 }
760774 catch ( Exception ex )
761775 {
@@ -765,26 +779,26 @@ public OASISResult<IOAPPDNA> InstallOAPP(IOAPP OAPP, string fullInstallPath, Pro
765779 return result ;
766780 }
767781
768- public async Task < OASISResult < IOAPPDNA > > InstallOAPPAsync ( Guid OAPPId , string fullInstallPath , ProviderType providerType = ProviderType . Default )
782+ public async Task < OASISResult < IInstalledOAPP > > InstallOAPPAsync ( Guid avatarId , Guid OAPPId , string fullInstallPath , ProviderType providerType = ProviderType . Default )
769783 {
770- OASISResult < IOAPPDNA > result = new OASISResult < IOAPPDNA > ( ) ;
784+ OASISResult < IInstalledOAPP > result = new OASISResult < IInstalledOAPP > ( ) ;
771785 OASISResult < IOAPP > OAPPResult = await LoadOAPPAsync ( OAPPId , providerType ) ;
772786
773787 if ( OAPPResult != null && ! OAPPResult . IsError && OAPPResult . Result != null )
774- result = await InstallOAPPAsync ( OAPPResult . Result , fullInstallPath , providerType ) ;
788+ result = await InstallOAPPAsync ( avatarId , OAPPResult . Result , fullInstallPath , providerType ) ;
775789 else
776790 OASISErrorHandling . HandleError ( ref result , $ "Error occured in OAPPManager.InstallOAPPAsync loading the OAPP with the LoadOAPPAsync method, reason: { result . Message } ") ;
777791
778792 return result ;
779793 }
780794
781- public OASISResult < IOAPPDNA > InstallOAPP ( Guid OAPPId , string fullInstallPath , ProviderType providerType = ProviderType . Default )
795+ public OASISResult < IInstalledOAPP > InstallOAPP ( Guid avatarId , Guid OAPPId , string fullInstallPath , ProviderType providerType = ProviderType . Default )
782796 {
783- OASISResult < IOAPPDNA > result = new OASISResult < IOAPPDNA > ( ) ;
797+ OASISResult < IInstalledOAPP > result = new OASISResult < IInstalledOAPP > ( ) ;
784798 OASISResult < IOAPP > OAPPResult = LoadOAPP ( OAPPId , providerType ) ;
785799
786800 if ( OAPPResult != null && ! OAPPResult . IsError && OAPPResult . Result != null )
787- result = InstallOAPP ( OAPPResult . Result , fullInstallPath , providerType ) ;
801+ result = InstallOAPP ( avatarId , OAPPResult . Result , fullInstallPath , providerType ) ;
788802 else
789803 OASISErrorHandling . HandleError ( ref result , $ "Error occured in OAPPManager.InstallOAPP loading the OAPP with the LoadOAPP method, reason: { result . Message } ") ;
790804
0 commit comments