Error passing uiautomator dump in viewclient.py - monkeyrunner

I am getting below exection when running viewclient. I am running this on Emulator using android-17 api.
viewclient = ViewClient(device, serialno)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 948, in __init__
self.dump()
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1478, in dump
self.setViewsFromUiAutomatorDump(received)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1251, in setViewsFromUiAutomatorDump
self.__parseTreeFromUiAutomatorDump(received)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1405, in _ViewClient__parseTreeFromUiAutomatorDump
self.root = parser.Parse(receivedXml)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 832, in Parse
parserStatus = parser.Parse(uiautomatorxml, 1) ##UnusedVariable
File "/Tools/android-sdk-macosx/tools/lib/jython.jar/Lib/xml/parsers/expat.py", line 212, in Parse
xml.parsers.expat.ExpatError: XML document structures must start and end within the same entity.
Looking at the uiautomatorxml, by adding a print statement as below:
def Parse(self, uiautomatorxml):
# Create an Expat parser
parser = xml.parsers.expat.ParserCreate()
# Set the Expat event handlers to our methods
parser.StartElementHandler = self.StartElement
parser.EndElementHandler = self.EndElement
parser.CharacterDataHandler = self.CharacterData
# Parse the XML File
**print "DEBUG: " + uiautomatorxml**
parserStatus = parser.Parse(uiautomatorxml, 1) ##UnusedVariable
return self.root
I got,
DEBUG: (XML file starts in a normal fashion, below is tail end of the log that was printed)
<node index="1" text="" class="android.view.View" package="com.android.launcher" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="true" long-clickable="false" password="false" selected="false" bounds="[0,25][800,1232]"><node index="2" text="" class="android.view.View" package="com.android.launcher" content-desc="Home screen 3" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focus
130515 19:41:07.014:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
Clearly, XML is not fully formed. I was wondering if you had any ideas on why this could be happening and how to resolve this.

I guess its because UIAutomation return contents is too long.Because I got the same message with you,but when I tern to one little view page and run and I fount that ViewClient is work well .. so I guess is something wrong with the sockets message didn't end with the complete oparate...

For me this was linked to performance of the machine where I was running emulator. I was able to resolve this issue by enabling hardware acceleration and having a machine with 1GB graphics card.
Steps for enabling hardware acceleration:
Check "use host gpu" in simulator.
Download and install Intel
HAXM.

Related

Web-scraping the audio and related text form ganjoor site by colab as Persian Speech to text database

