where create.php needs to be located for remotely saving the pdf generated using alivepdf with flex - flex4

I am using alivepdf library to generate pdf with flex 4.6
While saving pdf i am using the following line
myPDF.save( Method.REMOTE, "http://alivepdf.bytearray.org/wp-content/demos/create.php", "inline", "drawing.pdf", "_blank" );
Could you please guide where to place the create.php in our server so that i dont have to use alivepdf server.
We are using Apache tomcat server 7.

I believe you can place it at the root of your server... I think it uses port 8888
so try "localhost:8888/create.php"

Related

How do I access BlockBlobClient in Azure Storage JavaScript client library for browsers?

I'm attempting to use BlockBlobClient in a browser page to upload a file using a server-supplied sastoken / URL, similar to this C# code:
var blob = new CloudBlockBlob(new Uri(assetUploadUrl));
blob.UploadFromFile(FilePath, null, new BlobRequestOptions {RetryPolicy = new ExponentialRetry()});
Although the docs suggest BlockBlobClient is available in #azure/storage-blob and should be able to upload browser data from an input[type=file] element using uploadBrowserData, I can find no reference to BlockBlobClient in the browser library source. I looked into modifying the browserify export scripts but I can't find any references in the main package source either. Also the example code suggests that using #azure/storage-blog gives you a BlobServiceClient by default:
const { BlobServiceClient } = require("#azure/storage-blob");
Is BlockBlobClient actually available in the JavaScript client library?
Okay I've figured this out, I need to use the Azure Storage client library for JavaScript, there's even a sample of doing exactly what I need to do. Now I just need to figure out how to bundle npm package files for use in Razor pages.

PasteFromOffice option in classic ckeditor 5

I am trying to setup classic ckeditor in my angularjs application. I have installed via npm and classic ckeditor 5 is up.
I am trying to copy paste contents to ckeditor but it is failing with the error saying filerepository-no-upload-adapter: Upload adapter is not defined.
Does this error mean the final classic ck editor build(12.3.1) doesnt have this plugin?
Below is the code which I am trying.
ClassicEditor.create( document.querySelector( '#editor' )
)
.catch( error => {
console.error( error );
} );
ClassicEditor.builtinPlugins.map( plugin => console.log(plugin.pluginName) );
ClassicEditor.builtinPlugins.map logs 'alignment','Essentials','CKFinderUploadAdapter','Autoformat','BlockQuote','CKFinder','EasyImage','Image','ImageCaption','ImageStyle','ImageToolbar','ImageUpload','List','MediaEmbed','Paragraph','PasteFromOffice','Table','TableToolbar'
Does this mean the final classic ck editor build(12.3.1) have these plugins?
the filerepository-no-upload-adapter means that your editor instance does not have any upload adapter defined. The best way to learn about defining an upload adapter is to follow the Image upload overview and either use (thus configure it) one of the official upload adapters or create a custom upload adapter for your server.
ps.: There's an issue that currently the CKEditor 5 have not an official plugin for inserting images via a URL. However, there's a guide for that.

Calls From External Web Components in PWAs [duplicate]

We are running 2 servers. Server 1 hosts a react application. Server 2 hosts a webcomponent exposed as a single javascript bundle along with some assets such as images. We are dynamically loading the webcomponent Javascript hosted on Server 2 in our react app hosted on Server 1. The fact that it is a webcomponent might or might not affect the issue.
What's happening is that the webcomponent makes uses of assets such as images that are located on Server 2. But when the react app loads the webcomponent, the images are not found as its looking for the images locally on Server 1.
We can fix this in many ways. I am looking for the simplest fix. Since Server 1 app and Server 2 apps are being developed by different teams both should be able to develop in the most natural way possible without making allowances for their app being potentially loaded by other apps.
The fixes that I could think of was:
Making use of absolute URLs to load assets - Need to know the deployed location in advance .
Adding a reverse proxy to Server 1 to redirect to Server 2 whenever a particular path is hit - Need to configure this. The React app could load hundreds of webcomponents, viz we need add a lot of reverse proxies.
Embed all assets into the single javascript on Server 2, like embed svgs into the javascript. - Too limiting. If the SVGs are huge and will make the bundle size bigger.
I was hoping to implement something like -
Since the react app knows where to hit Server 2, can't we write some clever javascript that will make the browser go to Server 2 whenever assets are requested by a Javascript loaded by Server 2.
If you download your Web Component via a classic script (<script> with default type="text/javascript") you can retrieve the URL of the loaded file by using document.currentScript.src.
If you download the file as a module script (<script> with type="module"), you can retrieve the URL by using import.meta.url.
Parse then the property to extract the base path to the Web Component.
Example of Web Component Javascript file:
( function ( path ) {
var base = path.slice( 0, path.lastIndexOf( '/' ) )
customElements.define( 'my-comp', class extends HTMLElement {
constructor() {
super()
this.attachShadow( { mode: 'open' } )
.innerHTML = `<img src="${base}/image.png">`
}
} )
} ) ( document.currentScript ? document.currentScript.src : import.meta.url )
How about uploading all required assets to a 3rd location, or maybe an AWS S3 bucket, Google Drive, Dropbox etc.? That way those assets always have a unique, known URL, and both teams can access them independently. As long as the names remain the same, so will the URLs.

