Getting a full file path from Fileupload in zk - events

I want Absolute Path but it's get eclipse path.
how to get original path please help me.
<zk>
<window title="Hello World!!" border="normal">
<label value="You are using: ${desktop.webApp.version}" id="lab" />
<textbox id="tex" width="250px" />
<button label="Upload Image" upload="true,maxsize=300">
<attribute name="onUpload">
<![CDATA[
org.zkoss.util.media.Media media = event.getMedia();
java.io.File myFile = new java.io.File(media.getName());
Messagebox.show("path"+myFile.getAbsolutePath());
]]>
</attribute>
</button>
</window>
</zk>

Now browsers have a very high security so it preventing to show client local file system and for security it make sense for everyone ,no any internet user will like Server will know the our local file system if still any browser showing your file system in browser it is lake of security in the browser.

Related

Firefox could not install the search engine from…

I'm trying to make APLcart work with OpenSearch, but keep getting Firefox could not install the search engine from: https://aplcart.info/opensearch.xml with:
<link rel="search" type="application/opensearchdescription+xml" title="APLcart"
href="/opensearch.xml">
Where /opensearch.xml is:
<OpenSearchDescription>
<ShortName>APLcart</ShortName>
<Description>
Search APLcart: A novel approach to finding your way in APL
</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://aplcart.info/favicon.ico</Image>
<Url type="text/html" template="https://aplcart.info/?q={searchTerms}"/>
</OpenSearchDescription>
Note that this is not the same issue, since I do have Url type="text/html".
I've tried with method="get"
What do I need to change for my OpenSearch specification to be compliant?
You have to use the correct namespace
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
If you open the browser console (CTRL+Shift+J) you can see the error message
Invalid search plugin due to namespace not matching.

App/Widget Height is zero on SAP Hana Cloud Portal

So I am building (a) webpage(s) using the SAP Hana Cloud Portal.
I have defined a template that looks roughly like this:
<mvc:View
controllerName="cpv2.templates.custom.Template"
height="100%"
xmlns:cpControls="sap.hana.uis.flp.control"
xmlns:l="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns:u="sap.ui.unified"
xmlns="sap.m">
<Page showFooter="false" showHeader="false" enableScrolling="true">
<u:SplitContainer id="mySplitContainer" showSecondaryContent="false">
<u:secondaryContent>
<core:Fragment fragmentName="cpv2.templates.custom.SideNavigationPanel"
type="XML" id="idSideNav"/>
</u:secondaryContent>
<u:content>
<cpControls:Section alias="custom.shellHeader"></cpControls:Section>
<cpControls:Section alias="custom.header"></cpControls:Section>
<cpControls:Section alias="custom.content"></cpControls:Section>
<cpControls:Section alias="custom.footerbanner"></cpControls:Section>
<cpControls:Section alias="custom.footer"></cpControls:Section>
</u:content>
</u:SplitContainer>
</Page>
</mvc:View>
I then develop multiple SAPUI5 applications which I convert to SAP Portal Components. My app-widgets' views all have this basic format:
<mvc:View [namespaces, controller, etc.]>
<App>
<!-- most of them have VBox or HBox in their view -->
<Vbox>
<!-- some content here -->
</VBox>
</App>
</mvc:View>
I deploy these applications to the Cloud Portal.
finally I create a webpage, use the above template and fill the defined sections with these app-widgets.
Now for some reason the height of these app-widgets are all 0. Inspecting the page shows me they are there, but their height is rendered zero.
Is there a fix for this?

Cannot make Gmail contextual gadget work - 2015 API version