I have tried to gather some audio form ganjoor site to gather Audio files with its texts like those contents that is reading by ... shown below:
By using the google colab, so i have tried different method via this coalb :
https://colab.research.google.com/drive/1ntSbqv6iSrNt2F8eyWTvao5ED9Ot0szi?usp=sharing
And I get this kind of errors that you can see at above colab page:
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:29: DeprecationWarning: use options instead of chrome_options
---------------------------------------------------------------------------
WebDriverException Traceback (most recent call last)
<ipython-input-27-c4b1e303b5e7> in <module>()
28
29 wd = webdriver.Chrome('chromedriver', chrome_options=options)
---> 30 wd.get(url)
31 print(wd.page_source) # re
2 frames
/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
240 alert_text = value['alert'].get('text')
241 raise exception_class(message, screen, stacktrace, alert_text)
--> 242 raise exception_class(message, screen, stacktrace)
243
244 def _value_or_default(self, obj, key, default):
WebDriverException: Message: unknown error: net::ERR_CONNECTION_TIMED_OUT
(Session info: headless chrome=85.0.4183.83)
or
onnectionError: HTTPSConnectionPool(host='ganjoor.net', port=443): Max retries exceeded with url: /hafez/ghazal/sh1/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f6e23c5c8d0>: Failed to establish a new connection: [Errno 110] Connection timed out',))
So my guess is that this kind of web-scraping needs some proper agent header setting or using some proxy in the setting, and I don't know which header is proper and or what proxy sites or free vpn provider is exist and ...
Update:
According to answer of #baduker, it seams that there is some problem with colab to connect the https://ganjoor.net site and its showing that error again (the #baduker codes added to the related GitHub colab notebooks page:
I would be very grateful if you could scrape one audio with its related texts from the ganjoor site, as one example.
Thanks.
You don't really need the raw power of Selenium to get what you're after.
It can be done with requests, BeautifulSoup, and some re.
The regex module is useful for fetching all the .mp3 source urls from the page source. If you look at it you'll see a <script> tag with some JavaScript and all the urls you need.
Parse it and download the .mp3.
Here's how to do it:
import re
import requests
from bs4 import BeautifulSoup
from shutil import copyfileobj
url = "https://ganjoor.net/hafez/ghazal/sh1/"
page = requests.get(url).text
text = BeautifulSoup(page, "html.parser").find_all("div", {"class": "m2"})
print([t.text.replace("\u200c", "") for t in text])
pattern = re.compile(r"https://i\.ganjoor\.net/a2?/\d+[-a-z]+?\.mp3")
audio_tracks = re.findall(pattern, page)
print(audio_tracks)
for track in audio_tracks:
print(f"Fetching track: {track}...")
with requests.get(track, stream=True) as t, \
open(track.split("/")[-1], "wb") as a:
copyfileobj(t.raw, a)
Output for audio:
2130-ak.mp3
2130-az.mp3
2130-ff.mp3
2130-hr.mp3
2130-mfk.mp3
2130-ml.mp3
2130-ng.mp3
2130-zsh.mp3
And the text:
['که عشق آسان نمود اول ولی افتاد مشکلها', 'ز تاب جعد مشکینش چه خون افتاد در دلها', 'جرس فریاد میدارد که بربندید محملها', 'که سالک بیخبر نبود ز راه و رسم منزلها', 'کجا دانند حال ما سبکباران ساحلها', 'نهان کی ماند آن رازی کز او سازند محفلها', 'متی ما تلق من تهوی دع الدنیا و اهملها']

GCP Composer/Airflow calling Dataflow/beam throwing error

I have a GCP Cloud Composer environment with airflow version composer-1.10.0-airflow-1.10.6 and python 3, 3.6 to be precise. I am calling an apache-beam pipeline on Dataflow using a python_operator.PythonOperator, operator. Here is the code snippet
Calling the pipeline function
test_greeting = python_operator.PythonOperator(
task_id='python_pipeline',
python_callable=run_pipeline
)
The pipeline function is as follows
def run_pipeline():
print("Test Pipeline")
pipeline_args=[
"--runner","DataflowRunner",
"--project","*****",
"--temp_location","gs://******/temp",
"--region","us-east1",
"--job_name","job1199",
"--zone","us-east1-b"
]
pipeline_options=PipelineOptions(pipeline_args)
pipe=beam.Pipeline(options=pipeline_options)
small_sum = (
pipe
| beam.Create([18,5,7,7,9,23,13,5])
| "Combine Globally" >> beam.CombineGlobally(AverageFn())
| 'Write results' >> beam.io.WriteToText('gs://******/ouptut_from_pipline/combine')
)
run_result=pipe.run()
run_result.wait_until_finish()
return "True"
When I run this the pipeline execution runs in dataflow but fails with the following error
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/dataflow_worker/batchworker.py", line 648, in do_work
work_executor.execute()
File "/usr/local/lib/python3.6/site-packages/dataflow_worker/executor.py", line 150, in execute
test_shuffle_sink=self._test_shuffle_sink)
File "/usr/local/lib/python3.6/site-packages/dataflow_worker/executor.py", line 116, in create_operation
is_streaming=False)
File "apache_beam/runners/worker/operations.py", line 1032, in apache_beam.runners.worker.operations.create_operation
File "apache_beam/runners/worker/operations.py", line 845, in apache_beam.runners.worker.operations.create_pgbk_op
File "apache_beam/runners/worker/operations.py", line 903, in apache_beam.runners.worker.operations.PGBKCVOperation.__init__
File "/usr/local/lib/python3.6/site-packages/apache_beam/internal/pickler.py", line 290, in loads
return dill.loads(s)
File "/usr/local/lib/python3.6/site-packages/dill/_dill.py", line 275, in loads
return load(file, ignore, **kwds)
File "/usr/local/lib/python3.6/site-packages/dill/_dill.py", line 270, in load
return Unpickler(file, ignore=ignore, **kwds).load()
File "/usr/local/lib/python3.6/site-packages/dill/_dill.py", line 472, in load
obj = StockUnpickler.load(self)
File "/usr/local/lib/python3.6/site-packages/dill/_dill.py", line 462, in find_class
return StockUnpickler.find_class(self, module, name)
ModuleNotFoundError: No module named 'unusual_prefix_162ac8b7030d5bd1ff5f128a26483932d3968a4d_python_bash'
The beam version is Apache Beam Python 3.6 SDK 2.19.0.
I suspect the version of Python 3.6 may be the issue as calling the pipeline directly (as a runner) from my local system works fine and my local system is running python 3.7.
I cant find a way to test this theory though.
It would be helpful to get tips of how to resolve this issue.

