locked
Several features - to combine or not ? RRS feed

  • Question

  • Hi

    I've been working on one project, the project has grown and now I have 4 features each with content types and fields and some have associated forms.

    I've installed these individually and it all works.

    Just wondering if i should have the one feature that combines all the features ? One of the advantages for me to keep them seperate is that it helps me divide and debug code..

    I've added the forms manually to the layouts folder.

    Does anyone have thoughts over this. Thanks

     

    Wednesday, January 18, 2012 2:47 PM

Answers

  • Hi, in feature.xml file under elementManifest you can call the element files and custom files i guess, just give example so that we can try out.
    Anil
    • Marked as answer by Wayne Fan Friday, January 27, 2012 3:44 AM
    Thursday, January 19, 2012 11:22 AM
  • You can also consider feature stapling instead.  If they work individually, it seems a lot of work to edit everything within one set of files when stapling should work.

    Take a look at this to see if its of any use: -

    http://msdn.microsoft.com/en-us/library/bb861862%28v=office.12%29.aspx


    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/
    • Marked as answer by Wayne Fan Friday, January 27, 2012 3:44 AM
    Thursday, January 19, 2012 12:43 PM
    Answerer

All replies

  • Hi,

    This can be done. Specify more details about your features so that we can consolidate them into one


    Thanks, Rahul Rashu
    Wednesday, January 18, 2012 8:27 PM
  • Hi

    When you say consolidate are you also referring to the forms or just the xml feature files. i.e. Will the final result package the forms also ?

     

    CreditTreasury feature ,  3 xml files - 2 fields and custom form

    ops feature, 3 xml files - 2 fields and custom form

    Ver feature, 3 xml files - 0 fields and custom form

     

     

     

     

     

     


    Wednesday, January 18, 2012 8:45 PM
  • Hi, in feature.xml file under elementManifest you can call the element files and custom files i guess, just give example so that we can try out.
    Anil
    • Marked as answer by Wayne Fan Friday, January 27, 2012 3:44 AM
    Thursday, January 19, 2012 11:22 AM
  • You can also consider feature stapling instead.  If they work individually, it seems a lot of work to edit everything within one set of files when stapling should work.

    Take a look at this to see if its of any use: -

    http://msdn.microsoft.com/en-us/library/bb861862%28v=office.12%29.aspx


    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/
    • Marked as answer by Wayne Fan Friday, January 27, 2012 3:44 AM
    Thursday, January 19, 2012 12:43 PM
    Answerer
  • Hi Got doing something else hence the delay.. I actually have 3 features but have only shown 2 so its easier. if you could have a look at combining it would be helpful. Thanks

    Here is feature 1

    Feature.xml

      <?xml version="1.0" encoding="utf-8" ?> 
    - <Feature Id="C4AE7F67-1195-4F2F-9458-8C9812D2F930" Title="Custom Approval Form Feature Form" Description="Represents a custom approval form" Version="12.0.0.0" Scope="Site" xmlns="http://schemas.microsoft.com/sharepoint/">
    - <ElementManifests>
      <ElementManifest Location="ApprovalFormCustomColumns.xml" /> 
      <ElementManifest Location="ApprovalFormContentType.xml" /> 
      </ElementManifests>
    - <Properties>
      <Property Key="Globallyavailable" Value="TRUE" /> 
      </Properties>
      </Feature>

    ContentType.xml

    <?xml version="1.0" encoding="utf-8" ?> 
    - <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    - <ContentType ID="0x010801004BC4BB977BC24DC7B227BF20A25F78D3" Name="Custom Approval Form Content Type" Group="Custom Content Types" Description="Custom Approval Form Content Type" Version="0" Hidden="FALSE">
    - <FieldRefs>
      <FieldRef ID="{4DF2E07A-05D0-43e1-92D6-0800A8CAAD47}" Name="_ApprovalNotes" /> 
      <FieldRef ID="{E77CE46F-1BDB-4840-A6EC-6A1FE17ABD8E}" Name="_ApprovalStatus" /> 
      </FieldRefs>
    - <XmlDocuments>
    - <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
    - <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
      <New>_layouts/CustomApprovalForms/ApprovalForm.aspx</New> 
      <Display>_layouts/CustomApprovalForms/ApprovalForm.aspx</Display> 
      <Edit>_layouts/CustomApprovalForms/ApprovalForm.aspx</Edit> 
      </FormUrls>
      </XmlDocument>
      </XmlDocuments>
      </ContentType>
      </Elements>

    culumns.xml

    <?xml version="1.0" encoding="utf-8" ?> 
    - <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Field ID="{4DF2E07A-05D0-43e1-92D6-0800A8CAAD47}" Name="_ApprovalNotes" DisplayName="Approval Form Notes Field" Group="Approval Form Custom Columns" Type="Note" NumLines="10" Required="FALSE" /> 
      <Field ID="{E77CE46F-1BDB-4840-A6EC-6A1FE17ABD8E}" Name="_ApprovalStatus" DisplayName="Approval Form Status Field" Group="Approval Form Custom Columns" Type="Boolean" Required="TRUE" /> 
      <Field ID="{fdc3b2ed-5bf2-4835-a4bc-b885f3396a61}" Name="_raj" DisplayName="Rajl Form Status Field" Group="Approval Form Custom Columns" Type="Boolean" Required="TRUE" /> 
      </Elements>


    Feature2

    feature.xml

    <?xml version="1.0" encoding="utf-8" ?> 
    - <Feature Id="0F9F28FE-6089-415F-925F-A8D90CCA767D" Title="Custom Approval Form Ops Feature" Description="Represents a custom approval form Ops" Version="12.0.0.0" Scope="Site" xmlns="http://schemas.microsoft.com/sharepoint/">
    - <ElementManifests>
      <ElementManifest Location="ApprovalFormCustomColumns1.xml" /> 
      <ElementManifest Location="ApprovalFormContentType1.xml" /> 
      </ElementManifests>
    - <Properties>
      <Property Key="Globallyavailable" Value="TRUE" /> 
      </Properties>
      </Feature>

    contenttype.xml

    <?xml version="1.0" encoding="utf-8" ?> 
    - <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    - <ContentType ID="0x01080100D3CA814219464DD19209D3194D7ACBA2" Name="Custom Approval Form Content Type Ops" Group="Custom Content Types" Description="Custom Approval Form Content Type Ops" Version="0" Hidden="FALSE">
    - <FieldRefs>
      <FieldRef ID="{3BCB88FB-3C7B-4178-9E71-7492C2F318B4}" Name="OpsEntry" /> 
      <FieldRef ID="{919951ED-BC38-4223-B57C-86AEE293AA17}" Name="_VerificationNumber" /> 
      </FieldRefs>
    - <XmlDocuments>
    - <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
    - <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
      <New>_layouts/CustomApprovalForms/OpsForm.aspx</New> 
      <Display>_layouts/CustomApprovalForms/OpsForm.aspx</Display> 
      <Edit>_layouts/CustomApprovalForms/OpsForm.aspx</Edit> 
      </FormUrls>
      </XmlDocument>
      </XmlDocuments>
      </ContentType>
      </Elements>

    columns.xml
    <?xml version="1.0" encoding="utf-8" ?> 
    - <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Field ID="{919951ED-BC38-4223-B57C-86AEE293AA17}" Name="_VerificationNumber" DisplayName="Bankmaster Verification Number" Group="Approval Form Custom Columns" Type="Text" Required="FALSE" /> 
    - <Field ID="{3BCB88FB-3C7B-4178-9E71-7492C2F318B4}" Name="OpsEntry" DisplayName="Operations Entry" Group="Approval Form Custom Columns" Type="Choice" Required="TRUE">
    - <CHOICES>
      <CHOICE>No</CHOICE> 
      <CHOICE>Yes</CHOICE> 
      </CHOICES>
      </Field>
      </Elements>


     

     

    Thursday, February 2, 2012 2:39 PM