Skip to main content
added 269 characters in body
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

There are two overloads for the StructureGroup constructor:

StructureGroup(Session, TcmUri) - Create an instance for a new Structure Group.

StructureGroup(TcmUri, Session) - Create an instance for an existing Structure Group.

You are using the first constructor overload, which tries to create a new Structure Group, but in a publishing context, I gather that you actually meant to use the second overload of the constructor, so change the order of your input parameters.

Also in your original question you were using the following code:

TcmUri uri2 = new TcmUri("tcm:123-3744-2");

Which is a TCMURI of a Folder (ending on -2, which identifies it as Item Type Folder). You later changed it to end on -4, which is indeed the correct Item Type for a Structure Group.

The error message seems to identify another issue, namely that you are trying to publish a multimedia Component from Publication 123, why specifying a Structure Group of a different (child) Publication. You have to keep all the URIs in the same context Publication.

There are two overloads for the StructureGroup constructor:

StructureGroup(Session, TcmUri) - Create an instance for a new Structure Group.

StructureGroup(TcmUri, Session) - Create an instance for an existing Structure Group.

You are using the first constructor overload, which tries to create a new Structure Group, but in a publishing context, I gather that you actually meant to use the second overload of the constructor, so change the order of your input parameters.

Also in your original question you were using the following code:

TcmUri uri2 = new TcmUri("tcm:123-3744-2");

Which is a TCMURI of a Folder (ending on -2, which identifies it as Item Type Folder). You later changed it to end on -4, which is indeed the correct Item Type for a Structure Group.

There are two overloads for the StructureGroup constructor:

StructureGroup(Session, TcmUri) - Create an instance for a new Structure Group.

StructureGroup(TcmUri, Session) - Create an instance for an existing Structure Group.

You are using the first constructor overload, which tries to create a new Structure Group, but in a publishing context, I gather that you actually meant to use the second overload of the constructor, so change the order of your input parameters.

Also in your original question you were using the following code:

TcmUri uri2 = new TcmUri("tcm:123-3744-2");

Which is a TCMURI of a Folder (ending on -2, which identifies it as Item Type Folder). You later changed it to end on -4, which is indeed the correct Item Type for a Structure Group.

The error message seems to identify another issue, namely that you are trying to publish a multimedia Component from Publication 123, why specifying a Structure Group of a different (child) Publication. You have to keep all the URIs in the same context Publication.

Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

There are two overloads for the StructureGroup constructor:

StructureGroup(Session, TcmUri) - Create an instance for a new Structure Group.

StructureGroup(TcmUri, Session) - Create an instance for an existing Structure Group.

You are using the first constructor overload, which tries to create a new Structure Group, but in a publishing context, I gather that you actually meant to use the second overload of the constructor, so change the order of your input parameters.

Also in your original question you were using the following code:

TcmUri uri2 = new TcmUri("tcm:123-3744-2");

Which is a TCMURI of a Folder (ending on -2, which identifies it as Item Type Folder). You later changed it to end on -4, which is indeed the correct Item Type for a Structure Group.