Alfresco document-derived content is missing <content>

I've created a custom content type derived from document. I am trying to use CMIS to query my Alfresco server (tried with 4.2.b and 4.2.c) programmatically for my documents using python cmislib. I have a pyramid server that takes REST calls and sends them to my Alfresco server using CMIS.
I get this error:
2013-04-11 11:19:25,526 | ERROR | Exception when serving /access_manager/search_noauth
Traceback (most recent call last):
File "/home/hbrown/.virtualenvs/access_manager_master/local/lib/python2.7/site-packages/waitress-0.8.1-py2.7.egg/waitress/channel.py", line 329, in service
task.service()
[...]
File "/home/hbrown/workspace/spt/access_manager/access_manager/views/search.py", line 223, in cmis_main
for result in repo.query(whole_query)
File "/home/hbrown/.virtualenvs/access_manager_master/local/lib/python2.7/site-packages/cmislib/model.py", line 2467, in getContentStream
assert(len(contentElements) == 1), 'Expected to find exactly one atom:content element.'
AssertionError: Expected to find exactly one atom:content element.
I am using getContentStream() to retrieve content. Based on the code comment, I'd say it is the correct API call:
>>> doc.getName()
u'sample-b.pdf'
>>> o = open('tmp.pdf', 'wb')
>>> result = doc.getContentStream()
>>> o.write(result.read())
>>> result.close()
>>> o.close()
>>> import os.path
>>> os.path.getsize('tmp.pdf')
117248
The python code in cmislib clearly expects the document to have XML that includes an element named content, and mine does not.
The calling code looks like this:
from cmislib import CmisClient
SERVER = "localhost"
url = "http://{0}:8080/alfresco/cmisatom".format(SERVER)
client = CmisClient(url, 'admin', 'alfresco')
repo = client.defaultRepository
results = repo.query("select * from wg:bulletin")
print results[0].getContentStream().read()
The XML being operated on in getContentStream looks like this:
<atom:entry>
<atom:author>
<atom:name/>
</atom:author>
<atom:id>http://chemistry.apache.org/aWQtMQ==</atom:id>
<atom:published>2013-04-12T03:22:38Z</atom:published>
<atom:title>Query Result id-1</atom:title>
<app:edited>2013-04-12T03:22:38Z</app:edited>
<atom:updated>2013-04-12T03:22:38Z</atom:updated>
<cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
<cmis:properties>
<cmis:propertyInteger displayName="Content Stream Length" localName="contentStreamLength" propertyDefinitionId="cmis:contentStreamLength" queryName="b.cmis:contentStreamLength">
<cmis:value>249</cmis:value>
</cmis:propertyInteger>
<cmis:propertyId displayName="Object Type Id" localName="objectTypeId" propertyDefinitionId="cmis:objectTypeId" queryName="b.cmis:objectTypeId">
<cmis:value>D:wg:bulletin</cmis:value>
</cmis:propertyId>
<cmis:propertyString displayName="Version Series Checked Out By" localName="versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy" queryName="b.cmis:versionSeriesCheckedOutBy"/>
<cmis:propertyId displayName="Version Series Checked Out Id" localName="versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId" queryName="b.cmis:versionSeriesCheckedOutId"/>
<cmis:propertyId displayName="Version series id" localName="versionSeriesId" propertyDefinitionId="cmis:versionSeriesId" queryName="b.cmis:versionSeriesId">
<cmis:value>workspace://SpacesStore/1cd2053d-1fc4-4e85-b780-ba80284f0841</cmis:value>
</cmis:propertyId>
<cmis:propertyString displayName="wg:account" localName="account" propertyDefinitionId="wg:account" queryName="b.wg:account"/>
<cmis:propertyString displayName="Version Label" localName="versionLabel" propertyDefinitionId="cmis:versionLabel" queryName="b.cmis:versionLabel">
<cmis:value>1.0</cmis:value>
</cmis:propertyString>
<cmis:propertyBoolean displayName="Is Latest Version" localName="isLatestVersion" propertyDefinitionId="cmis:isLatestVersion" queryName="b.cmis:isLatestVersion">
<cmis:value>true</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyBoolean displayName="Is Version Series Checked Out" localName="isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut" queryName="b.cmis:isVersionSeriesCheckedOut">
<cmis:value>false</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyString displayName="Last Modified By" localName="lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy" queryName="b.cmis:lastModifiedBy">
<cmis:value>admin</cmis:value>
</cmis:propertyString>
<cmis:propertyString displayName="Created by" localName="createdBy" propertyDefinitionId="cmis:createdBy" queryName="b.cmis:createdBy">
<cmis:value>admin</cmis:value>
</cmis:propertyString>
<cmis:propertyDateTime displayName="wg:displayUntil" localName="displayUntil" propertyDefinitionId="wg:displayUntil" queryName="b.wg:displayUntil"/>
<cmis:propertyId displayName="Alfresco Node Ref" localName="nodeRef" propertyDefinitionId="alfcmis:nodeRef" queryName="b.alfcmis:nodeRef">
<cmis:value>workspace://SpacesStore/1cd2053d-1fc4-4e85-b780-ba80284f0841</cmis:value>
</cmis:propertyId>
<cmis:propertyString displayName="wg:email" localName="email" propertyDefinitionId="wg:email" queryName="b.wg:email"/>
<cmis:propertyBoolean displayName="wg:isActive" localName="isActive" propertyDefinitionId="wg:isActive" queryName="b.wg:isActive">
<cmis:value>false</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyString displayName="wg:username" localName="username" propertyDefinitionId="wg:username" queryName="b.wg:username"/>
<cmis:propertyBoolean displayName="Is Latest Major Version" localName="isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion" queryName="b.cmis:isLatestMajorVersion">
<cmis:value>true</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyId displayName="Content Stream Id" localName="contentStreamId" propertyDefinitionId="cmis:contentStreamId" queryName="b.cmis:contentStreamId">
<cmis:value>store://2013/4/10/15/29/20b185d0-afae-4a7f-a06e-58eab399bdc9.bin</cmis:value>
</cmis:propertyId>
<cmis:propertyString displayName="Name" localName="name" propertyDefinitionId="cmis:name" queryName="b.cmis:name">
<cmis:value>.pythonrc</cmis:value>
</cmis:propertyString>
<cmis:propertyString displayName="Content Stream MIME Type" localName="contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType" queryName="b.cmis:contentStreamMimeType">
<cmis:value>text/plain</cmis:value>
</cmis:propertyString>
<cmis:propertyDateTime displayName="Creation Date" localName="creationDate" propertyDefinitionId="cmis:creationDate" queryName="b.cmis:creationDate">
<cmis:value>2013-04-10T15:29:18.146-04:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyString displayName="Change token" localName="changeToken" propertyDefinitionId="cmis:changeToken" queryName="b.cmis:changeToken"/>
<cmis:propertyString displayName="wg:state" localName="state" propertyDefinitionId="wg:state" queryName="b.wg:state"/>
<cmis:propertyDateTime displayName="wg:displayFrom" localName="displayFrom" propertyDefinitionId="wg:displayFrom" queryName="b.wg:displayFrom"/>
<cmis:propertyString displayName="Checkin Comment" localName="checkinComment" propertyDefinitionId="cmis:checkinComment" queryName="b.cmis:checkinComment"/>
<cmis:propertyString displayName="wg:application" localName="application" propertyDefinitionId="wg:application" queryName="b.wg:application"/>
<cmis:propertyId displayName="Object Id" localName="objectId" propertyDefinitionId="cmis:objectId" queryName="b.cmis:objectId">
<cmis:value>workspace://SpacesStore/1cd2053d-1fc4-4e85-b780-ba80284f0841;1.0</cmis:value>
</cmis:propertyId>
<cmis:propertyBoolean displayName="Is Immutable" localName="isImmutable" propertyDefinitionId="cmis:isImmutable" queryName="b.cmis:isImmutable">
<cmis:value>false</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyBoolean displayName="Is Major Version" localName="isMajorVersion" propertyDefinitionId="cmis:isMajorVersion" queryName="b.cmis:isMajorVersion">
<cmis:value>true</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyString displayName="wg:institution" localName="institution" propertyDefinitionId="wg:institution" queryName="b.wg:institution"/>
<cmis:propertyId displayName="Base Type Id" localName="baseTypeId" propertyDefinitionId="cmis:baseTypeId" queryName="b.cmis:baseTypeId">
<cmis:value>cmis:document</cmis:value>
</cmis:propertyId>
<cmis:propertyString displayName="Content Stream Filename" localName="contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName" queryName="b.cmis:contentStreamFileName">
<cmis:value>.pythonrc</cmis:value>
</cmis:propertyString>
<cmis:propertyDateTime displayName="Last Modified Date" localName="lastModificationDate" propertyDefinitionId="cmis:lastModificationDate" queryName="b.cmis:lastModificationDate">
<cmis:value>2013-04-10T15:29:23.384-04:00</cmis:value>
</cmis:propertyDateTime>
</cmis:properties>
</cmisra:object>
</atom:entry>
There is clearly no XML element named content here for the python code to extract.
Is this a misconfiguration of my custom content document or is it a change in CMIS that cmislib does not track or am I calling the wrong API function to get the content or something else?
Later: the minimum change to fix this is to make calls to either reload or getAllowableActions.
This was the original code:
def cmis_main(props, settings):
"""
Create a CMIS query based on props and execute against Alfresco
"""
def cmis_query(props, mapping):
"""
Create CMIS query of AND-separated OR-clauses
"""
# Code that formats a query string from dictionaries...
cmis_mapping = {
# Dictionary config for call to cmis_query
# Nothing to see here. Move on.
"app_sids": {
"where_fmt": IN_WHERE_FMT,
"key": "{0}:application".format(CMIS_NAMESPACE),
"fn": set_format,
},
}
cmis_url, cmis_user, cmis_password = cmis_args(settings)
cmisclient = CmisClient(cmis_url, cmis_user, cmis_password)
repo = cmisclient.getDefaultRepository()
whole_query = cmis_query(props, cmis_mapping)
logger.debug(whole_query)
return [
{
'name': result.name,
'content': result.getContentStream().read(),
'content_mime_type': result.properties["cmis:contentStreamMimeType"],
}
for result in repo.query(whole_query)
]
And it was broken. So I changed the code to this:
results = list(repo.query(whole_query))
for result in results:
print(result.getAllowableActions())
# or: result.reload()
return [
{
'name': result.name,
'content': result.getContentStream().read(),
'content_mime_type': result.properties["cmis:contentStreamMimeType"],
}
for result in results
]
And it worked. I changed it to this:
results = list(repo.query(whole_query))
for result in results:
pass
return [
{
'name': result.name,
'content': result.getContentStream().read(),
'content_mime_type': result.properties["cmis:contentStreamMimeType"],
}
for result in results
]
And it broke. So the XML does not appear to be fully loaded in the CMISLIB object.
Try doing results[0].reload() before calling getContentStream(). That shouldn't be required but it may force the object to reload with the content element.

