ObjectifyService.beginTransaction not available (missing) in Objectify5 as documented - objectify

According to the documentation here:
https://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Relationships
To perform transaciton, you need Objectify ofy = ObjectifyService.beginTransaction(); However, I just downloaded Objectify5 and ObjectifyService does not have beginTransaction.
Am I missing something or the documentation is out of date?

You're looking at the long-obsolete documentation for Objectify v3 (as mentioned at the top of the page).
The best place for documentation now is:
https://github.com/objectify/objectify/wiki

Related

Here API - Autosuggest requiring parameter not required (in the documentation)

I am trying to use the Autosuggest feature from Here API following this documentation: https://developer.here.com/documentation/geocoding-search-api/api-reference-swagger.html
The documentation says only the "q" parameter is required but I am doing the following query and getting the following error:
URL query: https://autosuggest.search.hereapi.com/v1/autosuggest?q=new+y&limit=5&lang=en-US&apiKey=xxx
Response:
{"status":400,"title":"Required parameter missing. One of mutual exclusive parameters 'at', 'in=circle', 'in=bbox' should be present","correlationId":"43ab125b-4f59-4255-8699-210e3acd053a","requestId":"REQ-aff498e0-ec75-45a9-998e-12b4ffa60d04"}
Am I missing something?
Thanks.
Yes, I have missed this part of the doc:
One of "at", "in=circle" or "in=bbox" is required.
I guess it is not shown explicitly as required (*) because it depends on two different fields.
In the previous API version (v6) this field is not required, I don't know why this is required now.
If someone needs a globally auto-suggesting it won't cover. Even if I can use a long radius covering the world but it looks not right as the field is required.

how to write syntax for key value fair symfony console

I want to update inventory based on sku.
For example
php magento update_inventory --sku&quantity=array(1001,10) --sku&quantity=array(1002,20) --sku&quantity=array(1003,30)
But I’m not getting how to add options/arguments ?
here user at least need to provide one pair (sku& quantity).
for this i think i have to use ArrayInput class/InputArgument/InputOption.
Can you give some solution or reference to above requirement?
Have you looked at how Magento\Setup\Console\Command\AdminUserCreateCommand uses options? Take a look at how that code uses getOptionsList in the configure method. For your use case you may want to look into using InputOption::VALUE_IS_ARRAY
A good reference will be http://symfony.com/doc/current/components/console/introduction.html#using-command-options
You may also want to consider a different input format. For example using arguments instead of options and specifying the format in documentation.
php magento update_inventory 1001:10 1002:20 1003:30

Plone Conditional - If Content Type is Versionable

Is there a simple way to check if a content-type, or a specific object, has Versioning enabled/disabled in Plone (4.3.2)?
For context, I am making some unique conditionals around portal_actions. So instead of checking path('object/##iterate_control').checkout_allowed(), I need to first see if versioning is even enabled. Otherwise, the action in question does not display for items that have versioning disabled, because obviously it isn't checkout_allowed.
I didn't have any luck with good ole Google, and couldn't find this question anywhere here, so I hope it's not a dupe. Thanks!
I was able to get this working by creating a new script, importing getToolByName, and checking current content type against portal_repository.getVersionableContentTypes(). Then just included that script in the conditional.
I was looking for something like this that already existed, so if anyone knows of one let me know. Otherwise, I've got my own now. Thanks again!
The first thing that checkout_allowed does is check if the object in question supports versioning at all:
if not interfaces.IIterateAware.providedBy(context):
return False
(the interface being plone.app.iterate.interfaces.IIterateAware:
class IIterateAware( Interface ):
"""An object that can be used for check-in/check-out operations.
"""
The semantics Interface.providedBy(instance) are a bit unfortunate for usage in conditions or TAL scripts, because you'd need to import the interface, but there's a reversal helper:
context.portal_interface.objectImplements(context,
'plone.app.iterate.interfaces.IIterateAware')

javascript google map v3 and data property missing

Trying to load a geojson result into my google map. According to the documentation ("Every Map has a Data object by default, so most of the time there is no need to construct one.") I can just do map.data.loadGeoJson. The problem is that there is no data property on map. So I tried to just create on by doing google.maps.Data(). Again Data is not a recognized type. This comes from documentation of version 3.16. Can anybody tell me what I am doing wrong? this is the url I use to reference map:
https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=false&language=en&v=3.16
It's a property of the google.maps.Map-instance:
var someMapInstance=new google.maps.Map(/*arguments*/);
//someMapInstance.data will be what you are looking for
console.log(someMapInstance.data);
Now it is showing up. I had recently changed my link from version 3.14 to 3.16 so maybe it just got stuck in cache though not sure how since the url was different but either way it is working now.

Why is there no factory for CheckBoxFieldWidget?

The common approach for assign a widget to a field in Dexterity is something like that
form.widget(hours=DataGridFieldFactory)
hours = schema.List(title=u'Hours',?
default=hoursDefault,
value_type=DictRow(title=u'Hours', schema=IHours)
The Dexterity documentation mentions CheckBoxFieldWidget here:
http://plone.org/products/dexterity/documentation/manual/developer-manual/reference/widgets-1
However there is CheckBoxFieldWidgetFactory that could be used the same way for
form.widget(forProducts=checkbox.CheckBoxFieldWidget)
forProducts = schema.List(title=u'Products',
value_type=schema.Choice(source=productsVocabulary))
What is the right way for using the CheckBoxFieldWidget here?
CheckBoxFieldWidget is the factory for CheckBoxWidget. Did you encounter a problem using the code you provided above?

Resources