VMware {code} Community
SravanKumar1234
Contributor
Contributor

How to get rid of flex .swf generation in case of pure HTML plugin implementation?

Hi,

We are planning to migrate/implement our plugin from flex to pure HTML plugin (i.e; vSphere-Client only, no need to support vSphere Web Client).

Even Plugin-Seed-0.9.8 will use swf (as the seed supposed to work in both clients)

plugin.xml:

....

<resources>

      <resource locale="{locale}">

         <module uri="locales/some-ui-{locale}.swf"/>

      </resource>

   </resources>

......

My question is "Is it possible to get rid of swf for pure HTML plugin without losing the ability of localization? Because given custom-object-ui sample is not using localization"

It will be helpful if we can get working sample plugin.xml snippet?

Thanks,

Kumar T.

0 Kudos
7 Replies
laurentsd
VMware Employee
VMware Employee

With SDK 6.5 and 6.5u1 the solution is to just leave the <resources> tag as is in your plugin.xml, even if you don't generate the .swf files in your build.

The next SDK release will provide a cleaner way to reference multiple bundles and not mention any .swf resource.

0 Kudos
SravanKumar1234
Contributor
Contributor

Thanks, Laurent.

However, In custom-object-ui sample we can declare resource without .swf syntax but this sample is not showing how to achieve localization for various locales(ja_JP etc).

Snippet from html-client-sdk\samples\custom-object-ui\src\main\webapp\plugin.xml:

<!--

   custom-object plugin metadata.

   The <plugin> tag doesn't contain any moduleUri property because it is an HTML plugin.

-->

<plugin id="com.vmware.samples.customobject"

        defaultBundle="com_vmware_samples_customobject">

   <resources  baseUrl="locales/">

      <resource>com_vmware_samples_customobject</resource>

   </resources>

How does localization will be implemented in this sample?

Thanks & Regards,

Sravan

0 Kudos
laurentsd
VMware Employee
VMware Employee

What SDK version are you using?

For now it's better to follow the existing 6.5 samples and just not generate the .swf files.

0 Kudos
SravanKumar1234
Contributor
Contributor

I'm using latest fling sdk build 6311399.

Even custom-object-ui sample in vsphere-client-sdk-6.5.0-5973321 follows the same resource declaration syntax.

0 Kudos
wodge
Enthusiast
Enthusiast

We're experiencing an issue that looks to be strongly related to this with our hybrid plugin, generated from 0.9.8 seed.

We get an error reported (screenshot below) when using the Japanese language. This is only when Flex is used. Screen Shot 2017-11-17 at 9.52.06 am.png

Could you please advise how we support Internationalization in hybrid mode from the plugin-seed - so that this Flex error doesn't occur?

Many thanks,

Warren

0 Kudos
laurentsd
VMware Employee
VMware Employee

Warren,

In your case the missing .swf file error is because you need properties compiled as .swf for each locale in order to run in the Flex client, which is not the case of the original message here.

The plugin-seed build script (build-war.xml) only includes the English and French locales by default, you need to add ja_JP and other locales you want to support.

0 Kudos
wodge
Enthusiast
Enthusiast

Many thanks Laurentsd - much appreciated it looks like this is the cause of the issue 🙂

I think it would be best to change the default plugin-seed project so that the section:

      <!-- Generate resource bundles for the other required locales

           with a copy of the US version -->

 

is uncommented and the .swf files are generated for the locales supported from vCenter. As this is a best practice, this would prevent this issue occurring from the default?

0 Kudos