I am currently working on a Gmail Contextual Gadget for a non-profit organization.
We followed the official Google tutorials on https://developers.google.com/gmail/contextual_gadgets with the goal of building a Hello World app.
We did the following:
Create an app on https://console.developers.google.com/
Activate Google Marketplace SDK
Activate GMail contextual gadget with appropriate Extractor and Gadget URLs.
Deploy the app for the Non-Profit organization users.
Send us emails containing "Hello World".
However, we are not able to make it work (it should print Hello World below the emails). We checked our servers hosting the XMs, and Google definitely hits our gadget_helloworld.xml file.
Hereby are the files content. Could someone please give a hand on this subject?
It is hard to find up to date documentation on this topic, as a lot of things changed with the Google API. I think it would be helpful for the community to give an open source working sample of code updated on last-2015.
Best,
Content of the Extractor - manifest_helloworld.xml
<?xml version="1.0" encoding="UTF-8"?>
<ApplicationManifest xmlns="http://schemas.google.com/ApplicationManifest/2009">
<script id="tinyhippos-injected" />
<Extension id="HelloWorldExtractor" type="contextExtractor">
<Name>Hello World Extractor</Name>
<Url>google.com:HelloWorld</Url>
<Triggers ref="HelloWorld" />
<Scope ref="emailBody" />
<Scope ref="emailSubject" />
<Container name="mail" />
</Extension>
<Extension id="HelloWorld" type="gadget">
<Name>HelloWorld Gadget</Name>
<Url>XXXX_MY_DOMAIN/gadget_files/gadget_helloworld.xml</Url>
<Container name="mail" />
<!-- Uncomment this to enable Caja. -->
<!-- Param name="caja" value="enabled"/> -->
</Extension>
<Scope id="emailBody">
<Url>tag:google.com,2010:auth/contextual/extractor/BODY</Url>
<Reason>Necessary for reason 1</Reason>
</Scope>
<Scope id="emailSubject">
<Url>tag:google.com,2010:auth/contextual/extractor/SUBJECT</Url>
<Reason>Necessary for reason 2</Reason>
</Scope>
</ApplicationManifest>
Content of the Gadget - gadget_helloworld.xml
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<script id="tinyhippos-injected" />
<ModulePrefs title="Hello World" description="Matches and echoes 'Hello World' string in emails" height="20" author="ACME" author_email="test#example.com" author_location="Bermuda">
<!-- Declare feature dependencies. -->
<!--
This one is not specific to Gmail contextual gadgets.
-->
<Require feature="dynamic-height" />
<!--
The next feature, Caja, is optional, and is supported for
use only within test domains. Uncomment the tag only for
non-production gadgets.
-->
<!-- <Require feature="caja"/> -->
<!--
The next feature, google.contentmatch, is required for all
Gmail contextual gadgets.
<Param> - specify one or more comma-separated extractor IDs in
a param named "extractors". This line is overridden by the extractor ID
in the manifest, but is still expected to be present.
-->
<Require feature="google.contentmatch">
<Param name="extractors">google.com:HelloWorld</Param>
</Require>
</ModulePrefs>
<!--
Define the content type and display location. The settings
"html" and "card" are required for all Gmail contextual gadgets.
-->
<Content type="html" view="card"><![CDATA[<p>Hello World</p>
<script type="text/javascript">
<!-- Fetch the array of content matches. -->
matches = google.contentmatch.getContentMatches();
var matchList = document.createElement('UL');
var listItem;
var extractedText;
<!-- Iterate through the array and display output for each match. -->
for (var match in matches) {
for (var key in matches[match]) {
listItem = document.createElement('LI');
extractedText = document.createTextNode(key + ": " + matches[match][key]);
listItem.appendChild(extractedText);
matchList.appendChild(listItem);
}
}
document.body.appendChild(matchList);
gadgets.window.adjustHeight(100);
</script>]]></Content>
</Module>
I had a similar issue of it not activating and the solution for me was to make the "Extractor param name" set to "hello" and and the "Extractor param value" set to ".*" -- According to the docs the important part is the value field:
If you really do want your gadget to be triggered by all possible
values in the extractor's default output, explicitly set the regular
expression as value=".*". This makes it clear that you have cast a
wide net by design.

Start workflow popup menu is empty in OpenKM web interface

I've created a simple workflow in jBoss studio and deployed it on OpenKM, every things is OK and my workflow will be shown in administration panel but in desktop panel there is no files in /okm:root/ and when I want to start my workflow the workflow lists in 'workflow start' dialog is empty, Did not have any entry.
Can any one please help me with how can I start my workflow?
As a note, I uses Firefox 30 and Java plug-in is disable on it
You must enable available workflow list from profiles ( administration -> profiles -> first tab). Also to start any workflow you need to doing it selecting a document.
In addition if your problem is that you're not showing th form just when you start workflow then take in consideration, there's an special task name in forms.xml if you want to be shown the form at the moment you're registering. You can see example in this form with task called task="run_config":
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.1//EN"
"http://www.openkm.com/dtd/workflow-forms-2.1.dtd">
<workflow-forms>
<workflow-form task="run_config">
<input label="number" name="number" />
<button name="submit" label="Submit" />
</workflow-form>
<workflow-form task="task">
<input label="number" name="number" data="modified" />
<button name="submit" label="Submit" />
</workflow-form>
</workflow-forms>
Here you can find some examples http://wiki.openkm.com/index.php/File:Course_workflows.zip, also I suggest take a look on it. Hope this could be useful for you

Data binding the Image control in Windows 8 to a URL?

In Windows 8/Store programming, how would you go about databinding an image to a URL. In other platforms I've worked with, I would set the source property (or equivalent) to the URL and the platform would handle it for me, but that doesn't seem to be the case here.
I'm currently binding it to a property for my business object that is of type "string", and returns the URL of the image that I want populated in the image control. How would I go about doing this?
Turns out this is really easy.
Code:
<Image Stretch="UniformToFill">
<Image.Source>
<BitmapImage UriSource="{Binding Path=ImageUrl}" />
</Image.Source>
</Image>
ImageUrl is a Uri containing the path to the remote image.

Resources