Installing Static Data Types with Dependencies via Package - c1-cms

I've developed a package that contains two static data types (IClient and IClientHour). One of the static data types (IClientHour) has a dependency on the other static data type (IClient).
I'm attempting to add the data types to my instance of Composite C1 via a package. I would like to leverage the DataTypePackageFragmentInstaller and DataTypePackageFragementUninstaller classes to register and drop my data types with the package.
The problem I'm facing is that the package is failing to validate and spits out the following error:
Failed to build data type descriptor for interface
'Builders.Data.IClientHour' The type 'Builders.Data.IClient' could not
be found.
Both types are in a DLL that I am copying to the CMS via the FilePackageFragmentInstaller. In searching the Composite C1 forum I found a suggestion of adding assemblyLoad="true" to the File element for the assembly that contains the types. This suggestion did not solve the issue I'm facing.
Below is a condensed version of my install.xml displaying the sections related to the data types and assembly:
<mi:PackageFragmentInstallers>
<mi:Add installerType="Composite.Core.PackageSystem.PackageFragmentInstallers.FilePackageFragmentInstaller, Composite" uninstallerType="Composite.Core.PackageSystem.PackageFragmentInstallers.FilePackageFragmentUninstaller, Composite">
<Files>
<File sourceFilename="~\Bin\Builders.dll" targetFilename="~\Bin\Builders.dll" allowOverwrite="false" assemblyLoad="true" />
</Files>
</mi:Add>
<mi:Add installerType="Composite.Core.PackageSystem.PackageFragmentInstallers.DataTypePackageFragmentInstaller, Composite" uninstallerType="Composite.Core.PackageSystem.PackageFragmentInstallers.DataTypePackageFragmentUninstaller, Composite">
<Types>
<Type name="Builders.Data.IClient, Builders" />
<Type name="Builders.Data.IClientHour, Builders" />
</Types>
</mi:Add>
</mi:PackageFragmentInstallers>
Any assistance/suggestions with accomplishing this task is greatly appreciated.

After asking the same question on CodePlex, wysocki and burningice were able to lead me in the right direction to correct the issue that I was facing.
In a nutshell, I had used a string to reference the type of my IClient data type from the IClientHour data type. If you use a string you must also include the Assembly name in the reference (e.g. Builders.Data.IClient, Builders).
As per Composite C1 examples and burningice's guidance you should avoid using a string and instead reference your foreign key using typeof.
Here is an example of how I orginally tried to reference my data type:
[ForeignKey("Builders.Data.IClient", AllowCascadeDeletes = true,
NullReferenceValue = "{00000000-0000-0000-0000-000000000000}")]
Here is how I should have referenced it using a string:
[ForeignKey("Builders.Data.IClient, Builders", AllowCascadeDeletes =
true, NullReferenceValue = "{00000000-0000-0000-0000-000000000000}")]
Per Composite C1 examples and guidance from burningice this is how you should reference another data type (Note: when using this method you must also include the name of the field that you wish to use in the relationship):
[ForeignKey(typeof(Builders.Data.IClient), "Id", AllowCascadeDeletes =
true, NullReferenceValue = "{00000000-0000-0000-0000-000000000000}")]
References:
CodePlex Forum Thread: http://compositec1.codeplex.com/discussions/652976
Composite Documentation: http://docs.composite.net/Console/Static-IData-Types/Example2

Related

How can i create a custom object in Salesforce with a '__' in the name?

I am trying to check if a change tables exists in Salesforce by calling
var name = "acme_npsp__Allocation_c__c";
try
{
salesforceObject = _service.describeSObject(name);
return sObject;
}
catch (Exception ex)
{
error = ex.Message;
}
but it gives an error:
INVALID_TYPE: salesforceObject type 'acme_npsp__Allocation_c__c' is not
supported. If you are attempting to use a custom object, be sure to append the
'__c' after the entity name. Please reference your WSDL or the describe call for
the appropriate names.
(107 - FIELD_INTEGRITY_EXCEPTION) Cannot create a new component with the namespace: acme_npsp. Only components in the same namespace as the organization can be created through the API.
But if i replace the __ in the middle with a single _ it seems to work , but that isnt my object in salesforce so i cant reference it in other code.
Salesforce doesnt allow to create such an object with '__' in the middle, but it was created using the package Nonprofit Success Pack (NPSP) which can be downloaded from the store.
How can i create the object with the '__' in the middle , ie after the npsp ?
Salesforce does not allow __ in API names, because double underscores serve a special meaning: they delimit the components of the API name. An API name, for a schema element like this, consists of up to 3 parts:
namespace__component_name__c
namespace is the first component, and is the (optional) namespace, which indicates that the component is part of a package. NPSP's namespace is npsp. You cannot create components in a namespace you do not own.
The name element is present on all components. For Account and other standard objects, it's the entire API name.
__c is the suffix, which indicates what kind of entity you have. __c is a custom object; __b a BigObject; __e a custom Platform Event; __mdt a custom Metadata Type. Lack of a suffix indicates a standard component.
Your question does not make much sense as written. You appear to be trying to work with the object npsp__Allocation__c. It's not clear why you are trying to prepend some other value to the namespace and suffix.
Accessing the describe does not create an object, so the behavior of your code is exactly as designed.

