Trying to initialise multiple components of type event-set fails, following Building with Components Tutorial - aframe

I'm following the A-Frame Building with Components tutorial.
First, there is a typo around the Layout Component part:
layout="layout: line;
should be:
layout="type: line;
Secondly, I've got to the Event-Set Component part. Unfortunately, I'm getting the following errors:
core:schema:warn Unknown property `src` for component/system `undefined`
and
Error: Trying to initialize multiple components of type `event-set`. There can only be one component of this type per entity.
The first seems to link to an innocous part of my Browserified code and second is particularly ironic as the tutorial itself states:
Notice that the event-set component can have multiple instances
The code itself is on my GitHub for the project, and can be seen running via GitHub pages here. I would have linked to more pages and my GitHub, but I can only place two links in this post with my newbie status.

You need a more current version of the component. You can grab it from https://github.com/ngokevin/kframe/tree/master/components/event-set/dist

Related

Is there a fix for InheritanceManager breaking static type checking?

I have added django-model-utils to an existing (large) project, and the build is now failing, as part of the build includes static type checking with mypy.
It complains that models that I have added objects = InheritanceManager() to, don't have attributes for reverse ForeignKeys, if the reverse FK is accessed in a method on that model. For example, take the following:
class Student(Model):
school = ForeignKey(School, related_name='students')
class School(Model):
objects = InheritanceManager() # IRL School is a subclass of some other model
def something(self):
return self.students.filter(...)
Then running mypy on it, will return:
error: "School" has no attribute "students"
And even if I remove the related_name, and use self.student_set (i.e. the default django relation), it will still produce the same type of error. Only removing the InheritanceManager fixes the static type checking. Of course, I'm using it for a reason as I need to select_subclasses elsewhere in the code.
Has anyone come across this, or have a fix?
django-stubs uses plugin to add all managers. This plugin is triggered only if added manager is a "subclass" (not just real subclass, but also recognizable by mypy as such) of models.Manager.
django-model-utils is untyped, so InheritanceManager is in fact Any for mypy, and plugin does not see it. To solve exactly this issue I was adding py.typed marker to django-model-utils as a CI stage after package installation. You can also use a fork with py.typed or create a stub package for django-model-utils. This can result in other issues and doesn't give good type checking (all unannotated methods have Any as implicit arguments and return type), but is better than nothing. For my needs the marker was sufficient.
py.typed marker is an empty file located in package root (venv/lib/.../django_model_utils/py.typed) - it tells mypy that package does not need separate stubs and contains all necessary types.

Spring project package problem that needs to be addressed

I have tried my every possible ways of adding class in different packages such as application class in package com.packagename and my controller in different package named model and when i try to execute the program it returns the default white label error and when i put the classes in the same package it runs successfully.
So i wanted to ask if there is any problem with the project or i need to give any path.
Before I have also tried notations that says component scan and all but that to did not came handy
Let's say your main class(which is annotated with #SpringBootApplication) is in the package "com.somepackage", then try putting your controller in "com.somepackage.controller"(It is recommended that other classes are placed in the subpackage of your main class). with this change it should work.
You put your classes in wrong places and your package are very messy. You should have a structure like this
--src
main
java
com.boltforever.moviecatalog
model
service
MyService.java
controller
MyController.java
MovieCatalogServiceApplication.java
And this should work

Generating switch-case function out of State chart

Although my question is very simple I can't find an answer for it.
I created a class in Rhapsody and associated a statechart to this class but when I generate the code I can't find and code in the class related to the state chart.
Is there any function that needs to be created as a trigger or am I missing something?
my example state chart:
After searching for a long while I could find the option that was preventing the generation.
First of all, you need to define a reactive class to be able to generate a code for a state machine. This point was OK for me and I thought this was only what matters until I found this property here:
The _CG::Statechart::StatechartStateOperations property
determines whether the code is generated for this feature. The
possible values for this property are:
None (default value) where code is not generated for the feature.
WithoutReactive where the product does not generate calls to OMReactive
WithReactive where the product generates calls to OMReactive

Dealing with view implicit acquisition problems in Plone

In Plone adding a member variable in a view class instance automatically makes it a part of view acquisition chain. The problem is described in detail here:
http://collective-docs.readthedocs.org/en/latest/views/browserviews.html#views-and-automatic-member-variable-acquisition-wrapping
What is the suggested approach for dealing with this problem
Can we have Plone main template based views without implicit acquisition
How about viewlets and portlet renderers then?
If not... how one should deal with the problem so that self.xxx variables do not get extra acquisition wrapping?
Use Acquisition.aq_inner() to strip away the extra wrapping and restore the object to it's original path. Please, do not use the single-item list approach as described in the document you link to.
To show one example from the linked document, but corrected with aq_inner():
from Acquisition import aq_inner
self.obj = self.context.reference_catalog.lookupObject(value)
return aq_inner(self.obj).absolute_url() # Acquistion chain corrected
Alternatively, you can use the aq_inner attribute:
self.obj = self.context.reference_catalog.lookupObject(value)
return self.obj.aq_inner.absolute_url() # Acquistion chain corrected
but that only works on objects that inherit from Acquisition.Explicit or Acquisition.Implicit; the aq_inner() function returns the passed argument verbatim if it is not a Acquisition-wrapped object.

Executing an item in the package as a Dreamweaver Template

Does anybody know if it is possible in a compound template to use a string item in the package and execute it as if were a dreamweaver template? And whether you apply the same method to other mediators (like razor)?
Thanks
Mark
I suspect this is not possible.
Package.EvaluateExpression may be useful, but as the name suggests it'll only work on expressions, not large snippets of code with embedded expressions (i.e. TEL)
Engine.GetMediator expects a Template and returns the appropriate Mediator for it. Your problem then is that the IMediator interface only defines the Transform method, which requires an Engine, a Template and a Package.
I can't think of any elegant ways around these. Maybe write your own Mediator, but that would still expect a Package, not a string, so you'd have to first store the string based Item from another TBB.
My advice: Sounds like you need to go back to the drawing board and find an alternative solution to your problem.
I'm afraid that won't be possible on just any item in the Package, since the Engine expects Templates to be based on Tridion items.
If your Template Item is based on a Tridion Item you can probably get pretty far by starting at the Engine.GetMediator method. If it isn't, you'll have to find some way to turn it into a valid Template object.
Template template = ...
IMediator mediator = engine.GetMediator(template);
mediator.Transform(engine, template, package);
When I have to create a Component object from a Tridion-based Item in the Package, I normally do something like this:
Component component = new Component(item.GetAsXmlDocument().DocumentElement,
engine.GetSession);
I haven't tried, but expect that you can do the same for a Template - given that you start with a valid Item from the Package representing a Template to begin with. You can probably clone the XML from an existing Item or find some other way to fake it.
If you get this to work, it will work across all registered template types. The Engine provides no special treatment for the types that come with Tridion.

Resources