Where is the definition of Global_NS in a BizTalk schema? - xsd

I'm trying to use a distinguished property but I get an error "Cannot implicitly convert type ... to Global_NS ... "
I've googled/bing'ed but I've found only 4 references, none of which help
I can't see anywhere that this is set :-(
I've been trying to remove the tempuri namespaces from a WCF service and all seemed OK, until I tried to access a distinguished property

It sounds like you are having a namespace prefix conflict between your imported types and the property schema.
If you look at the source of your message schema check the prefix for the imports node pointing to your Property Schema (default PropertySchema.xsd) - its prefix defaults to ns0.
On the message schema Schema node check the Imports property collection if any of your imported/included/redefined types use ns0 as their namespace prefix.
You can change the namespace prefix for imported types - personally I use an abbreviation of the imported type name like cot for companytype.

Related

create dynamic object in GO operator controller

I am following the below blog which explains how to create operator and import another CR into existing one.
http://heidloff.net/article/accessing-third-party-custom-resources-go-operators/
here https://github.com/nheidloff/operator-sample-go/blob/aa9fd15605a54f712e1233423236bd152940f238/operator-application/controllers/application_controller.go#L276 , spec is created with hardcoded properties.
I want to import the spark operator types in my operator.
https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/pkg/apis/sparkoperator.k8s.io/v1beta2/types.go
This spark operator is having say - 100+ types/properties. By following the above blog , i could create the Go object but it would be hardcoded. I want to create the dynamic object based on user provided values in CR YAML. e.g. - customer can provided 25 attributes , sometimes 50 for spark app. I need to have dynamic object created based on user YAML. Can anybody please help me out ?
If you set the spec type to be a json object, you can have the Spec contain arbitrary json/yaml. You don't have to have a strongly typed Spec object, your operator can then decode it and do whatever you want with it during your reconcile operation as long as its you as you can serialize and deserialize it from json. Should be able to set it to json.RawMesage I think?
What do you mean by hardcoded properties?
If I understood it correctly, you want to define an API for a resource which uses both types from an external operator and your customs. You can extend your API using the types from specific properties such as ScheduledSparkApplicationSpec from this. Here is an example API definition in Go:
type MyKindSpec struct {
// using external third party api (you need to import it)
SparkAppTemplate v1beta2.ScheduledSparkApplicationSpec `json:"sparkAppTemplate,omitempty"`
// using kubernetes core api (you need to import it)
Container v1.Container `json:"container,omitempty"`
// using custom types
MyCustomType MyCustomType `json:"myCustomType,omitempty"`
}
type MyCustomType struct {
FirstField string `json:"firstField,omitempty"`
SecondField []int `json:"secondField,omitempty"`
}

Mongoengine collection naming with UpperCamelCase?

I have been adding some collections to a Flask app using mongoengine models and the code works fine.
I was inspecting the data using MongoCompass and just noticed that one of the collections is named notify_destination which is NOT the name I used or its lowercase version.
My model class is NotifyDestination and there is no meta tag - so why the underscore in the middle of the collection name?
class NotifyDestination(me.Document):
owner_id = me.ObjectIdField()
username = me.StringField()
Mongoengine documentation (2.3.4) just says
The name of the collection is by default the name of the class, converted to lowercase.
Is insertion of the underscore normal behavior of MongoEngine because of my using UpperCamelCase?
I still have time to specify & force a name using a meta = {} tag in the model if this behavior is not officially documented somewhere else.
(mongoengine contributor here) Yes, this is the default behavior, the doc is imprecise but it's basically converting from UpperCamelCase to snake_case.
This means that
class User(Document):
# will have "user" as default collection name
class MyCompanyUser(Document):
# will have "my_company_user" as default collection name
class USACompany(Document):
# will have "u_s_a_company" as default collection name
Note that the doc was fixed.

xml namespace issues when building an xml file in nodejs xmlbuilder2