"XMLCommand.initialize failed: java.lang.NullPointerException" when using dataset-proxy in a workflow databroker

I'm creating a workflow databroker, and in the pre-workflow I am using a dataset-proxy to iterate over the populate-dataset. However I get the following error when I compile:
XMLCommand.initialize failed: java.lang.NullPointerException
at nz.co.aviarc.xml.command.dataset.DatasetProxy.initialize(DatasetProxy.java:35)
at com.aviarc.framework.xml.command.XMLCommandElementImpl.finalize(XMLCommandElementImpl.java:90)
at com.aviarc.framework.xml.compilation.XMLSAXHandler.endElement(XMLSAXHandler.java:336)
at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:443)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:598)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:673)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1645)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:875)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1198)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:564)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:404)
at net.sf.saxon.event.Sender.send(Sender.java:193)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:30)
at com.aviarc.framework.xml.compilation.AviarcXMLResourceCompiler.compile(AviarcXMLResourceCompiler.java:137)
...
I get exactly the same error even when I use the code example straight out of the documentation (com.aviarc.dataset:1.1.0):
<workflow xmlns:ds="urn:aviarc:xmlcommand:com.aviarc.dataset">
<ds:dataset-proxy dataset="ds" proxyname="dsproxy">
<set-current-row dataset="dsproxy" position="2" />
<set-field field="dsproxy.email" value="test#test.com" />
</ds:dataset-proxy>
</workflow>
Turns out that the documentation is wrong, as proxyname is not a valid attribute on dataset-proxy. I didn't see it at first (because of the huge stack trace) but I was also getting this warning:
Unknown attribute 'proxyname'
The correct attribute is name, not proxyname. Changing this resolved the error.

