Coder Social home page Coder Social logo

livehome2008 / documentum-rest-client-angular-filemanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enterprise-content-management/documentum-rest-sample-filemanager

0.0 2.0 0.0 8.16 MB

A sample AngularJS application for Documentum REST Services

License: Apache License 2.0

JavaScript 68.03% CSS 6.15% HTML 25.82%

documentum-rest-client-angular-filemanager's Introduction

Documentum REST Services Angular File Manager Sample

License: Apache 2

The project customizes Angular File Manager to demonstrate the AngularJS application development for Documentum REST Services.

Different with Angular File Manager, we customized the API javascript in the project to make direct access to Documentum REST Services. This is more efficient with respect to the data transfer.

1. Project dependencies

  • NodeJS is used to run the app on a server.
  • AngularJS is used as the frontend framework.
  • Gulp jobs for development, building, emulating, running your app, compiles and concatenates Sass files, local development server with live reload.
Tip

You don't need to setup anything at this moment, please keep patience to follow next sections to install software.

2. Getting started

Preparation

  • Assumed that you have Documentum Content Server 7.1+ up and running
  • Enable CORS support in Documentum REST Services by customizing dctm-rest.war\WEB-INF\classes\rest-api-runtime.properties, update dfc.properties in the same directory and deploy the WAR.
#
# Copyright (c) 2016. EMC Corporation. All Rights Reserved.
#

# Sets user defined runtime properties below. Settings in this file override the default ones defined in specific
# libraries. Please refer to file 'rest-api-runtime.properties.template' for available runtime configurations.

rest.cors.enabled=true

CORS support is built into Documentum REST Services since 7.3. For previous versions, you need to seek an outside solution, for instance, node-http-proxy. Please read Working-around-CORS for the deployment on REST 7.2 and earlier versions.

Build and Run

  • If you don't have NodeJS installed yet, download and install it.

NodeJS 4.x is recommended. You might run into build errors using NodeJS 5.x.

  • If you don't have Git installed yet, download and install it.
  • If you don't have bower installed yet, run below CLI command to install it:
> npm install -g bower
  • If you don't have gulp installed yet, run below CLI command to install it:
> npm install -g gulp
  • Clone the project to you local workspace and navigate to the project home directory
  • Run below CLI commands in sequence to build the project:
> npm install --save-dev
> bower install
> gulp
  • Run below CLI to start the SPA in a local web server (default port to 3000):
> gulp serve

Your web browser will be promoted to access the URL http://localhost:3000. If it did not get promoted, try to manually access this URL in your web browser.

Goole Chrome and Mozilla Firefox are recommended. Microsoft Internet Explorer does not has the full support for HTML5 features demonstrated in this app.

3. Demo

4. Feature Overview

4.1 Sign in and sign out

This sample application implements a very simple sign-in and sign-out process based on HTTP basic authentication.

Sample code at src/app/filemanager/services/dctm.auth.js

service.try_login = function (username, password) {
    var authdata = Base64.encode(username + ':' + password);
    $http.defaults.headers.common['Authorization'] = 'Basic ' + authdata;            
};

4.2 Content functions

This smaple application impelments below content operations:

  • Folder navigation
  • Create folder
  • Import document
  • Preview content
  • Download content
  • Edit textual content online
  • Rename
  • Copy
  • Move
  • Delete
  • Full-text search
  • Pagination

Sample code at src/app/filemanager/services/dctm.restclient.js

dctmRestClient.prototype.getHomeDocument = function(homedocUrl) {
    return get(this, homedocUrl, 'error_getting_home_document');
}

dctmRestClient.prototype.listRepositories = function(homeDocument) {
    var repositoriesUrl = homeDocument.resources['http://identifiers.emc.com/linkrel/repositories'].href;
    return get(this, repositoriesUrl, 'error_getting_repository_list');
}

4.3 Error handling

For an invalid operation, the error detail will be reported on the UI directly.

Sample code at src/app/filemanager/templates/modals.html

<script type="text/ng-template" id="error-bar">
  <div class="label label-danger error-msg pull-left animated fadeIn" ng-show="apiMiddleware.restClient.error">
    <i class="glyphicon glyphicon-remove-circle"></i>
    <span>{{apiMiddleware.restClient.error}}</span>
  </div>
</script>

documentum-rest-client-angular-filemanager's People

Contributors

gentlewind avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.