cancel
Showing results for 
Search instead for 
Did you mean: 

Edit Word Document

anakin59490
Star Contributor
Star Contributor

Hi,

Is-it possible to edit word document from an ADF app ?

I'm using alfresco-community edition 5.2 for backend app

and alfresco/adf-content-services 2.3.0 with Angular 5 for frontend

I found documentation about Word Office or open office but it's for action from Share not from ADF app

Thank you in advance

7 REPLIES 7

eugenio_romano
Elite Collaborator
Elite Collaborator

Hi ADF viewer has a concept of extensibility.

alfresco-ng2-components/viewer.component.md at development · Alfresco/alfresco-ng2-components · GitH... 

The community has created this extension that will allow you to solve this problem

 ng2-alfresco-aos-editonline - npm 

Hello Eugenio Romano‌,

I tried following adf-aos-editonline-action documentation to create the "Edit on MS Office" feature, and I'm currently having this error,

ERROR Error: "StaticInjectorError[AlfrescoApiService]:

    StaticInjectorError[AlfrescoApiService]:

        NullInjectorError: No provider for AlfrescoApiService!"

this is my app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { appRoutes } from './app.routes';
import { PreviewService } from './services/preview.service';
import { FileViewComponent } from './file-view/file-view.component';

// ADF modules
import { AdfModule } from './adf.module';

// App components
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { LoginComponent } from './login/login.component';
import { DocumentlistComponent } from './documentlist/documentlist.component';
import { AppLayoutComponent } from './app-layout/app-layout.component';

import { AosModule } from 'adf-aos-editonline-action';
import { AlfrescoApiService } from '@alfresco/adf-core';

@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    RouterModule.forRoot(
      appRoutes ,
       { enableTracing: false } // <-- debugging purposes only
    ),

    // ADF modules
    AdfModule,
    AosModule
  ],
  declarations: [
    AppComponent,
    HomeComponent,
    LoginComponent,
    DocumentlistComponent,
    AppLayoutComponent,
    FileViewComponent,
  ],
  providers: [
  PreviewService,
  AlfrescoApiService
  ],
  bootstrap: [AppComponent]
})

export class AppModule {
}

Hi Roman,

Why is AlfrescoApiService in your providers?

Hi David,

Because I thought that would be the fix, cause it's saying that there is no provider for the AlfrescoApiService in the error

Hi Roman,

I use the same extension to edit files online, but the complete module didn't work for me either. To be honest, I don't remember what the exact problem was. I think that the module is specifically made for ADF 1.8.0 & ADF 1.9.0 .
I solved it this way:

The code of the service itself works perfect.

anakin59490
Star Contributor
Star Contributor

Hi, thank you for answer,

but I use adf-content-services 2.6.0, is-it compatible ?

In my case, I have following screen :

Is it possible to show it with document in "edition mode" ?

I try to use WEBODF (https://webodf.org/) or libreoffice option to do it

is it possible to do that or must I use ng2-alfresco-aos-editonline - npm ?

I don't understand how to implement adf-extension in my case

<adf-viewer-extension [supportedExtensions]="['odt']" #extension>         
     <ng-template let-urlFileContent="urlFileContent" >                           
            ?????? <my-custom-txt-component ????????                
                urlFileContent="urlFileContent">            
             </my-custom-txt-component>        
     </ng-template>    
</adf-viewer-extension>

Thank you in advance

This extension is handled by the community I suggest you open an issue on their GitHub repo. You can may also help in debug or solve the problem