Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to 24.1.1 #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Templates and resources for development platforms.
[react-starter-sites](react-starter-sites/) – A quick way to get started with React site development.


# New in Release 24.1.1

**Updated**
- `cec create-component` - Minor updates to seeded source component definitions


# New in Release 23.12.1

**Updated**
Expand Down
2 changes: 1 addition & 1 deletion sites/bin/cec/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cec",
"version": "23.12.1",
"version": "24.1.1",
"description": "CLI for cec",
"license": "UPL-1.0",
"main": "cec.js",
Expand Down
65 changes: 38 additions & 27 deletions sites/bin/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var _createLocalTemplateFromSite = function (name, siteName, server, excludeCont
sitesRest.getSite({
server: server,
name: siteName,
expand: 'channel,repository,staticSiteDeliveryOptions'
expand: 'channel,repository,staticSiteDeliveryOptions,access'
})
.then(function (result) {
if (!result || result.err || !result.id) {
Expand All @@ -147,6 +147,10 @@ var _createLocalTemplateFromSite = function (name, siteName, server, excludeCont
return Promise.reject();
}

// check site security
var siteSecurity = site.security && site.security.access || [];
var siteSecured = siteSecurity.includes('everyone') ? false : true;

// create local folder for the template

fs.mkdirSync(tempSrcPath);
Expand Down Expand Up @@ -1102,9 +1106,13 @@ var _downloadComponents = function (comps, server, publishedversion) {

// copy the site from the mounted shared filesystem location if available
var _copySiteFromFSS = function (siteName, siteSrcPath, publishedversion) {
// e.g.: /u03/sitespublish/<siteName>pages/12.json
var mountedSitePath = path.join(siteMountPoint, siteName);
if (publishedversion && fs.existsSync(mountedSitePath)) {
// copy the site files

// make sure at least the pages folder exists
var pagesPath = path.join(mountedSitePath, 'pages')
if (publishedversion && fs.existsSync(mountedSitePath) && fs.existsSync(pagesPath)) {
// this now assumes all the files under /u03/sitespublish/<siteName> contains all the published files for the site
try {
console.info(' - copying site files: ' + siteName);
fs.cpSync(mountedSitePath, siteSrcPath, { force: true, recursive: true });
Expand All @@ -1115,20 +1123,16 @@ var _copySiteFromFSS = function (siteName, siteSrcPath, publishedversion) {
}
} else {
// only copy if using the published version of the site
console.info(' - downloading site files');
return false;
}
};

// Download the site - use the source folder if it exists, otherwise handle individual files
var _downloadSite = function (server, type, id, name, publishedversion, targetPath, showError, showDetail, excludeFolder) {

// try to copy the site
if (_copySiteFromFSS(name, targetPath, publishedversion)) {
return Promise.resolve({});
} else {
// if can't copy, then download the site
return _downloadResource(server, type, id, name, publishedversion, targetPath, showError, showDetail, excludeFolder);
}
// start with the top-level folder for the site
return _downloadResource(server, type, id, name, publishedversion, targetPath, showError, showDetail, excludeFolder);
};

//
Expand All @@ -1138,6 +1142,10 @@ var _downloadResource = function (server, type, id, name, publishedversion, targ
return new Promise(function (resolve, reject) {

if (publishedversion) {
// if we are downloading the published version of a site, first copy the files from the shared filesystem
// Note: any top-level files will be overwritten by the subsequent code, e.g.: structure.json but this is expected
var copiedFromFSS = ((type === 'site') && _copySiteFromFSS(name, targetPath, publishedversion));

var getCompPromises = [];
if (type === 'component') {
getCompPromises.push(sitesRest.getComponent({
Expand Down Expand Up @@ -1220,20 +1228,23 @@ var _downloadResource = function (server, type, id, name, publishedversion, targ

})
.then(function (results) {
if (copiedFromFSS) {
// files already copied, we're done here
return Promise.resolve();
} else {
// download publish folder and place at the top of the resource
var downloadArgv = {
path: type + ':' + name + '/publish',
folder: targetPath
};

// download publish folder and place at the top of the resource
var downloadArgv = {
path: type + ':' + name + '/publish',
folder: targetPath
};

// If user specifies site:content, we will exclude publish/content
var publishExcludeFolder = [];
excludeFolder.forEach(function (folder) {
publishExcludeFolder.push('publish' + folder);
});
return documentUtils.downloadFolder(downloadArgv, server, showError, showDetail, publishExcludeFolder);

// If user specifies site:content, we will exclude publish/content
var publishExcludeFolder = [];
excludeFolder.forEach(function (folder) {
publishExcludeFolder.push('publish' + folder);
});
return documentUtils.downloadFolder(downloadArgv, server, showError, showDetail, publishExcludeFolder);
}
})
.then(function (result) {

Expand Down Expand Up @@ -1267,10 +1278,10 @@ var _downloadResource = function (server, type, id, name, publishedversion, targ
// set file mount points for copying files during creating a template
var _setMountPoints = function (mountPoint) {
// ToDo: get final FSS mount point as default
baseMountPoint = mountPoint || '/_ocm_publish';
themeMountPoint = path.join(baseMountPoint, 'themes');
siteMountPoint = path.join(baseMountPoint, 'sites');
componentMountPoint = path.join(baseMountPoint, 'components');
baseMountPoint = mountPoint || '/u03';
themeMountPoint = path.join(baseMountPoint, 'themespublish');
siteMountPoint = path.join(baseMountPoint, 'sitespublish');
componentMountPoint = path.join(baseMountPoint, 'compspublish');
};

module.exports.createTemplate = function (argv, done) {
Expand Down
4 changes: 2 additions & 2 deletions sites/data/config/src-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"gulp": "4.0.2",
"gulp-replace": "1.1.4",
"lodash": "4.17.21",
"marked": "4.0.10",
"marked": "4.3.0",
"mocha": "10.1.0",
"mocha-junit-reporter": "2.2.1",
"mustache": "4.2.0",
"preact": "10.6.6",
"preact": "10.19.3",
"preact-render-to-string": "5.2.6",
"puppeteer": "15.3.1",
"react": "18.2.0",
Expand Down
Binary file modified sites/data/templates/BlogTemplate.zip
Binary file not shown.
Binary file modified sites/data/templates/CafeSupremoLite.zip
Binary file not shown.
Binary file modified sites/data/templates/JETStarterTemplate.zip
Binary file not shown.
Binary file modified sites/data/templates/KnowledgeTemplate.zip
Binary file not shown.
Binary file modified sites/data/templates/StarterTemplate.zip
Binary file not shown.
Binary file modified sites/data/templates/VBCSSamplesTemplate.zip
Binary file not shown.
Binary file modified sites/data/templates/search_template.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions sites/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cec-sites-toolkit",
"version": "23.12.1",
"version": "24.1.1",
"license": "UPL-1.0",
"description": "Oracle Content Management Toolkit helps you develop site templates, themes, custom components, and content layouts for Oracle Content Management.",
"main": "index.js",
Expand Down Expand Up @@ -245,7 +245,7 @@
"chai": "4.3.7",
"cheerio": "1.0.0-rc.12",
"deepmerge": "4.3.1",
"express": "4.17.3",
"express": "4.18.2",
"extract-zip": "2.0.1",
"fast-xml-parser": "4.2.4",
"form-data": "4.0.0",
Expand All @@ -255,7 +255,7 @@
"gulp-zip": "5.1.0",
"he": "1.2.0",
"htmllint": "0.8.0",
"marked": "4.0.10",
"marked": "4.3.0",
"mocha": "10.1.0",
"mustache": "4.2.0",
"node-fetch": "2.6.11",
Expand Down
Binary file modified sites/test/data/siteCompileTestTemplate.zip
Binary file not shown.

Large diffs are not rendered by default.

71 changes: 3 additions & 68 deletions sites/test/sitescloud/renderer/renderer.js

Large diffs are not rendered by default.