GithubHelp home page GithubHelp logo

oracle-samples / vbcs-samples Goto Github PK

View Code? Open in Web Editor NEW
38.0 16.0 37.0 81.65 MB

Samples Applications for Visual Builder Cloud Service

Home Page: https://cloud.oracle.com/visual-builder

License: Other

JavaScript 18.37% HTML 51.51% CSS 1.71% SCSS 28.40%
oracle-cloud

vbcs-samples's People

Contributors

bfrybfry avatar dkonecny-oracle avatar groundside avatar johnceccarelli avatar sherrs avatar spavlusieva avatar srini-oracle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vbcs-samples's Issues

Error while uploading blob using JS in mobile app

Hi..i am working on mobile application. i have created an endpoint for uploading image on oracle cloud . when i am uploading images using Action chain it is working fine but i have to upload file using JS .
These are the details of endpoint
Screenshot 2020-03-09 at 7 09 44 PM
Screenshot 2020-03-09 at 7 10 19 PM

i have to make POST request using JS . for making request i am using following code.

function readBinaryFile(filename) {
//fetching blob using
 var reader = new FileReader();
 reader.onloadend = function () {
var blob = dataURItoBlob(reader.result);
//Sending Post request on oracle visual builder endpoint using fetch
const response = await fetch(url, {
      method: 'POST',
      body: blob,
      headers: {
        'content_type': 'image/jpg',
        'title':filename
      }
      });
      if(response.ok){
        confirm("Response Ok");
        confirm(response.text());
       }else{
         confirm("Blob resquest result : ",response.text());
       }
//Sending Post request on oracle visual builder endpoint using httprequest
  var httpRequest = new XMLHttpRequest();
  httpRequest.onreadystatechange = function() {       
            if (httpRequest.readyState == 4)
            {  
              confirm(JSON.stringify(httpRequest));
            }else{
              confirm(JSON.stringify(httpRequest));
              return false;
            }
          
        }
  
    var beartoken="bear-token";

    httpRequest.open('POST', url);
    httpRequest.setRequestHeader('Authorization', 'Bearer '+beartoken);
    httpRequest.setRequestHeader('content-type', 'image/jpg');
    httpRequest.send(blob);
}
 reader.readAsDataURL(file);
    }, onErrorReadFile);
}
function dataURItoBlob(dataURI) {
	 var arr = dataURI.split(','), mime = arr[0].match(/:(.*?);/)[1];
	 return new Blob([atob(arr[1])], {type:mime});
}

Output of blob data is :
image

Response Received

image

I have also tried to write code in html for sending post request but i am getting following error but getting following error :

Access to XMLHttpRequest at 'https://url/test/gallery/images' from origin 'null' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.

i am using following code for making request using javascript in html page

Html
<input type='file' accept='image/*' onchange='openFile(event)'><br>
	<img id='output'>
Javascript
var openFile = function(event) {
		    var input = event.target;

		    var reader = new FileReader();
		    reader.onload = function(){
		      var dataURL = reader.result;
		      var output = document.getElementById('output');
		      output.src = dataURL;

		      var blob = dataURItoBlob(reader.result);
		      var filename = "testing_blob";

		      var beartoken = "token";

		      const response = fetch('url', {
		      method: 'POST',
		      body: blob, // string or object
		      headers: {
		        'content_type': 'image/png',
		        'title':filename,
		        'Access-Control-Allow-Origin':'*',
		        'Authorization': 'Bearer '+beartoken
		      }
		      });
		      sendImageRequest("url",blob);
		      
		    };
		    reader.readAsDataURL(input.files[0]);
		  };
		  function dataURItoBlob(dataURI) {
			    var arr = dataURI.split(','), mime = arr[0].match(/:(.*?);/)[1];
			    return new Blob([atob(arr[1])], {type:mime});
		}
function sendImageRequest(url="",datatosend){
  
  var httpRequest = new XMLHttpRequest();
  
  httpRequest.onreadystatechange = function() { 
        
            if (httpRequest.readyState == 4)
            {
            	console.log(JSON.stringify(httpRequest));  
              return true;
            }else{
              console.log(JSON.stringify(httpRequest));  
              return false;
            }
          
        }
    var beartoken="xx";
    httpRequest.open('POST', url);
    httpRequest.setRequestHeader('Authorization', 'Bearer '+beartoken);
    httpRequest.setRequestHeader('content-type', 'image/jpg');
    httpRequest.setRequestHeader('Access-Control-Allow-Origin','*');
    httpRequest.send(datatosend);
    
}

Question :

  1. How can i upload blob or .png on above endpoint (endpoint in first url) using JS in mobile application ?

ApplicationsCloudUI for vbcs 2104

Hi, we are using vbcs 2104 version with JET 9.2 and we are receiving console logs like this

Your CSS file is compatible with JET version undefined, but you are using JET version 9.2.6.
Please update your CSS to match the version of JET being used.

We are using ApplicationsCloudUI version 4.0.0

Visual builder disable issue

I am working on a mobile app . i have to create a drop down list (Select One) . i have to disable first option when user click on list . Suppose drop down contains following options

  1. Please Select Value
  2. Value 1
  3. Value 2
    so when user click/tap on the drop down above value should appear to the user ."Please Select Value" Option should be disabled . user cannot select it . Other option like Value 1 and Value 2 user can select it.
    I have tried to disable value of "Please Select Value" Option .For some drop down it is working but not for all.
    while development when i run Mobile App in Web Browser then sometimes it shows "Please Select Value " option disabled but when i build APK of the same code and install it on my device then "Please Select Value " is not disabled .
    How can i find reason why list options are not disabling ?

error at ojet restore

Hi i'm trying to get the ApplicationsCloudUITheme 6.0 to use it in last vbs runtime, but I get an error when I run ojet restore command. From the error log file:

1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/opc/visualbuilderthemes/vbcs-samples-master/ApplicationsCloudUITheme/ApplicationsCloudUIThemeSource/.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:/home/opc/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/etc/npmrc Completed in 7ms
14 timing config:load:global Completed in 8ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 16ms
19 timing npm:load:configload Completed in 18ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 2ms
23 verbose logfile /home/opc/.npm/_logs/2021-12-09T15_13_03_422Z-debug-0.log
24 timing npm:load:logFile Completed in 3ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 24ms
28 timing arborist:ctor Completed in 0ms
29 silly logfile start cleaning logs, removing 3 files
30 timing idealTree:init Completed in 206ms
31 warn old lockfile
31 warn old lockfile The package-lock.json file was created with an old version of npm,
31 warn old lockfile so supplemental metadata must be fetched from the registry.
31 warn old lockfile
31 warn old lockfile This is a one-time fix-up, please be patient...
31 warn old lockfile


1729 verbose type system
1730 verbose stack FetchError: request to https://artifacthub-tip.oraclecorp.com/api/npm/npmjs-remote/zip-stream/-/zip-stream-4.1.0.tgz failed, reason: getaddrinfo ENOTFOUND artifacthub-tip.oraclecorp.com
1730 verbose stack     at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:110:14)
1730 verbose stack     at ClientRequest.emit (node:events:394:28)
1730 verbose stack     at TLSSocket.socketErrorListener (node:_http_client:447:9)
1730 verbose stack     at TLSSocket.emit (node:events:406:35)
1730 verbose stack     at emitErrorNT (node:internal/streams/destroy:157:8)
1730 verbose stack     at emitErrorCloseNT (node:internal/streams/destroy:122:3)
1730 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)

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.