- DO NOT BORK MY REPO
+ Press the *Use this template* button
All of this is subject to change as development continues but the idea was to create something simple that just works
This is not an all-encompassing tool, made to do everything for you. This is just a collection of tasks to remove the drudgery of making Veeva presentations. That's all it's meant to do.
If there's something I need to do more than once, and it's a faff to do, I'll probably extend this to automate that. Like renaming a Key Message: Once or twice is fine, but twice, across four presentations? For all these files?! Uff... That needs a tool.
This will create the project structure based on using Shared Resources rather than resources per Key Message, and using a pre-defined HTML/LESS/JS template structure.
Generate a .csv file and ZIPs compatible with Vault MC Loader
As long as all your LESS files are in
shared
>less
and areimported
intodefault.less
and your JS files are inshared
>js
they will be packaged correctly.Switches off the
anims.less
file if the user is presenting via Engage
It does not screen grab your thumbnail/poster images for you.
It will not make your bed either.
- Run
npm install
- Run
gulp setup
- Fill out
config.json
- Then start creating your pages:
- Run
gulp keymessage --new "Key Message Name"
for each Key Message - First time this is run it will also create CLM Presentation and Shared resources
- Run
To change the page order in Vault you can rearrange the order of the pages in ./keymessages.json
- You can add links to slides in other Veeva presentations:
- Run
gulp link --km "key-message-name.zip" --method "nameOfMethod" --id "123-presentation-ID"
- Run
- Create poster and thumbnail images:
- Drop your screen grabs into each Key Message folder in
./source/previews
and rungulp previews
(this will work for png or jpg and the screen grab filename is irrelevant)
- Drop your screen grabs into each Key Message folder in
- Rename existing Key Message:
- Run
gulp rename --from "Old name" --to "New name"
- Renames all associated files/folders as they were created
- Run
If this confuses you then check the Gulp Tasks and read through the documentation thoroughly.
Fill in the required information in the new config.json
or nothing will work! (the dates are optional everything else is required).
The file prefix
is generally the first three characters of the product (e.g., CUV
= Cuvitru) and for Engage specific versions add and E (e.g., CUV-E
= Cuvitru for Engage).
The externalId
can be any alphanumeric gibberish you like. Generally I make the sharedResourceExternalId
the same as the externalId
because why not.
{
"presentationName": "",
"forEngage": "TRUE",
"prefix": "",
"externalId": "",
"presentationStartDate": "",
"presentationEndDate": "",
"productName": "",
"countryName": "United Kingdom",
"countryTPI": "UK",
"language": "English",
"sharedResourceExternalId": ""
}
The prefix
key will be prepended to both the Presentation Link
and the slide.related_shared_resource__v
fields in each keymessage json file. The presentation title will also be prefixed with this when uploaded to Vault.
This will be generated when you run $ gulp setup
root/
|—— build/
|—— dist/
|—— source/
| |—— previews/
| |—— shared/
| | |—— less/
| | | |—— keymessages/
| | |—— fonts/
| | |—— imgs/
| | |—— js/
| |—— your.html
| |—— key.html
| |—— messages.html
|—— keymessages/
|—— templates/
|
|—— config.json
|—— gulfile.js
|—— package.json
Menu | Gulp task | Action |
---|---|---|
Read | $ gulp setup |
Setup folders and config.json |
Read | $ gulp |
Watch the src folder for changes |
Read | $ gulp build |
Build for local testing |
Read | $ gulp dist |
Package for Vault deployment |
Menu | Gulp task | Action |
---|---|---|
Read | $ gulp keymessage --new "Key Message name" [--nonav] |
Add a Key Message to the project, Create CLM Presentation json file, Create CLM Pres shared resources json |
Read | $ gulp link --km "key-message-name.zip" --method "nameOfMethod" --id "123-presentation-ID" |
Add a link to a slide in another Veeva presentation |
Read | $ gulp rename --from "Old name" --to "New name" |
Rename a Key Message and associated files |
Read | $ gulp regen |
Regenerate the Key Message json files |
Read | $ gulp previews |
Process screen grabs into poster/thumbnail images |
$ gulp setup
- Template a
config.json
for your project defaults - Add a
.gitignore
file - Create a
source
folder for storing your working files - Template the LESS files in
source
>shared
>less
- Template the JS files in
source
>shared
>js
- Create a
build
folder for viewing your presentation - Create a
dist
folder for Vault content ZIPs - Create a
source
>previews
folder for thumbs and posters
$ gulp
Watch the src
files for changes and run the build
command automatically.
You may like to implement something to refresh your browser when this command runs but I prefer to press F5 myself. Here's an example of how to implement a live reload if that's what you're into: https://stackoverflow.com/questions/43415506/how-to-make-a-refresh-in-browser-with-gulp/43463567
$ gulp build
- Combine LESS files, minify css and minify JS
- Adds Left/Right navigation buttons to header (removed when packaged for distribution)
$ gulp dist
- Packages all the project files into the
dist
folder ready for upload to Vault - This means:
- Pull all the shared resources (CSS, JS, Fonts, Images) into a ZIP and place into the
dist
folder - Package each Key Message in it's own ZIP, along with it's thumb and poster images, and place in the
dist
folder
- Pull all the shared resources (CSS, JS, Fonts, Images) into a ZIP and place into the
- Uses the Key Message JSON files to generate a Vault MC Loader file (this will appear in the
dist
folder)
- Chuck the CSV file, found in the
dist
folder, at the Vault MC Loader and watch it successfully get verified - Upload your ZIP files from the
dist
folder too - Sit back and relax
$ gulp keymessage --new "Key Message name" [--nonav]
- Requires that you have filled in the
config.json
file! - Creates the Key Message JSON file for use in the Vault MC Loader .csv file
- Creates the Key Message HTML file at root
- Creates template thumb and poster images in the
previews
folder - Adds a Key Message LESS file for this page in
source
>shared
>less
>keymessages
(also adds a link intodefault.less
andanims.less
) - Inserts a method to capture menu interaction for the new keymessage (
app.js
) and you'll want to add a class to your menu link that matches the patterngoTo-FilenameInCamelcase
- Adds the
goTo-FilenameInCamelcase
link into thenav.html
partial for you. Nav highlighting is controlled by jQuery setting anactive
class for the current page (experimental!) - Using the optional
--nonav
you can suppress adding the link tonav.html
The Vault MC Loader requires that the Presentation be part of the .csv file and that the Shared Resources be part of the .csv file and uploaded in the same way as a Key Message:
- Generate the CLM Presentation Key Message JSON file for use in the Vault MC Loader .csv file
- Creates the shared resources Key Message JSON file for use in the Vault MC Loader .csv file
gulp link --km "key-message-name.zip" --method "nameOfMethod" --id "123-presentation-ID"
- Inserts a method to capture interaction for the new link (
app.js
) and you'll want to add a class to your link that matches the patterngoTo-nameOfMethod
- The
--id
must match thePresentation Id
as set in Vault/Salesforce --km
must be an existing key message (will also add.zip
to the end if you don't)- The
--method
will be forced to camel case, hyphens and spaces will be removed
gulp rename --from "Old key message" --to "New key message"
- Renames HTML and LESS file
- Changes CSS page ID in the LESS and HTML files
- Updates the
.goTo-
in./source/shared/js/app.js
and in the Key Message HTML file - Renames the
./source/previews
folder for this Key Message
gulp regen
- Regenerates the Key Message json files in
./keymessages
gulp previews
- Converts each Key Message screen grab into the poster and thumbnail for that Key Message
- Place your screen grab file into the
./source/previews/your-key-message
folder - The screen grab should be either jpg or png
- The screen grab filename doesn't matter but shouldn't be "poster" or "thumbnail"
You need to install both ImageMagick and GraphicsMagick if you want to use the gulp previews
command.
Instructions: https://imagemagick.org/
Installer(s):
Instructions: http://www.graphicsmagick.org/
Installer(s):
-
ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/windows/GraphicsMagick-1.3.35-Q8-win64-dll.exe
-
ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/windows/GraphicsMagick-1.3.35-Q8-win64-dll.exe.sig