I want to change the namespace in my model code (mymodel.cto) different from (org.acme.sample). I'm trying to create the Business Network Definition with:
composer archive create....
I received the following error:
IllegalModelException: Failed to find namespace org.mymodel
I know that with Hyperledger Composer, you can't change the domain, but this is with my own local instance of Hyperledger Composer. How can I set my own domain on the Business Network Definition?
I just delete the file permissions.acl (with had the correct domain) and it works ...
I had a similar issue and it was because of a mismatch in naming convention. Some of the tutorials have the model file in a sub-namespace, i.e. org.myorg.myapp.model
where all the references in the logic.js & queries.js also referred to the models in org.myorg.myapp.model, but I tried to use the 'top level' namespace 'org.myorg.myapp' in the permissions.acl
When I changed the namespace (and references) to org.myorg.myapp (i.e. removed the .model) then it matched what was in the permissions.acl and worked.
So I don't think the correct answer is to remove your acl but to fix the name mismatch.
Related
I have rule A implemented with a macro that uses declare_directory to produce a set of files:
output = ctx.actions.declare_directory("selected")
Names of those files are not known in advance. The implementation returns the directory created by declare_directory with the following:
return DefaultInfo(
files = depset([output]),
)
Rule A is included in "srcs" attribute of rule B. Rule B is also implemented with a macro. Unfortunately the list of files passed to B implementation through "srcs" attribute only contains the "selected" directory created by rule A instead of files residing in that directory.
I know that Args class supports expansion of directories so I could pass names of all files in "selected" directory to a single action. What I need, however, is a separate action for every individual file for parallelism and caching. What is the best way to achieve that?
This is one of the intended use cases of directory outputs (called TreeArtifacts in the implementation), and it's implemented using ActionTemplate:
https://github.com/bazelbuild/bazel/blob/c2100ad420618bb53754508da806b5624209d9be/src/main/java/com/google/devtools/build/lib/actions/ActionTemplate.java#L24-L57
However, this is not exposed to Starlark, and has only a couple usages currently, in the Android rules AndroidBinary.java and C++ rules CcCompilationHelper.java. The Android rules and C++ rules are going to be migrated over to Starlark, so this functionality might eventually be made available in Starlark, but I'm not sure of any concrete timelines. It would probably be good to file a feature request on Github.
In the AWS CDK, it's straight forward to create a Pinpoint Service. But how do you get the Project ID (also referred to as the Pinpoint App ID or Application ID) for use in subsequent CDK code.
Create a Pinpoint project:
const pinpointProject = new pinpoint.CfnApp(this, 'PinpointNotificationProject', {
name: 'myProject',
});
In the AWS CloudFormation docs it says:
"When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the unique identifier (ApplicationId) for the Amazon Pinpoint application."
However, the following CDK code returns the project name not the id. The value of logicalId = myProject.
cdk.Fn.ref(pinpointProject.logicalId); // This returns 'myProject'
pinpointProject.ref; // This also returns 'myProject'
This is confirmed fixed in the latest CDK version 1.130.0. The ref property now returns the Pinpoint ProjectId.
The problem you are running into is that pinpoint is not a finished module. You can see this that all the functions within are prefixed with Cfn - cloudformation. This means that they are barebones and not tied into all the interface hooks that the rest of CDK is making use of to toss things around.
First, the logical ID is NOT the project name. the Logical Id is part of the Cloudformation Template that is generated for any resource Cloudformation is going to stand up. It links the given resource to the stack, so that any changes under the same logical id will be applied to the same stood up resource. It is only referenced internally to the cloudformation stack and never known outside. CDK uses the LogicalID to generate the name of the resource if you do not specify one.
Second, Taking a look at the documentation shows that CfnApp has the following property: attrArn. Meaning in your code, you would reference this by pinpointProject.attrArn - the arn of a pinpoint resource is something like: arn:aws:mobiletargeting:region:accountId:apps/projectId. with, as you guessed it, the projectId as the last value. you can split the string and get that value out, or use the arn manipulation methods provided as part of the core module to extract what you need.
Finally, even though the Pinpoint module is pretty much just barebones, it may still be possible to pass the variable storing your Pinpoint Construct Object to whatever other resource requires it. I say may because, as mentioned, most of the Cfn prefixed functions do not have the proper hooks to do this well - but some do, and Ive never worked with Pinpoint directly.
I recommend spending some time to understand how the CDK Documentation is laid out. Its bare bones in places, but once you understand how they structured it, these kinds of questions are readily answered within.
I am trying to create a custom template for VS2019 comprised of multiple projects (based on this guide), and I'm having problems with the references.
My solution is based on the classic 3-tier architecture (data/business/ui), so when I create a new solution - call it "MySolution", I get "MySolution.Data", "MySolution.Business" and "MySolution.UI" - all good. I need the business layer to have a reference to the data layer - however, using the $ext_safeprojectname$ variable just gives me an unresolved reference in the projects node of my dependencies to "$ext_safeprojectname$.Data"
Other variables seem to work fine - for example, if I use $safeprojectname$, I get "MySolution.Business.Data" in my reference - correct parsing of the variable, for the business layer project, but not the desired result.
Has the ext_ prefix been replaced? I cannot seem to find any documentation for this anywhere.
Thanks!
I was able to solve it after commenting on your question. I was missing the CopyParameters=true attribute for ProjectTemplateLink element in the .vstemplate file. It is mentioned as a tip on Create a multi-project template from an existing solution. My ext_ variables were replaced once I did this. Your ProjectTemplateLink element should look something like below:
<ProjectTemplateLink ProjectName="MyProject" CopyParameters="true">...</ProjectTemplateLink>
In my Symfony 4 project I've created a HelloBlock class in the /src/Blocks/Hello/HelloBlock.php file.
Here's its constructor...
public function __construct(EntityManagerInterface $entityManager)
{
$this->em = $entityManager;
}
And then in my services.yaml I've added this...
App\Blocks\:
resource: '../src/Blocks'
tags: ['controller.service_arguments']
When running my code (dev environment, cache cleared, etc) I'm getting the "Too few arguments" error. It's not injecting the dependency.
Can anyone help? I thought this is what the Symfony DI is supposed to do.
Thanks!
Missing arguments:
You probably have to provide the arguments: to the service definition.
App\Blocks\:
resource: '../src/Blocks'
tags: ['controller.service_arguments']
arguments:
- '#doctrine.orm.default_entity_manager'
# is used to not interpret the name as a simple string but to fetch the actual service instead.
Default Doctrine naming:
The naming is a little bit tricky; this answer made me understand how the naming is built: <entitymanager_name> (according to the doctrine.orm.entity_managers YAML definition) concatenated to _entity_manager.
With the special case of the default one that is available as doctrine.orm.default_entity_manager even when not explicitly defined in the above mentioned config key.
My assumption:
I tried on my app to just add that string as an argument and it didn't fail. Then I put a typo, and it failed. So I assume that default_entity_manager is defined automatically (I am not sure where).
Otherwise:
In case it doesn't work, the other fix would be to verify why the entityManager is not automatically wired. Check your config for autowiring the src/ folders.
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Tests, ....}'
and ensure that Blocks is not listed among the exclude folders.
I am trying to create my custom copy of italian wikipedia from the dump.
I encounter the problem with some of extensions.
I have got the error:
Lua error in package.lua at line 80: module 'Modulo:String' not found.
The problem is that there is no 'Modulo:String' in my copy, but there is 'Module:String'.
I have tried to add alias for this namespace in my LocalSettings.php, as I did for categories, but for modules it didn't help.
$wgNamespaceAliases['Categoria'] = NS_CATEGORY; //this helped for categories
$wgNamespaceAliases['Modulo'] = NS_MODULE; //this does not work
Module namespace is part of Scribunto default namespace.
https://www.mediawiki.org/wiki/Extension_default_namespaces
How to solve the Lua error with loading modules?
The actual set of namespace aliases for Italian Wikipedia is (1); Categoria and Modulo are translations. To use them, just set $wgLanguageCode to it.
(I'm not sure why setting Modulo as an alias does not work; in theory it should. But it's not the easy way to set up a mirror.)