When I include this line in my template for nodejs xmlbuilder2:
template = {
'jcr:root': {
...
'#xmlns:jcr': 'http://www.jcp.org/jcr/1.0', // this one
...
}
}
I get the following error.
NamespaceError: The operation is not allowed by Namespaces in XML. [XMLNS] Qualified name includes a prefix but the namespace is null.
If I take it out, and paste "xmlns:jcr="..." in the xml file, and put it in AEM, it works (I should clarify, these are content fragments I'm making), but it does not show up in AEM without that line. I found this googling the error:
"if the qualified name includes a prefix, the namespace URI cannot be null or an empty string. if the reserved xmlns prefix is used, the namespace URI must match the corresponding specified system URI."
If I understand this right, my namespace URI is not null, and I am using xmlns:, so I need to change the uri to the right one? but this is the one that AEM has in its xml files when I download them.
I also think node doesn't like that 'xmlns:jcr' is an attribute of jcr:root, so it is defining jcr inside a jcr element, but again this is all copied verbatim from a file AEM made and I downloaded.

Use property in OSGI component declaration

In my module, in OSGI component declarationIi need to use a property which will be in my portal-ext.properties, like that :
#Component(
immediate = true,
property = {
"dispatcher=FORWARD",
"dispatcher=REQUEST",
"servlet-context-name=",
"servlet-filter-name=Detail UC Filter",
"url-pattern=/web/guest/" + PropsUtil.get("myPath") + "/*"
}
But i get the compilation error : " The value for annotation attribute Component.property must be a constant expression". How can i do to use a property here?
But i get the compilation error : " The value for annotation attribute Component.property must be a constant expression". How can i do to use a property here?
The entry:
"url-pattern=/web/guest/" + PropsUtil.get("myPath") + "/*"
is the problem. This is because annotations can only have values that are compile-time constants. Obviously this property is not a compile time constant as its value depends on calling a method.
If you want to supply property values at runtime then you can do this in OSGi using Configuration Admin. All Declarative Services components are configurable by default, using a pid which is either:
User configured by setting #Component(configurationPid="foo")
User configured by setting #Component(name="bar")
Defaulted using the fully qualified class name of the component implementation
When you supply a configuration dictionary to Configuration Admin which matches the pid for your DS component then it will be bound to the component.
Your component properties will be merged with the configuration dictionary (with the configuration overriding the static properties). This can be received by your component using an #Activate method
If your component is registered as a service then your service properties will also be updated.
If your component has a #Modified method then these changes will be dynamic, otherwise your component instance will be deactivated and discarded, and a new instance created and activated.
You can force your component not to activate until a configuration has been provided by setting your component's configuration policy. This is useful when you have a property that needs to exist, but can't be known until runtime.
#Component(configurationPolicy=ConfigurationPolicy.REQUIRE)
You can set any of these properties using a config admin configuration.
So one approach is to have a separate component that writes a configuration for this component.
You can use configurationPolicy = ConfigurationPolicy.REQUIRE to prevent the component to become activated before this configuration is present.
Another approach is to use a component factory. See this blog from Scott.

Hybris: Error on initiating the workflow on removing print extension - unexpected validator error: cannot find spring bean

Not sure where to check it. No dependencies are found in xml files. I don't find constraints related to this.
INFO | jvm 1 | main | 2017/03/14 11:10:30.867 | ESC[mESC[0;33m2017-03-14 11:10:30 WARN [Thread-17] [10.0.12.6] [EditorArea] Cound not update item, reason: [com.sbs.ecomm.hybris.sbproductcockpit.workflow.SBProductWor‌​kflowCreationInterce‌​ptor#5d47afd3]: unexpected validator error: cannot find spring bean [workflowAssignedJobAttributeHandler] configured for dynamic attribute [Workflow.assignedJob] from extension [print]
The dynamic attribute handler was initially defined in the print extension.
When the system was initialized the type system therefore got the attribute assignedJob stored in the database.
Now you removed the extension and the code for this dynamic attribute. That's why you get the error at runtime, because the type system in the database still has this attribute registered and tries to load the value using the dynamic attribute handler (for which the code is no longer present).
You can manually remove the assignedJob attribute through the hmc/backoffice in the type management section as far as I know (for sure thats possible in the hmc).
If an extension has been removed (that has previously been present) the typesystem in the database is not automatically removed.
You might also take a look at the orphaned types in the hac. All types of the print extension should show up there now as they are in the database but no longer present in the code/platform.
(Just remembered that I answered a similar problem for missing attributes here: https://stackoverflow.com/a/32824789/932201 .. that contains the steps how to remove an attribute)
Hope this helps!
In your class SBProductWor‌​kflowCreationInterce‌​ptor you probably save a Workflow model. This model has an handler and both are defined in the print extension.
You can't remove the print extension without removing the dependancies in your custom classes.

Resources