Empty result from Virtual Member Manager IBM Websphere WAS 8.5

I am using IBM websphere application server, I am trying to access the default file repository from my application using the virtual member manager, below is the code I use, it works well but I got an empty result, I checked the fileRegistry.xml file and it contains users, can anyone tell my where is my problem?
DataObject root = SDOHelper.createRootDataObject();
DataObject searchCtrl = SDOHelper.createControlDataObject(root,null,SchemaConstants.DO_SEARCH_CONTROL);
searchCtrl.getList(SchemaConstants.PROP_PROPERTIES).add("uid");
searchCtrl.getList(SchemaConstants.PROP_SEARCH_BASES).add("o=defaultWIMFileBasedRealm");
searchCtrl.setString(SchemaConstants.PROP_SEARCH_EXPRESSION,"#xsi:type='PersonAccount' and uid='*'");
root = getVMMService().search(root);
System.out.println("Output data graph"+ printDO(root));
Does the getVMMService() method get an instance of LocalServiceProvider ? I run the example in an standAlone app, in the example http://www.ibm.com/developerworks/websphere/zones/portal/proddoc/dw-w-userrepository/ is call it via corba protocol, when I try with Servlets for testing, I comment those lines

Selenium server not starting for custom firefox profile

I'm trying to start the selenium server by passing custom firefox profile to the DefaultSelenium constructor. It opens the browser with specified URL.
DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*custom \"C:/Program Files/Mozilla Firefox/firefox.exe\"",ReadConFile.readcoFile("serverName"));
selenium.start();
the log is
16:39:19.246 INFO - Allocated session 4eb63d37a4ba4d2fb4e351f8f59e3ea6 for https://<myURL>, launching...
then it stays like that and server doesn't start.
however, this works fine if I don't use custom profile.
DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*chrome",ReadConFile.readcoFile("serverName"));
selenium.start();
I need the launch custom profile as I've saved some site certificates necessary for https. Also, I'm executing this from eclipse.
I think my server isn't configured to launch custom profile. Please help me with this.
The start command is not really starting your selenium server per se, it's connecting your selenium object to an already running server with the browser of your choice.
To actually start the selenium [Jetty Web] server that sends / receives commands to your application under test via your specified browser, use a batch file and the switch rs79 is referring to. The contents of your batch file should include his line:
java -jar selenium-server-standalone-2.0a5.jar -firefoxProfileTemplate C:\custom-firefox-profile
Now you have a true selenium server running on your dev machine (localhost) with the default "4444" port. This will specify that any Firefox browser testing will use this profile.
Now your DefaultSelenium constructor, assignment, and other calls can look like this:
DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*firefox","http://www.server.com");
selenium.start()
selenium.open("myApp/")
Firefox will start using the custom profile specified in the batch file that starts the Selenium server, with your desired base URL, and then navigate into your desired application [URL]. If you are beginning your test from "http://www.server.com/" and not "http://www.server.com/myApp", you can omit the last open line.
When you invoke the Selenium RC server, specify the path using the additional -firefoxProfileTemplate clause.
For example -
java -jar selenium-server-standalone-2.0a5.jar -firefoxProfileTemplate C:\custom-firefox-profile
This will enable you to use all the bindings you have saved within the custom profile.
If you want to have Fifefox profile as default in your test:
a) Download latest selenium-server: http://selenium-release.storage.googleapis.com/index.html
b) Download latest Firefox
c) Create FF profile (best in your custom directory) - in my case named "atf" https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles
Default directory where profiles are saved:
C:\Users\johndoe\AppData\Roaming\Mozilla\Firefox\Profiles
d) In my case I use FF 36 and selenium-server-standalone-2.45.0.jar
Run selenium server:
java -jar C:\driver\selenium-server-standalone-2.45.0.jar -Dwebdriver.firefox.profile=atf
Then refer to it in your code:
driver = webdriver.Remote(command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.FIREFOX)
If you want to refer to particular profile in your code (here I use default generated folder for profile named "myProfile"):
profile_path = C:/Users/johndoe/AppData/Roaming/Mozilla/Firefox/Profiles/2zvl3dxx.myProfile"
fp = webdriver.FirefoxProfile(profile_path)
driver = webdriver.Remote(command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.FIREFOX,
browser_profile=myProfile)
You can add certificates to custom profile
a) Run browser with custom profile
b) Add certificate
c) Remember to tick option in Firefox Preferences/Advanced/Certificates
Select one automatically
to avoid asking for accepting certificate every time as you access tested page
d) Restart browser
e) Navigate to page what will be tested and accept User Identification Request
f) Close Firefox and enjoy custom profile with certificates available from selenium server :)
You can also start the Selenium server in java see here.

Resources