How do i use the closurebuilder for compiling and minifying scripts

I am totally new to closure-library and am getting started. I just installed Python on my windows7 machine want to concatenate and minify the scripts. I ran through some commands as documented here but no gain. here are some parameters
Python installed in c:\python27\python.exe
Closure library in c:\closure\
Closure compiler in c:\closure\bin\build\compiler.jar
My Javascript file in D:\projects\closureapp\js\index.js
contents of the index.js is as below
/// <reference path="../closure/base.js" />
/// <reference path="../closure/dom/dom.js" />
/*Hello world into Closure Library Example*/
//Load the dom module
goog.require("goog.dom");
//refer the document body
var pageBody = document.body;
//after the body is loaded execute and add a header
pageBody.onload = function () {
//create a header for the page
var pageHeader = goog.dom.createDom('h1', { 'style': 'background-color:#EEE' }, 'Hello world!');
//append the header to the document body
goog.dom.appendChild(pageBody, pageHeader);
};
I executed the command below to produce compiled javascript but no gains
c:\python27\python.exe c:\closure\bin\build\c
losurebuilder.py --root=closure/ --root=d:\Projects\closureapp\js\ --
output_mode=compiled --compiler_jar=compiler.jar > d:\Projects\closureapp\js\output.js
i get some weird messages like below
c:\closure\bin\build\closurebuilder.py: Building dependency tree..
Traceback (most recent call last):
File "c:\closure\bin\build\closurebuilder.py", line 257, in <module> main()
File "c:\closure\bin\build\closurebuilder.py", line 204, in main tree = depstree.DepsTree(sources)
File "c:\closure\bin\build\depstree.py", line 56, in __init__ raise NamespaceNotFoundError(require, source)
depstree.NamespaceNotFoundError: Namespace "goog.async.Deferred" never provided.
Required in Source closure\messaging\portchannel.js
This looks like the same issue as http://code.google.com/p/closure-library/issues/detail?id=316

Resources