Example #1
0
 public ProjectFromLiftFolderCreator(string path, ViewTemplate viewTemplate, IWritingSystemRepository writingSystems)
 {
     _path           = path;
     _viewTemplate   = viewTemplate;
     _writingSystems = writingSystems;
 }
Example #2
0
        public static ViewTemplate MakeMasterTemplate(IWritingSystemRepository writingSystems)
        {
            var defaultVernacularSet = new List <string> {
                WeSayWordsProject.VernacularWritingSystemIdForProjectCreation
            };

            var defaultAnalysisSet = new List <string> {
                WeSayWordsProject.AnalysisWritingSystemIdForProjectCreation
            };

            ViewTemplate masterTemplate = new ViewTemplate();

            Field lexicalFormField = new Field(Field.FieldNames.EntryLexicalForm.ToString(),
                                               "LexEntry",
                                               defaultVernacularSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Word",
                              "The label for the field showing the Lexeme Form of the entry.");
            lexicalFormField.DisplayName = "Word";
            lexicalFormField.Description = "The Lexeme Form of the entry.";
            lexicalFormField.Enabled     = true;
            lexicalFormField.Visibility  = CommonEnumerations.VisibilitySetting.Visible;
            masterTemplate.Add(lexicalFormField);

            Field citationFormField = new Field(LexEntry.WellKnownProperties.Citation,
                                                "LexEntry",
                                                defaultVernacularSet);

            StringCatalog.Get("~Citation Form",
                              "The label for the field holding the citation form, which is how the word will be displayed in the dictionary.  This is used in languages where the lexeme form may be different from what the Headword should be.");
            citationFormField.DisplayName = "Citation Form";
            citationFormField.Description =
                "A form which overrides the Lexeme Form to be the Headword in the printed dictionary";
            citationFormField.Visibility = CommonEnumerations.VisibilitySetting.NormallyHidden;
            citationFormField.Enabled    = false;
            masterTemplate.Add(citationFormField);

            Field definitionField = new Field(LexSense.WellKnownProperties.Definition,
                                              "LexSense",
                                              defaultAnalysisSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Definition",
                              "The label for the field showing the definition of the word.");
            definitionField.DisplayName = "Definition (Meaning)";
            definitionField.Description =
                "The definition of this sense of the word, in one or more languages. Shows up next to the Meaning label.";
            definitionField.Visibility             = CommonEnumerations.VisibilitySetting.Visible;
            definitionField.Enabled                = true;
            definitionField.IsSpellCheckingEnabled = true;
            masterTemplate.Add(definitionField);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Gloss",
                              "The label for the field showing a single word translation, as used in interlinear text glossing.");
            Field glossField = new Field(LexSense.WellKnownProperties.Gloss,
                                         "LexSense",
                                         defaultAnalysisSet);

            glossField.DisplayName            = "Gloss";
            glossField.Description            = "Normally a single word, used when interlinearizing texts.";
            glossField.Visibility             = CommonEnumerations.VisibilitySetting.NormallyHidden;
            glossField.Enabled                = false;
            glossField.IsSpellCheckingEnabled = true;
            masterTemplate.Add(glossField);

            Field silCawlField = new Field("SILCAWL",
                                           "LexSense", new string[] { "en" });

            silCawlField.DisplayName            = "SIL CAWL #";
            silCawlField.Description            = "The SIL CAWL wordlist # for this entry, (see the SIL CAWL wordlist task).";
            silCawlField.Visibility             = CommonEnumerations.VisibilitySetting.NormallyHidden;
            silCawlField.Enabled                = false;
            silCawlField.IsSpellCheckingEnabled = false;
            masterTemplate.Add(silCawlField);

            Field literalMeaningField = new Field("literal-meaning", "LexEntry", defaultAnalysisSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Literal Meaning",
                              "The label for the field showing the literal meaning of idiom or proverb.");
            literalMeaningField.DisplayName            = "Literal Meaning";
            literalMeaningField.Description            = "Literal meaning of an idiom.";
            literalMeaningField.Visibility             = CommonEnumerations.VisibilitySetting.NormallyHidden;
            literalMeaningField.Enabled                = false;
            literalMeaningField.IsSpellCheckingEnabled = true;
            masterTemplate.Add(literalMeaningField);

            Field noteField = new Field(PalasoDataObject.WellKnownProperties.Note,
                                        "PalasoDataObject",
                                        defaultAnalysisSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Note", "The label for the field showing a note.");
            noteField.DisplayName = "Note";
            // noteField.ConfigurationName = "Note";
            noteField.Description            = "A note.";
            noteField.Visibility             = CommonEnumerations.VisibilitySetting.NormallyHidden;
            noteField.Enabled                = true;
            noteField.IsSpellCheckingEnabled = true;
            noteField.IsMultiParagraph       = true;

            masterTemplate.Add(noteField);

            //            Field entryNoteField = new Field(LexEntry.WellKnownProperties.Note, "LexEntry", defaultAnalysisSet);
            //            //this is here so the PoMaker scanner can pick up a comment about this label
            //            StringCatalog.Get("~Note", "The label for the field showing a note.");
            //            entryNoteField.DisplayName = "Note";
            //            entryNoteField.ConfigurationName = "Note on Entry";
            //            entryNoteField.Description = "A note on the entry.";
            //            entryNoteField.Visibility = CommonEnumerations.VisibilitySetting.NormallyHidden;
            //            entryNoteField.Enabled = false;
            //            masterTemplate.Add(entryNoteField);

            //            Field senseNoteField = new Field(LexSense.WellKnownProperties.Note, "LexSense", defaultAnalysisSet);
            //            //this is here so the PoMaker scanner can pick up a comment about this label
            //            senseNoteField.DisplayName = "Note";
            //            senseNoteField.ConfigurationName = "Note on Sense";
            //            senseNoteField.Description = "A note on the sense.";
            //            senseNoteField.Visibility = CommonEnumerations.VisibilitySetting.NormallyHidden;
            //            senseNoteField.Enabled = false;
            //            masterTemplate.Add(senseNoteField);

            Field pictureField = new Field("Picture", "LexSense", defaultAnalysisSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Picture", "The label for the field showing a picture.");
            pictureField.DisplayName  = "Picture";
            pictureField.Description  = "An image corresponding to the sense.  This field will automatically search SIL's image library, 'The Art of Reading', if it has been installed on your computer.";
            pictureField.DataTypeName = "Picture";
            pictureField.Visibility   = CommonEnumerations.VisibilitySetting.NormallyHidden;
            pictureField.Enabled      = true;
            masterTemplate.Add(pictureField);

            Field posField = new Field(LexSense.WellKnownProperties.PartOfSpeech,
                                       "LexSense",
                                       defaultAnalysisSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~POS", "The label for the field showing Part Of Speech");
            StringCatalog.Get("~PartOfSpeech", "The label for the field showing Part Of Speech");
            posField.DisplayName     = "PartOfSpeech";
            posField.Description     = "The grammatical category of the entry (Noun, Verb, etc.).";
            posField.DataTypeName    = "Option";
            posField.OptionsListFile = "PartsOfSpeech.xml";
            posField.Enabled         = true;
            masterTemplate.Add(posField);

            Field exampleField = new Field(LexExampleSentence.WellKnownProperties.ExampleSentence,
                                           "LexExampleSentence",
                                           defaultVernacularSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Example Sentence",
                              "The label for the field showing an example use of the word.");
            exampleField.DisplayName            = "Example Sentence";
            exampleField.Visibility             = CommonEnumerations.VisibilitySetting.Visible;
            exampleField.Enabled                = true;
            exampleField.IsSpellCheckingEnabled = true;
            masterTemplate.Add(exampleField);

            Field translationField = new Field(LexExampleSentence.WellKnownProperties.Translation,
                                               "LexExampleSentence",
                                               defaultAnalysisSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Example Translation",
                              "The label for the field showing the example sentence translated into other languages.");
            translationField.DisplayName = "Example Translation";
            translationField.Description =
                "The translation of the example sentence into another language.";
            translationField.Visibility             = CommonEnumerations.VisibilitySetting.Visible;
            translationField.Enabled                = false;
            translationField.IsSpellCheckingEnabled = true;
            masterTemplate.Add(translationField);

            Field ddp4Field = new Field(LexSense.WellKnownProperties.SemanticDomainDdp4, "LexSense", defaultAnalysisSet);

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Sem Dom", "The label for the field showing Semantic Domains");

            ddp4Field.DisplayName = "Sem Dom";
            ddp4Field.Description =
                "The semantic domains of the sense, using Ron Moe's Dictionary Development Process version 4.\r\n. You can enter these directly by typing the number of the domain, its name, or a word used in the description. You can also use the Gather By Semantic Domains Task, which will try to use the input system chosen by this field.";
            ddp4Field.DataTypeName    = "OptionCollection";
            ddp4Field.OptionsListFile = "SemDom.xml";
            ddp4Field.Enabled         = true;
            ddp4Field.Visibility      = CommonEnumerations.VisibilitySetting.NormallyHidden;
            masterTemplate.Add(ddp4Field);

            Field baseFormField = new Field(LexEntry.WellKnownProperties.BaseForm,
                                            "LexEntry",
                                            defaultVernacularSet,
                                            Field.MultiplicityType.ZeroOr1,
                                            "RelationToOneEntry");

            //this is here so the PoMaker scanner can pick up a comment about this label
            StringCatalog.Get("~Base Form",
                              "The label for the field showing the entry which this entry is derived from, is a subentry of, etc.");
            baseFormField.DisplayName = "Base Form";
            baseFormField.Description =
                "Provides a field for identifying the form from which an entry is derived.  You may use this in place of the MDF subentry.  In a future version WeSay may support directly listing derived forms from the base form.";
            baseFormField.Visibility = CommonEnumerations.VisibilitySetting.NormallyHidden;
            baseFormField.Enabled    = false;
            masterTemplate.Add(baseFormField);

            Field crossRefField = new Field(LexEntry.WellKnownProperties.CrossReference,
                                            "LexEntry",
                                            defaultVernacularSet,
                                            Field.MultiplicityType.ZeroOrMore,
                                            "RelationToOneEntry");

            StringCatalog.Get("~Cross Reference",
                              @"The label for the field showing a 'confer' relation (\cf in MDF).");
            crossRefField.DisplayName = "Cross Reference";
            crossRefField.Description =
                "Provides a single cross reference at this time (we need to do more work to allow it to hold multiple references... let us know if this is a priority for you.)";
            crossRefField.Visibility = CommonEnumerations.VisibilitySetting.NormallyHidden;
            crossRefField.Enabled    = false;
            masterTemplate.Add(crossRefField);

            return(masterTemplate);
        }
 public PublicationFontStyleProvider(ViewTemplate template)
 {
     _template = template;
 }