Maximum call stack size exceeded when using the new typescript enabled version of reactjs

I use the new typescript supported version of reactjs
along with the redux-orm and when u try to insert a value into the store i get this issue of "Maximum call stack size exceeded" the same works with the old template
Below is the code with new typescript supported reactjs which throws the error
https://reactjs.org/docs/static-type-checking.html#typescript and the old github version https://github.com/microsoft/TypeScript-React-Starter which works.
https://drive.google.com/open?id=15eolNjeYroyubgSmbGaaKfjxbe-IZ8KK
I am unable to understand what is different that causes the error with the new version. Thanks for any help.
Properties can't be defined directly on Model classes.
The root cause lies in the create-react-app's babel preset - transpilation output introduces additional property descriptors in Model prototype chain.
These properties interfere with descriptors installed by redux-orm during schema registration, resulting in Maximum call stack size exceeded error.
This can be avoided through declaration merging, specifically by providing a class and an interface with matching names. The interface contains Model properties, the class is almost 1:1 to JS Model definition.
Example:
interface Book {
id: number
title: string
}
class Book extends Model<typeof Book> {
static modelName = 'Book' as const
static fields = {
id: attr(),
title: attr()
}
}
I've created a repo with working example: https://github.com/tomasz-zablocki/redux-orm-ex-types-react-example
Mind you, these are custom types, but it's definitely where I'd like to take the #types/redux-orm package to, likely with the 0.14 release of redux-orm.

How to create a task in Integrity using Java API

Could some one please tell me Is there any way to create a Task/Change Request/Work Package in MKS Integrity using Java API?
We have an xml file with all the details about Task. By taking this as Input, need to generate a Task/Change Request/Work Package.
The Integrity Java API is basically a structured command line interface, so if you can construct a standard Integrity command (with parameters & options) to create the item, you can easily use the API to create the item also. NOTE: This works for most commands, but not all.
For example:
If your command line is:
im createissue --type=Task --State=Submitted --field=Summary="Test summary"
You could do the same with the following code:
Command cmd = new Command(Command.IM, "createissue");
cmd.addOption(new Option("type", "Task"));
cmd.addOption(new Option("state", "Submitted");
MultiValue mv = new MultiValue("=");
mv.add("Summary");
mv.add("Test Summary");
cmd.addOption("field", mv);
Then run the command using a CommandRunner.
You can get more assitance in the PTC Integrity community site (https://www.ptcusercommunity.com/community/integrity).
You can create the Task by using the below command line interface
im createissue --type=Task --field=State=Submitted --field=Summary="Test summary"
The type field specifies the issue type to create. Your administrator defines issue types and this option is mandatory.

EPiServer DDS Change Schema for type

I am storing a type in the EPiServer DDS that has a few properties such as string and guid. I now want to add a new property of type string to that type. How is it possible to get the DDS to recognise the new property added to the type and add it to the schema for the type in the DDS.
You need to remap the type to the store like this:
Let's say your class is called Car
var store = DynamicDataStoreFactory.Instance.GetStore(typeof(Car));
store.StoreDefinition.Remap(typeof(Car));
store.StoreDefinition.CommitChanges();
If you're then going to use the store instance directly after then do a refresh:
store.Refresh();
You can find more info about the DDS here:
http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-60/Dynamic-Data-Store/
Paul Smith
Developer Evangelist
EPiServer
The next version of CMS / EPiServer Framework will ship with a PowerShell cmdlet to do this from a script.
For the CMS 6 version I suggest you add the code to the Global.asax or create an initialization module
(http://world.episerver.com/Blogs/Magnus-Strale/Dates/2010/2/Changes-in-the-initialization-system-from-EPiServer-CMS-6-RC1/)
You can first check if the type and store are aligned:
var store = DynamicDataStoreFactory.Instance.GetStore(typeof(Car));
if (!store.StoreDefinition.ValidateAgainstMappings(typeof(Car), false))
{
store.StoreDefinition.Remap(typeof(Car));
store.StoreDefinition.CommitChanges();
}
This way you only remap when needed.

How-to: Load a type from a referenced assembly at runtime using a string in Silverlight

I have tried this, specifying the assembly name:
Type.GetType(string.Format("{0}.{1}, {0}", typeToLoad.AssemblyName, typeToLoad.ClassName));
Which throws the following:
The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest
Trying the same without including the trailing assembly name like this:
Type.GetType(string.Format("{0}.{1}", typeToLoad.AssemblyName, typeToLoad.ClassName));
-- returns null.
So, I am looking for a way to instantiate a class by providing its fully qualified name in Silverlight 4.0.
Any ideas would be greatly appreciated, Thanks.
I had the same issue and it worked when I tried the assembly qualified type name in the following format :
", , Version="", Culture=, PublicKeyToken="

Resources