Skip to content

Commit

Permalink
Merge pull request #1 from nerygustavo/FIX_PUBLIC_URI
Browse files Browse the repository at this point in the history
reading public path from parameters
  • Loading branch information
nerygustavo committed Feb 16, 2016
2 parents c2a1757 + 9d700cc commit 2b4324e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions maximofactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ function MaximoFactory(options,cookie,callback)

this.resturl = url.parse(this.protocol+"://"+this.user+":"+this.password+"@"+this.hostname+":"+this.port);

this.resturl.auth_scheme = this.auth_scheme;

if(callback != null)
{
if(this.hostname === "" || this.user === "" || this.password === "")
Expand Down
3 changes: 3 additions & 0 deletions resources/connectors/authconnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ var AUTH_PATH = '/maximo/oslc/';

function AuthConnector(maximoRestUrl,maximopath)
{
X_PUB_PATH = maximoRestUrl.auth_scheme + '/oslc/';
AUTH_PATH = X_PUB_PATH;

this.maximoRestUrl = maximoRestUrl;
this.client = require(this.maximoRestUrl.protocol.split(':')[0]);
this.xpublicuri = this.maximoRestUrl.protocol+"//"+this.maximoRestUrl.hostname+":"+this.maximoRestUrl.port+X_PUB_PATH;
Expand Down
2 changes: 2 additions & 0 deletions resources/connectors/crudconnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ function CRUDConnector(maximoRestUrl,maximopath)
{
if(maximoRestUrl)
{
X_PUB_PATH = maximoRestUrl.auth_scheme + '/oslc/';

this.maximoRestUrl = maximoRestUrl;
if(typeof(this.maximoRestUrl) === "string")
{
Expand Down
2 changes: 2 additions & 0 deletions resources/connectors/fetchconnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ var ResourceSet = require('../resourceset');

function FetchConnector(maximoRestUrl,maximopath)
{
X_PUB_PATH = maximoRestUrl.auth_scheme + '/oslc/';

this.maximoRestUrl = maximoRestUrl;
this.client = require(this.maximoRestUrl.protocol.split(':')[0]);
this.xpublicuri = this.maximoRestUrl.protocol+"//"+this.maximoRestUrl.hostname+":"+this.maximoRestUrl.port+X_PUB_PATH;
Expand Down
2 changes: 2 additions & 0 deletions resources/connectors/relatedconnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ function RelatedConnector(maximoRestUrl,maximopath)
{
if(maximoRestUrl)
{
X_PUB_PATH = maximoRestUrl.auth_scheme + '/oslc/';

this.maximoRestUrl = maximoRestUrl;
if(typeof(this.maximoRestUrl) === "string")
{
Expand Down
4 changes: 4 additions & 0 deletions resources/resourceset.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ function ResourceSet(resourcemboset,cookie,maxfactory,mbo)
// Constructor 2
if(maxfactory != "undefined" && mbo != "undefined")
{
X_PUB_PATH = maxfactory.auth_scheme + '/oslc/';
REST_PATH = X_PUB_PATH + '/os/';

this.maximoRestUrl = maxfactory.resturl;
this.password = maxfactory.password;
this.mbo = mbo;
Expand All @@ -56,6 +59,7 @@ function ResourceSet(resourcemboset,cookie,maxfactory,mbo)
this.fconnect.authType = this.authType;
this.fconnect.authenticate(this.fconnect);
}

return this;
}
};
Expand Down

0 comments on commit 2b4324e

Please sign in to comment.