Standalone Angular Viewer

Hello, may I know if there is any way to deploy just the Angular UI of the viewer? I tried to deploy but it seems like the guides are outdate and lot of changes have been made.

@danishPersys

Yes, you can deploy just the Angular UI but you’ll need some service that would convert documents to HTML or PNG and send them to the UI.

I need to know if its possible to integrate the ui with java ee. I am using rest api , jaxrs so I cannot use spring for deployment

@danishPersys

In general, the UI expects some endpoint that returns data in a predefined format. So, you can use any technology to implement the service.

What type of data that I need to return? I have connected point it to the endpoint but I got another error as in picture. Also here are the controller files that I configured. Also I use the index.html in dist file after ng build. Is that correct?

ss63.PNG.jpg (204.1 KB)
viewer.7z (2.3 KB)

@danishPersys

Thank you for attaching the screenshot with errors. It seems that the endpoint does not work as it responds with 500 error code. Please make sure that http://192.168.1.191:9080/Affin/REST2/viewer/loadConfig works well in your browser and responds with json.

Yes, that is correct. The index.html contains links to javascript files.

Hello, want to ask has this fix been applied to Java yet?
ss73.PNG (33.2 KB)

@danishPersys

Yes, this issue has been already fixed. The latest version of GroupDocs.Viewer 22.9 no longer needs this fix.

Where do I get the 22.9 version?

@danishPersys

This version is available in our artifacts repository - GroupDocs.Viewer | Java On-premise API to View & Render Docs and at releases section - GroupDocs.Viewer | Java On-premise API to View & Render Docs. In case you’re using Maven the setup would be the folowing

<repository>
    <id>groupdocs-artifacts-repository</id>
    <name>GroupDocs Artifacts Repository</name>
    <url>https://repository.groupdocs.com/repo/</url>
</repository>

and

<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-viewer</artifactId>
    <version>22.9</version>
</dependency>

Hello, can you help me to construct a viewer controller because I have been trying to call but it is not working as I get NullPointerException. Here are the files. I want to show just the viewer without other options like rotate, download, print and other options.

service.7z (4.5 KB)

@danishPersys

Can you please share a sample application so we could reproduce the same issue at our side?

This is the files. I use JAX-RS for this instead of spring because the Webpshere version that we use does not support spring. I tested with loadConfig only and receive return but program did not run when I include other paths.

@danishPersys

Thank you for adding the link to the project file. We’ll take a look and update you.

@danishPersys
Here is a sample project that uses JAX-RS and Viewer. It handles two request: the first returns index page of UI and the second returns json config, that is processed by UI. To make the UI work you should implement other requests, examples of which you can find in Spring sample.
The project can be built using Maven command
mvn clean compile package
When build process will be finished, you will find file ROOT.war in target directory. The file can be deployed to any web server.
Note: classes, except ViewerService were copied from Spring project and may be optimized.

Thank you ! It can be deployed and run in the browser. Now that it is looking for other api such as /loadDocumentDescription . How do I setup for other calls? I tried to configure but it shows NullPointerException

@danishPersys

You’re welcome! You would probably want to copy the code from one of our demos to make it work.

Hello, I have tried many ways to solve the missing dependency error by including jar files and still cannot figure out why it cannot load other path. Please help me. Attached is the link to the file.

@danishPersys

Thank you for attaching the sources. We’ll take a look and update you.

@danishPersys

What do you mean talking “missing dependency error”? As I see, attached archive has WAR file, that means you compiled the project successfuly. Having problems with dependencies, it would be impossible to build it.
On Screenshot (81.9 KB) you can see that it is very easy to build the project from command line without any problems.

Is it possible that your Maven isn’t configured correctly? In this way you can configure it according to Maven documentation.

Another option is that you are talking about dependency problems inside IDE. In this way you should read IDE documentation, specially part about openning and configuring Maven projects. All modern IDE supports Maven projects. In some IDE you should install additional plugin, in others shouldn’t. Just open the project in IDE as Maven project, not as embedded project. More details you can find in IDE documentation.

Thank you for attaching the project. It would be better additionally attach screenshot of the problem or copied error message so that we will understand which problem you met.

@vladimir.litvinchik