diff --git a/README.md b/README.md index d551f12b..8e173cef 100644 --- a/README.md +++ b/README.md @@ -110,25 +110,31 @@ OPTIONS this command invocation DESCRIPTION - See 'Which Experience Cloud Template Should I Use?' in Salesforce Help for more information about the different - template types available for Experience Cloud. + Run the "community list template" command to see the templates available in your org. See 'Which Experience Cloud + Template Should I Use?' in Salesforce Help for more information about the different template types available. + + When you create a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value + using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED or + AUTHENTICATED_WITH_PUBLIC_ACCESS_ENABLED. Name and values are case-sensitive. See 'DigitalExperienceBundle' in the + Metadata API Developer Guide for more information. + + The site creation process is an async job that generates a jobId. To check the site creation status, query the + BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the + Salesforce Platform for more information. - When creating a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using - the format templateParams.AuthenticationType=value, where value is AUTHENTICATED, UNAUTHENTICATED, or - AUTHENTICATED_WITH_PUBLIC_ACCESS. Name and values are case-sensitive. See 'ExperienceBundle' in the Metadata API - Developer Guide for more information. + If the job doesn’t complete within 10 minutes, it times out. You receive an error message and must restart the site + creation process. Completed jobs expire after 24 hours and are removed from the database. - When you execute this command, it creates the site in preview status, which means that it isn't yet live. After you + When you run this command, it creates the site in preview status, which means that the site isn't yet live. After you finish building your site, you can make it live. - If you have an Experience Builder site, publish the site using the sfdx force:community:publish command to make it - live. + If you have an Experience Builder site, publish the site using the "community publish" command to make it live. - If you have a Salesforce Tabs + Visualforce site, activate the site to make it live by updating the status field of - the Network type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and - click Activate. + If you have a Salesforce Tabs + Visualforce site, to activate the site and make it live, update the status field of + the Network type in Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click + Activate. - For Experience Builder sites, activating the site just sends out a welcome email to site members. + For Experience Builder sites, activating the site sends a welcome email to site members. EXAMPLES $ sfdx force:community:create --name 'My Customer Site' --templatename 'Customer Service' --urlpathprefix customers @@ -165,19 +171,21 @@ OPTIONS this command invocation DESCRIPTION - Each time you publish it, you update the live site with the most recent updates. - When you publish an Experience Builder site for the first time, you make the site's URL live and enable login access - for site members. + Each time you publish a site, you update the live site with the most recent updates. When you publish an Experience + Builder site for the first time, you make the site's URL live and enable login access for site members. - Additionally, to send a welcome email to all site members, you must activate the site. (Activation is also required to - successfully set up SEO for Experience Builder sites.) To activate a site, update the status field of the Network - type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click - Activate. + In addition to publishing, you must activate a site to send a welcome email to all site members. Activation is also + required to set up SEO for Experience Builder sites. To activate a site, update the status field of the Network type + in Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. + + An email notification informs you when your changes are live on the published site. The site publish process is an + async job that generates a jobId. To check the site publish status manually, query the BackgroundOperation object and + enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more + information. - Subsequently, each time you publish the site, you update the live site with all changes made to the site since it was - last published. + If the job doesn’t complete within 15 minutes, it times out. You receive an error message and must restart the site + publish process. Completed jobs expire after 24 hours and are removed from the database. - An email notification informs you when your changes are live. EXAMPLE $ sfdx force:community:publish --name 'My Customer Site' diff --git a/messages/create.md b/messages/create.md index 97aa9aa5..4d6aa974 100644 --- a/messages/create.md +++ b/messages/create.md @@ -4,18 +4,21 @@ Create an Experience Cloud site using a template. # description -See 'Which Experience Cloud Template Should I Use?' (https://help.salesforce.com/s/articleView?id=sf.siteforce_commtemp_intro.htm&type=5) in Salesforce Help for more information about the different template -types available for Experience Cloud. +Run the "community list template" command to see the templates available in your org. See 'Which Experience Cloud Template Should I Use?' in Salesforce Help for more information about the different template types available. (https://help.salesforce.com/s/articleView?id=sf.siteforce_commtemp_intro.htm&type=5) -When creating a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED, UNAUTHENTICATED, or AUTHENTICATED_WITH_PUBLIC_ACCESS. Name and values are case-sensitive. See 'ExperienceBundle' in the Metadata API Developer Guide for more information. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_experiencebundle.htm) +When you create a site with the Build Your Own (LWR) template, you must also specify the AuthenticationType value using the format templateParams.AuthenticationType=value, where value is AUTHENTICATED or AUTHENTICATED_WITH_PUBLIC_ACCESS_ENABLED. Name and values are case-sensitive. See 'DigitalExperienceBundle' in the Metadata API Developer Guide for more information. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_digitalexperiencebundle.htm) -When you execute this command, it creates the site in preview status, which means that it isn't yet live. After you finish building your site, you can make it live. +The site creation process is an async job that generates a jobId. To check the site creation status, query the BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more information. (https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_backgroundoperation.htm) + +If the job doesn’t complete within 10 minutes, it times out. You receive an error message and must restart the site creation process. Completed jobs expire after 24 hours and are removed from the database. + +When you run this command, it creates the site in preview status, which means that the site isn't yet live. After you finish building your site, you can make it live. If you have an Experience Builder site, publish the site using the "community publish" command to make it live. -If you have a Salesforce Tabs + Visualforce site, activate the site to make it live by updating the status field of the Network type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. +If you have a Salesforce Tabs + Visualforce site, to activate the site and make it live, update the status field of the Network type in Metadata API. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_network.htm) Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. -For Experience Builder sites, activating the site just sends out a welcome email to site members. +For Experience Builder sites, activating the site sends a welcome email to site members. # examples @@ -61,8 +64,7 @@ The description displays in Digital Experiences - All Sites in Setup and helps w # response.action -We’re creating your site. Run sfdx force:org:open -p \_ui/networks/setup/SetupNetworksPage to view a list of your sites, -and to confirm when this site is ready. +Site creation is under way. To track its status, query the BackgroundOperation object and include the jobId. # response.styleHeader diff --git a/messages/publish.md b/messages/publish.md index 990901c5..c9cbd2a4 100644 --- a/messages/publish.md +++ b/messages/publish.md @@ -4,13 +4,13 @@ Publish an Experience Builder site to make it live. # description -Each time you publish it, you update the live site with the most recent updates. When you publish an Experience Builder site for the first time, you make the site's URL live and enable login access for site members. +Each time you publish a site, you update the live site with the most recent updates. When you publish an Experience Builder site for the first time, you make the site's URL live and enable login access for site members. -Additionally, to send a welcome email to all site members, you must activate the site. (Activation is also required to successfully set up SEO for Experience Builder sites.) To activate a site, update the status field of the Network type in the Metadata API. Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. +In addition to publishing, you must activate a site to send a welcome email to all site members. Activation is also required to set up SEO for Experience Builder sites. To activate a site, update the status field of the Network type in Metadata API. (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_network.htm)Alternatively, in Experience Workspaces, go to Administration | Settings, and click Activate. -Subsequently, each time you publish the site, you update the live site with all changes made to the site since it was last published. +An email notification informs you when your changes are live on the published site. The site publish process is an async job that generates a jobId. To check the site publish status manually, query the BackgroundOperation object and enter the jobId as the Id. See ‘BackgroundOperation’ in the Object Reference for the Salesforce Platform for more information. (https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_backgroundoperation.htm) -An email notification informs you when your changes are live. +If the job doesn’t complete within 15 minutes, it times out. You receive an error message and must restart the site publish process. Completed jobs expire after 24 hours and are removed from the database. # examples diff --git a/schemas/community-create.json b/schemas/community-create.json index f0660469..b9cf9aff 100644 --- a/schemas/community-create.json +++ b/schemas/community-create.json @@ -13,6 +13,10 @@ "type": "string", "description": "name of the community" }, + "jobId": { + "type": "string", + "description": "id of the BackgroundOperation that runs the create job" + }, "action": { "type": "string", "description": "the next actions that user can do to check, if community is created or not." diff --git a/schemas/community-publish.json b/schemas/community-publish.json index c309844a..8205821c 100644 --- a/schemas/community-publish.json +++ b/schemas/community-publish.json @@ -24,6 +24,10 @@ "url": { "type": "string", "description": "url to access the community" + }, + "jobId": { + "type": "string", + "description": "id of the BackgroundOperation that runs the publish job" } }, "required": ["id", "message", "name", "url"], diff --git a/src/commands/community/create.ts b/src/commands/community/create.ts index 7e9130b6..5349716c 100644 --- a/src/commands/community/create.ts +++ b/src/commands/community/create.ts @@ -24,6 +24,7 @@ const messages = Messages.loadMessages('@salesforce/plugin-community', 'create') const MESSAGE_KEY = 'message'; const NAME_KEY = 'name'; +const JOBID_KEY = 'jobId'; const ACTION_KEY = 'action'; /** @@ -94,6 +95,7 @@ export class CommunityCreateCommand extends SfCommand { const columns = { [NAME_KEY]: { header: 'Name' }, [MESSAGE_KEY]: { header: 'Message' }, + [JOBID_KEY]: { header: 'JobId' }, [ACTION_KEY]: { header: 'Action' }, }; this.styledHeader(messages.getMessage('response.styleHeader')); diff --git a/src/commands/community/publish.ts b/src/commands/community/publish.ts index 815e7573..787c4e5e 100644 --- a/src/commands/community/publish.ts +++ b/src/commands/community/publish.ts @@ -62,6 +62,7 @@ export class CommunityPublishCommand extends SfCommand name: { header: 'Name' }, status: { header: 'Status' }, url: { header: 'Url' }, + jobId: { header: 'JobId' }, }; this.styledHeader(messages.getMessage('response.styleHeader')); this.table([results], columns); diff --git a/src/shared/community/connect/CommunityCreateResource.ts b/src/shared/community/connect/CommunityCreateResource.ts index a8cd1c37..4f105474 100644 --- a/src/shared/community/connect/CommunityCreateResource.ts +++ b/src/shared/community/connect/CommunityCreateResource.ts @@ -14,6 +14,9 @@ import { ConnectResource } from '../../connect/services/ConnectResource'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@salesforce/plugin-community', 'create'); +const NAME_KEY = 'name'; +const JOBID_KEY = 'jobId'; + /** * A connect api resource for creating a community */ @@ -22,10 +25,11 @@ export class CommunityCreateResource implements ConnectResource { const urlPathPrefix = 'urlPathPrefix'; const templateName = 'templateName'; const description = 'description'; + const jobId = '000xx0000000000000'; let table: sinon.SinonStub; let styledHeader: sinon.SinonStub; @@ -69,13 +70,14 @@ describe('CommunityCreateResource', () => { describe('handleSuccess', () => { it('should return community info', () => { const connectResponse = { - message: 'message', name: communityName, + jobId, }; const result: CommunityCreateResponse = communityCreateResource.handleSuccess(connectResponse); expect(result.message).to.equal(messages.getMessage('response.createMessage')); expect(result.name).to.equal(communityName); + expect(result.jobId).to.equal(jobId); expect(result.action).to.equal(messages.getMessage('response.action')); }); }); diff --git a/test/shared/community/connect/CommunityPublishResource.test.ts b/test/shared/community/connect/CommunityPublishResource.test.ts index 911a8f8b..ed80938f 100644 --- a/test/shared/community/connect/CommunityPublishResource.test.ts +++ b/test/shared/community/connect/CommunityPublishResource.test.ts @@ -21,6 +21,7 @@ describe('CommunityPublishResource', () => { let org: Org; let communityPublishResource: CommunityPublishResource; const communityName = 'communityName'; + const jobId = '000xx0000000000000'; const validCommunityId = '0DB0000000000'; let table: sinon.SinonStub; let styledHeader: sinon.SinonStub; @@ -104,6 +105,7 @@ describe('CommunityPublishResource', () => { message: 'message', name: communityName, url: 'http://someurl.com/s', + jobId, }; // This sets up CommunityInfo await communityPublishResource.fetchCommunityId(); @@ -115,6 +117,7 @@ describe('CommunityPublishResource', () => { expect(result.name).to.equal(communityName); expect(result.status).to.equal('UnderConstruction'); expect(result.url.toString()).to.equal('http://someurl.com/s'); + expect(result.jobId).to.equal(jobId); }); });