Packaging and listing multiple resources

Hello,
I want to include a directory containing a large number of wav files in an executable Jar file and access them in my program. The number of files is very large and it would be impractical, let alone inelegant, to write code to load each file individually by name, or from a text file or otherwise. In the past I have not needed to package such media files, and have managed by listing the files in a directory and then iterating through the list to load them, as follows:
File f = new File(directoryName);
File[] myFiles = directoryName.listFiles();
for(int i = 0; i < myFiles.length; i++) {
//try to load the file
Is there any way I can do this using URL and ClassLoader, or in some other way that does not depend on the absolute location of the directory? It should also work in an Applet loaded in a browser.
Many thanks.

>
I want to include a directory containing a large number of wav files in an executable Jar file and access them in my program. >Side note: it is generally a good idea to keep compressed formats separate to other media types and classes, and to specify 'no compression' on those Jars. The Zip compression format is not good for compressing such files that already use compression.
>
..The number of files is very large and it would be impractical, let alone inelegant, to write code to load each file individually by name, or from a text file or otherwise. >Why? It is trivial to write code that can read the names, and Ant can produce the file at build time.
>
... It should also work in an Applet loaded in a browser.>This project would be well suited to being launched using webstart. By specifying the media Jars as 'lazy' download, the app. would arrive on screen much faster, then you might use the DownloadService to download them in a background thread or 'as needed'.

Similar Messages

  • Packaging and Collecting Multiple files

    Hi,
    Does anyone know of a quick way to collect multiple files for artwork.
    I have 60 individual fact sheets that I need to send to print, doing each individually will drive me mental!
    Ta
    Jim

    Hi, sorry, I'm a bit technology-illiterate, and I replied to this post because it looked the most relevant to what I was hoping to accomplish.
    I don't have InDesign, so I guess I'm in the wrong forum, but any help ANYONE can provide would be appreciated.
    I do apologize for not posting in the right place, but frankly the help page for Adobe Reader 9 (which is what I have) had absolutely no answers to my question.
    Basically, the task at hand is to create a coherent, single PDF file, if possible, from 33 images that I have. These images are copies of pages from a primary source document found via the Library of Congress. When I hit the "save image" button on the website, that is the format that they downloaded in.
    My OS is Windows Vista. I know that I have, at some point in time, managed to jury-rig a PDF from multiple files before, but I can't remember how on earth I did it the first time because I came about it by accident.
    I'll understand if it's impossible to make a PDF out of the files the way that they're currently formated, and I do appreciate your timely response.
    Thanks so much for trying to help, and please let me know if you can think of anything I can do (without paying to download a program - I'm way too poor for that)

  • How do you package and deploy a resource adapter with a c++ library?

    I am using Weblogic 8.1 and am trying to deploy a resource adapter that has a platform dependent c++ library. This has to be done from a script so I am using weblogic.Deployer. I am failing with a “java.lang.UnsatisfiedLinkError:” I understand that the library is not in java.library.path. I don’t want to have to stop weblogic, set the lib path, restart weblogic, and then deploy. How can I accomplish this?
    thanks

    > In trying to access a dll with the function
    > canWrite
    > (
    > HANDLE handle,
    > CMSG *cmsg,
    > long *len,
    > OVERLAPPED *overlppd
    > )
    >
    > CMSG is a structure
    > typedef struct
    > { long id;
    > unsigned char len;
    > unsigned char msg_lost;
    > unsigned char reserved[2];
    > unsigned char data[8];
    > } CMSG,
    >
    > an error#3:"E:\lv45\mgsource\memory.c line515" is displayed.
    >
    > My question is, how do i get this vi to run correctly without
    > generating the error. Basically, i'm trying to control the esd pci 200
    > can card. i have the c codes and am tryng to write vis with the dll.
    >
    With this additional information, what I'd do about the CMSG is to make
    an array of uInt8 that is sixteen elements in size. You will be able to
    transfer the bytes to and from t
    he array by using indexing. Wire the
    array to the function for the second parameter and set it to pass the
    data by pointer. I have no idea what is supposed to be int he struct
    when the function is passed, but if you cast between a matching cluster
    and the array, you will need to swap the first bytes for the long
    parameter. Same goes for reading the results back from the array after
    the call.
    Greg McKaskle

  • A music album is listed multiple times in my library but each listing only has a few songs in it-not the full listing.  How can I combine them into one album and get rid of other duplicate listings?

    Several music albums listed in my IPhone 5 music library are listed multiple times, but each one only has a portion of the songs listed.  How can I combine them to make one album?

    First....Thank you so much for your prompt reply.  I am sorry for not getting back to you regarding your suggestion-I had computer issues that just got resolved.  Also, this is my first foray into online chat rooms so I have a lot to learn to precisely state my issue!  I did as you suggested and all the songs list the same album when I go into each song's "get info".  However, I am not sure how to edit as you suggested. When I downloaded this album originally, for some reason it broke up into several albums each with different songs from the original album.  I am trying to consolidate them back into one album in my library.  I would greatly appreciate further assistance if you can.  Also, I do not use "the cloud" to store any data and would like a good source of info on how to do this.  Thanks so much for your patience!
    SueZoo

  • Firefox 10. On Windows 7. Adobe PDF will not download or show up in the download list. I tried same files with IE. Download worked fine. Have uninstalled and reinstalled multiple times

    Firefox 10. On Windows 7. Adobe PDF will not download or show up in the download list. I tried same files with IE. Download worked fine. Have uninstalled and reinstalled multiple times

    Perform the suggestions mentioned in the following articles:
    * [[Unable to download or save files]]
    * [https://support.mozilla.com/en-US/kb/Template:clearCookiesCache/ Clear Cookies & Cache]
    Check and tell if its working.
    Not related to your problem but some of your Firefox Plugins are out-dated
    * Update All your Firefox Plugins -> https://www.mozilla.org/en-US/plugincheck/
    * '''When Downloading Plugins Update setup files, Remove Checkmark from Downloading other Optional Softwares with your Plugins (e.g. Toolbars, McAfee, Google Chrome, etc.)'''

  • Packaging and deploying jax ws (webservice) in multiple servers

    I am a java developer and new to JAX-WS.
    i got one requirement to create a web service using jax-ws, packaging using ant build and deploying it in JBOSS and WEBSPHERE server.
    The process which i followed to create a web service below:
         1) created a web service class using @webservice annotation
         2) created a client side artifacts using wsimport which is provided by Jdk and created a war and deployed it jboss.
         3) wsdl is getting generated while deploying a war using a URI - (http://localhost:8080/mywebapplication/routing?wsdl)
         4) create client class to call the webservice. everything is working fine for me.
    Need your expert input for the following below:
         1) if i write the ant build script to package the client stubs, how i can use wsdl location in wsimport ant task. should i use URI (wsdl="http://localhost:8080/mywebapplication/routing?wsdl") or
    (wsdl="d:/route.wsdl")? which is the best practice?
         2) i want to deploy my webservice in JBOSS and WEBSPHERE in different machine and different port no?
         for e.g
    *     http://ip1:port1/mywebapplication/route?wdl*
    *     http://ip2:port2/mywebapplication/route?wdl*
    *     http://ip3:port3/mywebapplication/route?wdl*
         how to mention dynamic ipaddress and port no while running ant build script?
         how to change the wsdl location and port number in generated wsdl and RoutingService client stubs class dynamically? (dont want to change soad address location manually)
    *     Do i need to use wsgen to generate server stubs?*
    *     Need your inputs in packaging and deploying jax ws in multiple servers.*
    Thanks in advance.

    how to change the wsdl location and port number in generated wsdl and RoutingService client stubs class dynamically? (dont want to change soad address location manually)
    Your client stub should look like that...
    <code>
    @WebServiceClient(name = "MyClientStub", targetNamespace = "http://www.openuri.org/", wsdlLocation = "http://localhost:8080/MyClientStub/MyClientStubProxy/#%7Bhttp%3A%2F%2Fwww.openuri.org%2F%7DMyClientStub?wsdl")
    public class MyClientStub
    extends Service
    public MyClientStub(URL wsdlLocation, QName serviceName) {
    super(wsdlLocation, serviceName);
    </code>
    You can use the constructor above, like that...
    <code>
    URL baseUrl = MyClientStub.class.getResource(".");
    URL url = new URL(baseUrl, "http://your-server:your-port-no/MyClientStub/MyClientStubProxy/#%7Bhttp%3A%2F%2Fwww.openuri.org%2F%7DMyClientStub?wsdl");
         MyClientStub stub = new MyClientStub(url, new QName("http://www.openuri.org/", "MyClientStub");
    </code>

  • Export to MS Project and multiple resources to one role

    Ok, after this rather cryptic title i will explain my problem:
    We are currently in a project where we have the following requirement:
    A download of cProjects needs to be imported into MS Project 2007.
    When a project role is staffed with multiple resources in cProjects it is imported into MS Project as a single role with only the first resource attached to it. All the other resources are nowhere to be found.
    Does anyone have a solution to this?
    Edited by: Miel Claessens on Jul 16, 2010 12:57 PM
    Edited by: Miel Claessens on Jul 16, 2010 12:58 PM

    Hello Meil,
    You can try to implement your requirement in BAdI DPR_MSP_CUST_FIELDS method CUST_CONVERT_DPR2MSPINT. Here you have to convert each and every Resource assigned to a Role as individual resource in MS Project. You have to use method CUST_CONVERT_MSPINT2DPR to convert it back in Project's format.
    e.g. 1) Downloading Project to MSP --> Role 1 has Resource 1 and Resource 2 then in first method you need to Create entry for Resource 1 and Resource 2 and keep track of to which role these are staffed. But this will create individual entries for each resource and will not add the resources name to Project role. Other possible implementation would be that you can maintain the Employee number of each Resource in some Text field which is not used in Field Mapping and accordingly decode these Emplyee numbers while uploading the Project from Ms project.
    2) Uploading Project from MSP --> Use second method CUST_CONVERT_MSPINT2DPR to decode the above implementation to fill the Project structure for Role and Resources.
    You may check it if it is possible to implement it in that way.
    As a standard, as metioned earlier, it is not possible.
    Thanks and Regards,
    Piyusha

  • Applescript: Packaging and exporting PDFs for multiple files -- need some tweaks

    I found and tweaked a droplet script that isn't quite working right. I am hoping for some help with getting it to work the way I want. I tried and failed to learn to do this myself. Your help is greatly appreciated!
    Here's an example: I drag two files called "filename.indd" and "filename2.indd" onto the droplet. The script I have right now will output the packages and PDFs into the following folder structure:
    export folder
         filename folder
              filename.pdf
              filename folder
                   filename.indd
                   [Package contents]
         filename2 folder
              filename2.pdf
              filename2 folder
                   filename2.indd
                   [Package contents]
    Here's the folder structure I need (using a dialog box or script that intelligently knows that the directory to save in is the same as the files I dragged on to the droplet would be amazing):
    dialog box to choose new directory set to baseFolder
    or
    baseFolder <---- set to the current directory of the files I dragged onto the droplet
         filename folder
              filename.indd
              [Package contents]
              PDF folder             <--------new folder "PDF" created
                   filename.pdf
         filename2 folder
              filename2.indd
              [Package contents]
              PDF folder             <--------new folder "PDF" created
                   filename2.pdf
    Here's a script I found and modified:
    property baseFolder : (path to desktop as text) & "exports:"
    on open mgItems
              repeat with mgThisItem in mgItems
                        tell application id "com.adobe.InDesign"
                                  try
      open mgThisItem
                                            set mgDocName to name of active document
                                            set text item delimiters of AppleScript to ".indd"
                                            set mgShortName to text item 1 of mgDocName
                                            set targetFolderPath to my createFolder(mgShortName)
                                            set text item delimiters of AppleScript to ""
                                            set mgPackageFilePath to targetFolderPath & mgShortName as string
                                            set mgProofFilePath to mgPackageFilePath & ".pdf" as string
                                            set properties of PDF export preferences to properties of PDF export preset "[Smallest File Size]"
                                            tell the active document to export format PDF type to mgProofFilePath without showing options
                                            tell the active document to package to mgPackageFilePath with copying fonts, ignore preflight errors, copying profiles, updating graphics, including hidden layers, copying linked graphics and creating report
      close active document saving no
                                  on error e
      display dialog e
                                  end try
                        end tell
              end repeat
              display dialog "PDFs created and InDesign file packaged"
    end open
    on createFolder(nameString)
              set macFolderPath to baseFolder & nameString
              do shell script "mkdir -p " & quoted form of POSIX path of macFolderPath
              return macFolderPath & ":"
    end createFolder
    Thanks very much!

    ...anyone? :\

  • Creation of developement class,package and access key

    COULD ANYBODY EXPLAIN about
    creation of developement class,package and access key
    and who will create them?

    Working With Development Objects
    Any component of an application program that is stored as a separate unit in the R/3 Repository is called a development object or a Repository Object. In the SAP System, all development objects that logically belong together are assigned to the same development class.
    Object Lists
    In the Object Navigator, development objects are displayed in object lists, which contain all of the elements in a development class, a program, global class, or function group.
    Object lists show not only a hierarchical overview of the development objects in a category, but also tell you how the objects are related to each other. The Object Navigator displays object lists as a tree.
    The topmost node of an object list is the development class. From here, you can navigate right down to the lowest hierarchical level of objects. If you select an object from the tree structure that itself describes an object list, the system displays just the new object list.
    For example:
    Selecting an Object List in the Object Navigator
    To select development objects, you use a selection list in the Object Navigator. This contains the following categories:
    Category
    Meaning
    Application hierarchy
    A list of all of the development classes in the SAP System. This list is arranged hierarchically by application components, component codes, and the development classes belonging to them
    Development class
    A list of all of the objects in the development class
    Program
    A list of all of the components in an ABAP program
    Function group
    A list of all of the function modules and their components that are defined within a function group
    Class
    A list of all of the components of a global class. It also lists the superclasses of the class, and all of the inherited and redefined methods of the current class.
    Internet service
    A list of all of the componentse of an Internet service:
    Service description, themes, language resources, HTML templates and MIME objects.
    When you choose an Internet service from the tree display, the Web Application Builder is started.
    See also Integrating Internet Services.
    Local objects
    A list of all of the local private objects of a user.
    Objects in this list belong to development class $TMP and are not transported. You can display both your own local private objects and those of other users. Local objects are used mostly for testing. If you want to transport a local object, you must assign it to another development class. For further information, refer to Changing Development Classes
    http://help.sap.com/saphelp_46c/helpdata/en/d1/80194b454211d189710000e8322d00/content.htm
    Creating the Main Package
    Use
    The main package is primarily a container for development objects that belong together, in that they share the same system, transport layer, and customer delivery status. However, you must store development objects in sub-packages, not in the main package itself.
    Several main packages can be grouped together to form a structure package.
    Prerequisites
    You have the authorization for the activity L0 (All Functions) using the S_DEVELOP authorization object.
    Procedure
    You create each normal package in a similar procedure to the one described below. It can then be included as a sub-package in a main package.
    To create a main package:
    1.       Open the Package Builder initial screen (SE21 or SPACKAGE).
    2.       In the Package field, enter a name for the package that complies with the tool’s Naming Conventions
    Within SAP itself, the name must begin with a letter from A to S, or from U to X.
    3.       Choose Create.
    The system displays the Create Package dialog box.
    4.       Enter the following package attributes:
    Short Text
    Application Component
    From the component hierarchy of the SAP system, choose the abbreviation for the application component to which you want to assign the new package.
    Software component
    Select an entry. The software component describes a set of development objects that can only be delivered in a single unit. You should assign all the sub-packages of the main package to this software component.
    Exception: Sub-packages that will not be delivered to customers must be assigned to the HOMEsoftware component.
    Main Package
    This checkbox appears only if you have the appropriate authorization (see Prerequisites).
    To indicate that the package is a main package, check this box.
    5.       Choose  Save.
    6.       In the dialog box that appears, assign a transport request.
    Result
    The Change package screen displays the attributes of the new package. To display the object list for the package in the Object Navigator as well, choose  from the button bar.
    You have created your main package and can now define a structure within it. Generally, you will continue by adding sub-packages to the main package. They themselves will contain the package elements you have assigned.
    See also
    Adding Sub-Packages to the Main Package
    http://help.sap.com/saphelp_nw04/helpdata/en/ea/c05d8cf01011d3964000a0c94260a5/content.htm
    access key used for change standard program.
    www.sap.service.com

  • Multiple Accounts on Multiple resources through ActiveSync

    Hi,
    I am trying to create multiple accounts on multiple resource through activesync. But i am able 2 create on a single resource... below is the code
    <Field name='NDSFilter'>
    <Disable>
    <isFalse>
    <contains>
    <ref>accountInfo.assigned</ref>
    <s>Dev-NDS</s>
    </contains>
    </isFalse>
    </Disable>
    <Field name='newAccountRequest'>
    <Expansion>
    <block trace='true'>
    <s>Dev-NDS</s>
    </block>
    </Expansion>
    </Field>
    <Field name='global.NdsUname'>
    <Expansion>
    <block>
    <s>NdsFour</s>
    </block>
    </Expansion>
    </Field>
    <Field name='global.NDSOU'>
    <Expansion>
    <block>
    <s>ADK</s>
    </block>
    </Expansion>
    </Field>
    <Field name='accounts[Dev-NDS].waveset.generate'>
    <Default>
    <s>true</s>
    </Default>
    </Field>
    </Field>
    <Field name='DSFilter'>
    <Disable>
    <isFalse>
    <contains>
    <ref>accountInfo.assigned</ref>
    <s>UOS-AssociatesLDAP</s>
    </contains>
    </isFalse>
    </Disable>
    <Field name='newAccountRequest'>
    <Expansion>
    <block trace='true'>
    <s>UOS-AssociatesLDAP</s>
    </block>
    </Expansion>
    </Field>
    <Field name='accounts[UOS-AssociatesLDAP].accountId'>
    <Expansion>
    <block trace='true'>
    <s>AccountTwo</s>
    </block>
    </Expansion>
    </Field>
    <Field name='global.OU'>
    <Expansion>
    <block trace='true'>
    <s>UOS-MultiAccounts</s>
    </block>
    </Expansion>
    </Field>
    <Field name='accounts[UOS-AssociatesLDAP].waveset.generate'>
    <Default>
    <s>true</s>
    </Default>
    </Field>
    </Field>
    Can anyone pls suggest me the solution...
    Thanks in advance
    Kiran

    Thanks for the reply... in my case this would be done by the active synch process so no GUI form is required. I will be getting a list of application ID for the user by LDAP AS. One i get it i will have to parse it and get the list of application user id. I am passing those ID;s to a workflow where I am forming the resource name as you mentioned
    for example:
    If i get user1#user2#user3 from AS i am separating them based on # using split and getting 3 different user id;s
    now i am forming a string with the resource name and passing it to the sub process in which i am checking out the user object, setting the user attributes and checking in the new view.
    user1#LDAP
    user2#LDAP|1
    user3#LDAP|2
    Problem ; When i run this user1 is getting created in LDAP but user2 and user3 are not. There entry is getting created in IDM.
    When I open the IDM object I get a yellow triangle (warning) and if I open the user object and hit save button IDM creates the user account on the LDAP.
    any help for further solving this problem would be appreciated.
    Regards,

  • Displaying the list of resources

    Hi guys,
    I need to display the resources assigned to the each user, in the form. i have the list of user objects and i am doing iteration using fieldloop. is there any function to get the list of resources assigned to the user.
    i am trying with user.getAssignedResources( ) metho. But its giving me the following xpress exception
    XPRESS exception:
    Can't call method getAssignedResourceList on class com.waveset.object.WSUser ==> com.waveset.util.WavesetException: Cannot resolve resources without a cache

    The getAssignedResourceList method works for me.... not sure what causes the cache exception mentioned above
    Message was edited by:
    chits98

  • Difference between iteratior and List Iterator

    Difference between iteratior and List Iterator

    Ravikumar:
    You have already posted something quite similar to this posting here: http://forum.java.sun.com/thread.jspa?threadID=735377
    While I cannot speak for everyone else here, I personally find your approach rather rude and inconsiderate. The manner in which you are posting these questions implies that you not only do not recognize that there is work involved in answering them but that you do not sufficiently understand them in such a manner as to be able to phrase them coherently.
    I expect that you are attempting to do your homework by exploiting the helpful people on this forum rather than by learning the material in question. If I am mistaken as to your intentions, please inform me and I will apologize to you. However, I find it difficult to believe that anyone would have such poor forum etiquette as not to realize that posting a "question" in the form of a topic statement is impolite.
    There are many fine people here who will assist you in learning and applying Java; I have relied upon their assistance on multiple occasions and found it indispensible. But you are far more likely to receive a helpful response (at least from me) if you take the time to express your questions more fully and (especially) to learn the material.
    Cheers and happy learning.

  • I have ripped all of my Cds into iTune, now I cannot find where some of the artists have been filled, not all the artists are listed, yet others are listed multiple times as they play with other groups. How do I list all one artist under his name? I know

    Sorry this will appear pretty basic stuff.  I have ripped all my Cds into iTunes, but in starting to make playlists it is apparent that some artists are listed multiple times as they appear with different bands, and others do not appear at all.  I have tried searching different categories, compilations etc, and Finder box does not bring them up.
    My questions are:-
    Do I need additional software to manipulate my tunes in iTunes?
    If so what is suggested?
    or if not:-
    How can I re arrange the tunes so that they appear only under one artist?
    How do I make my "lost" artists tunes appear?
    Thanks for any advice.

    I am not really following what the problem is here.  Artists are listed in the Artist field.  I guess you could stick individual artists in a band in a field such as comments, but then you would have to include searching the comments field in your search.  In which fields are these names located?
    How are you making these playlists? Are these smart playlists or are you just dragging tracks to a playlist?
    Are you doing this search with Finder's find or with iTunes' search?
    If I knew exactly what it was you were trying to do I could tell you if you need addditional software.  In reality though there isn't "additional software" for iTunes.  There's Applescript plugins but I don't see how the ones with which I am familiar would have anything to do with searching for artist names.
    How can I re arrange the tunes so that they appear only under one artist?
    Steve MacGuire aka turingtest2 - iTunes & iPod Hints & Tips - Grouping Tracks Into Albums - http://www.samsoft.org.uk/iTunes/grouping.asp (older post on Apple Discussions http://discussions.apple.com/message.jspa?messageID=9910895)
    Quick answer:  Select all the tracks on the album, File > get info, and either give them all a single "album artist", or check the "compilation" flag (as in https://discussions.apple.com/message/17670085).
    If these are from multiple-CD sets you may also need to enter the appropriate information in the disc number fields.

  • After getting a new desktop I downloaded iTunes and authorized my new computer and then de-authorized my old one,  When I try to update my 5S it says my phone is not authorized and list my wifes email address as the account holder and not mine.  How

    After getting a new desktop I downloaded iTunes and authorized my new computer and then de-authorized my old one,  When I try to update my 5S it says my phone is not authorized and list my wifes email address as the account holder and not mine.  How do I correct this. I am using Windows 8.1 .  My wife has never had an iTuunes account

    Hello Lakesidetom,
    It sounds as though you are experiencing an issue with an Apple ID and authorizations. Based on your post, it sounds like you are familiar with the authorizing and deauthorizing process. The Apple ID in question (your wife's email) may be originating from the iPhone you are attempting to update. Is it possible that your wife created an Apple ID or iCloud account which is signed in on that iPhone? Below, I have included links to some resources that may help you determine if your wife has created an Apple ID:
    How to find your Apple ID - Apple Support
    Use these steps if you forgot your Apple ID or aren't sure that you have one.
    Apple - My Apple ID
    If you can't remember your Apple ID, just provide us with some information and we'll find it for you. Then we'll help you reset your password.
    Thank you for contributing to Apple Support Communities.
    Cheers,
    Bobby_D

  • Content type, list definition and List instance - query

    Dear all,
    I created a list content type, list definition and list instance for a SessionsList.
    I did mistake when created a event receiver file where field name is RegistrationsInfo - did typo error as RegistrationInfo. This field I want to make it as false in the ShowInNewForm= false
    When I deploy it with event receiver file - I am getting stack trace error stating that the RegistrationsInfo field is missing.
    Without event receiver file - when I deploy the solution and checked the field name - it is showing rightly as RegistrationsInfo.
    Content Type:-
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Field ID="{7113CBE5-57E9-4082-A0A2-492B35B69C8D}" Type="Lookup" List="Lists/Courses-List" ShowField="Title" Name="CourseTitle" DisplayName="Courses - Title" Required="FALSE" Group="Training Site Columns"/>
    <Field ID="{920AE6A7-2AAE-4E43-8855-7CBD9978EC5E}" Type="Lookup" List="Lists/SessionTrainer" ShowField="FullName" Name="Trainer" DisplayName="Trainer" Required="FALSE" Group="Training Site Columns"/>
    <Field ID="{F73D9A96-3C86-4E33-96D5-31E30B08BF40}" Type="Choice" Name="TrainingVenue" DisplayName="Training Venue" Required="FALSE" Group="Training Site Columns">
    <CHOICES>
    <CHOICE>Kerala Meeting Room</CHOICE>
    <CHOICE>Orissa Meeting Room</CHOICE>
    <CHOICE>Bihar Meeting Room</CHOICE>
    </CHOICES>
    </Field>
    <Field ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}" Type="Number" Decimals="0" Min="0" Name="RegistrationsInfo" DisplayName="Registrations Info" Required="FALSE" Group="Training Site Columns"/>
    <Field ID="{03281B47-F1D1-477E-9793-3A19118720EE}" Type="Number" Decimals="0" Min="0" Name="TotalSeatsInfo" DisplayName="Total Seats Info" Required="FALSE" Group="Training Site Columns"/>
    <Field ID="{8A900663-6351-445B-ACB3-394F44D45C8D}" Type="Calculated" ResultType="Number" ReadOnly="TRUE" Name="OpenSeatsInfo" DisplayName="Open Seats Info" Required="FALSE" Group="Training Site Columns">
    <Formula>=TotalSeatsInfo-RegistrationsInfo</Formula>
    <FieldRefs>
    <FieldRef Name="TotalSeatsInfo" ID="{03281B47-F1D1-477E-9793-3A19118720EE}"/>
    <FieldRef Name="RegistrationsInfo" ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}"/>
    </FieldRefs>
    </Field>
    <!-- Parent ContentType: Item (0x01) -->
    <ContentType ID="0x0100a9dc01b7e78b45799fe59153d97e2b9e"
    Name="SessionList"
    Group="Session Content Types"
    Description="Session Content Type"
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="{7113CBE5-57E9-4082-A0A2-492B35B69C8D}" Name="CourseTitle" DisplayName="Courses - Title" Required="TRUE"/>
    <FieldRef ID="{920AE6A7-2AAE-4E43-8855-7CBD9978EC5E}" Name="Trainer" DisplayName="Trainer" Required="FALSE" />
    <FieldRef ID="{F73D9A96-3C86-4E33-96D5-31E30B08BF40}" Name="TrainingVenue" DisplayName="Training Venue" Required="FALSE"/>
    <FieldRef ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}" Name="RegistrationsInfo" DisplayName="Registrations Info" Required="FALSE"/>
    <FieldRef ID="{03281B47-F1D1-477E-9793-3A19118720EE}" Name="TotalSeatsInfo" DisplayName="Total Seats Info" Required="FALSE"/>
    <FieldRef ID="{8A900663-6351-445B-ACB3-394F44D45C8D}" Name="OpenSeatsInfo" DisplayName="Open Seats Info" Required="FALSE"/>
    </FieldRefs>
    </ContentType>
    </Elements>
    Schema:-
    <?xml version="1.0" encoding="utf-8"?>
    <List xmlns:ows="Microsoft SharePoint" Title="SessionList" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/SessionList-LD-SessionList" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
    <MetaData>
    <ContentTypes>
    <ContentType ID="0x0100a9dc01b7e78b45799fe59153d97e2b9e" Name="SessionList" Group="Session Content Types" Description="Session Content Type" Inherits="TRUE" Version="0">
    <FieldRefs>
    <FieldRef ID="{7113CBE5-57E9-4082-A0A2-492B35B69C8D}" Name="CourseTitle" DisplayName="Courses - Title" Required="TRUE" />
    <FieldRef ID="{920AE6A7-2AAE-4E43-8855-7CBD9978EC5E}" Name="Trainer" DisplayName="Trainer" Required="FALSE" />
    <FieldRef ID="{F73D9A96-3C86-4E33-96D5-31E30B08BF40}" Name="TrainingVenue" DisplayName="Training Venue" Required="FALSE" />
    <FieldRef ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}" Name="RegistrationsInfo" DisplayName="Registrations Info" Required="FALSE" />
    <FieldRef ID="{03281B47-F1D1-477E-9793-3A19118720EE}" Name="TotalSeatsInfo" DisplayName="Total Seats Info" Required="FALSE" />
    <FieldRef ID="{8A900663-6351-445B-ACB3-394F44D45C8D}" Name="OpenSeatsInfo" DisplayName="Open Seats Info" Required="FALSE" />
    </FieldRefs>
    </ContentType>
    </ContentTypes>
    <Fields>
    <Field ID="{7113cbe5-57e9-4082-a0a2-492b35b69c8d}" Type="Lookup" List="Lists/Courses-List" ShowField="Title" Name="CourseTitle" DisplayName="Courses - Title" Required="FALSE" Group="Training Site Columns" />
    <Field ID="{920ae6a7-2aae-4e43-8855-7cbd9978ec5e}" Type="Lookup" List="Lists/SessionTrainer" ShowField="FullName" Name="Trainer" DisplayName="Trainer" Required="FALSE" Group="Training Site Columns" />
    <Field ID="{f73d9a96-3c86-4e33-96d5-31e30b08bf40}" Type="Choice" Name="TrainingVenue" DisplayName="Training Venue" Required="FALSE" Group="Training Site Columns">
    <CHOICES>
    <CHOICE>Kerala Meeting Room</CHOICE>
    <CHOICE>Orissa Meeting Room</CHOICE>
    <CHOICE>Bihar Meeting Room</CHOICE>
    </CHOICES>
    </Field>
    <Field ID="{b6e9c8f5-f1bd-4d98-bd30-194504859acc}" Type="Number" Decimals="0" Min="0" Name="RegistrationsInfo" DisplayName="Registrations Info" Required="FALSE" Group="Training Site Columns" />
    <Field ID="{03281b47-f1d1-477e-9793-3a19118720ee}" Type="Number" Decimals="0" Min="0" Name="TotalSeatsInfo" DisplayName="Total Seats Info" Required="FALSE" Group="Training Site Columns" />
    <Field ID="{8a900663-6351-445b-acb3-394f44d45c8d}" Type="Calculated" ResultType="Number" ReadOnly="TRUE" Name="OpenSeatsInfo" DisplayName="Open Seats Info" Required="FALSE" Group="Training Site Columns">
    <Formula>=TotalSeatsInfo-RegistrationsInfo</Formula>
    <FieldRefs>
    <FieldRef Name="TotalSeatsInfo" ID="{03281B47-F1D1-477E-9793-3A19118720EE}" />
    <FieldRef Name="RegistrationsInfo" ID="{B6E9C8F5-F1BD-4D98-BD30-194504859ACC}" />
    </FieldRefs>
    </Field>
    </Fields>
    <Views>
    <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
    <FieldRef Name="LinkTitleNoMenu">
    </FieldRef>
    <FieldRef Name="CourseTitle"></FieldRef>
    <FieldRef Name="Trainer"></FieldRef>
    <FieldRef Name="TrainingVenue"></FieldRef>
    <FieldRef Name="RegistrationsInfo"></FieldRef>
    <FieldRef Name="TotalSeatsInfo"></FieldRef>
    <FieldRef Name="OpenSeatsInfo"></FieldRef>
    </ViewFields>
    <Query>
    <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE">
    </FieldRef>
    </OrderBy>
    </Query>
    <ParameterBindings>
    <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
    </ParameterBindings>
    </View>
    <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
    <FieldRef Name="Attachments">
    </FieldRef>
    <FieldRef Name="LinkTitle">
    </FieldRef>
    <FieldRef Name="CourseTitle"></FieldRef>
    <FieldRef Name="Trainer"></FieldRef>
    <FieldRef Name="TrainingVenue"></FieldRef>
    <FieldRef Name="RegistrationsInfo"></FieldRef>
    <FieldRef Name="TotalSeatsInfo"></FieldRef>
    <FieldRef Name="OpenSeatsInfo"></FieldRef>
    </ViewFields>
    <Query>
    <OrderBy>
    <FieldRef Name="ID">
    </FieldRef>
    </OrderBy>
    </Query>
    <ParameterBindings>
    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
    </View>
    </Views>
    <Forms>
    <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    </Forms>
    </MetaData>
    </List>
    Event Receiver file:-
    public override void FeatureActivated(SPFeatureReceiverProperties properties)
    //Reference the newly created session list and perform the following
    //1. Set the display name of the "Title" column to "SessID" and hide it from the New and Edit Forms
    //2. Make the "SessID" column not required
    //3. Set the default value of the RegistrationsInfo column to 0 and do not display it on the new form
    //4. Add the built-in "Start Date" and "End Date" columns
    //Reference the newly created session list
    SPWeb currentWeb = properties.Feature.Parent as SPWeb;
    //currentWeb.AllowUnsafeUpdates = true;
    SPList sessionList = currentWeb.Lists["SessionList"];
    //Title column update
    SPField titleField = sessionList.Fields["Title"];
    titleField.Required = false;
    titleField.ShowInNewForm = false;
    titleField.ShowInEditForm = false;
    titleField.Title = "SessID";
    titleField.Update();
    //RegistrationsInfo column updates
    SPField registrationField = sessionList.Fields["RegistrationsInfo"];
    registrationField.DefaultValue = "0";
    registrationField.ShowInNewForm = false;
    registrationField.Update();
    //Add the Start Date and End Date columns to the list, ensure they both display Date and Time, and add them to the default view of the list
    SPFieldDateTime startDate = currentWeb.Fields["Starting_Date"] as SPFieldDateTime;
    startDate.DisplayFormat = SPDateTimeFieldFormatType.DateTime;
    SPFieldDateTime endDate = currentWeb.Fields["Ending_Date"] as SPFieldDateTime;
    endDate.DisplayFormat = SPDateTimeFieldFormatType.DateTime;
    sessionList.Fields.Add(startDate);
    sessionList.Fields.Add(endDate);
    SPView defaultView = sessionList.DefaultView;
    defaultView.ViewFields.Add(startDate);
    defaultView.ViewFields.Add(endDate);
    defaultView.Update();
    sessionList.Update();
    //currentWeb.AllowUnsafeUpdates = false;
    Can somebody help me - how to overcome the RegistrationsInfo missing field - error(in the stack trace) when activating the feature in the training site?
    Thanks
    Sathya

    Hi Sathya,
    Seems the field “RegistrationsInfo” is not been found when deploying with Event Receiver, a possible reason is that it might be damaged.
    As a workaround, I suggest you retract the solution from your farm, make sure the “RegistrationsInfo” field is deleted using PowerShell, then create another project with the same
    content and perform the deployment again.
    About how to delete a field using PowerShell for your reference:
    https://peterheibrink.wordpress.com/2011/12/09/powershell-delete-field-and-all-references/
    http://www.sharepointfix.com/2011/04/powershell-script-to-delete-site.html
    Feel free to reply if there any progress.
    Thanks
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • USEREXIT_CHECK_XVBEP_FOR_DELET USING US_EXIT

    Can anyone tell me under what conditions this user exit in MV45AFZB gets hit?  I would expect it to get hit when a line is being deleted from VBEP, but it does not seem to be hitting it. My requirement is to find a place to update a user field in vba

  • Hook up to HDTV

    I have a black MacBook (I got it right before they stopped selling the black ones).  So I bought a Mini-DVI to HDMI and the proper cables to hook up the HDMI end to the HDMI on my Panasonic 32" but nothing is happening.  I have tried turning off both

  • I need a replacement key for left shift, DV4 2106tx.

    This model is new and i can't find a spare key for the left shift key , the retainer broke and i can't do anything about it right now except asking for help, please tell me where and how can i get the spare key with retainers (i am also ready to buy

  • Beta Camera Profiles installation problem

    I downloaded Camera Raw 4.5 Plug in, which is needed for the beta Camera Profiles installation. CR 4.5 is definitely in the right place and working fine. According to Adobe FAQ, beta Camera Profiles belong in the Adobe folder in Camera Raw. I copy he

  • **help on login servlet

    the following are my source code. but i cant show the msg whether the person has login successful or not. i am using j2ee to run my eg. LoginServlet.java import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class LoginServlet