Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
o o
These modifications were accomplished by making the following different types of changes. These changes (unless they were very extensive) are marked in comments in the code that are prefaced by the phrase PORTALMOD. You can search through the modified code base for PORTALMOD and see many of the modifications that were made.
The Analyst web portal only has a single master page - .\AnalystWeb\MasterPage.master. You can modify the HTML and ASP in these pages to modify the layout of the pages in particular the header area of the pages. The style is generally contained in the CSS files.
ChangeRequestsAssignedToMe.aspx
The list of change requests assigned to the logged in user. ChangeRequestsINeedToManual The list of active manual activities assigned to the logged in user to complete. ChangeRequestsINeedToReview.aspx The list of active review activities the logged in user is a reviewer of. ManualActivities.aspx The list of manual activities. ManualActivityDetails.aspx The page that shows the details of a manual activity. ReviewActivities.aspx The list of Review Activities. ReviewActivityDetails.aspx The page that shows the details of a review activity.
End User
.\WebParts\WebPartsResources.resx
.\Common\CommonResources.aspx
Analyst
Contains display strings that are include in the Common web parts .\AnalystWeb\App_GlobalResources\ Contains display AnalystPortalResources.resx strings for the analyst portal (not including web parts) .\AnalystWebParts\WebPartResources Contains the .resx display strings for the analyst web parts
Web Part Changes The web parts are compiled assemblies. Code modifications require a rebuild of the assembly projects. The Web Parts are: App End User End User End User End User End User File Announcements.cs GlobalLinks.cs HomePageTasks.cs KnowledgeArticleDetail.cs KnowledgeArticlePart.cs Purpose List of top 10 announcements on home page Nav bar in the upper left corner List of tasks on the right side Details of a knowledge article Knowledge articles sorted by their star ratings in descending order as seen on the end user portal home page List of recent request seen on the right side of the portal home page List of all announcements List of knowledge articles returned by a search View all active requests where the logged in user is the affected user. Create request wizard Details of a request Software request wizard List of announcements Detailed of a change request Overview of a change request List of change requests assigned to the logged in user Change requests where there is a manual activity assigned to the logged in user Change requests where there is a review activity where the logged in user is a reviewer A list of change requests submitted by the user A list of manual activities Details of a manual activity A list of review activities Details of a review activity
End User
RecentRequests.cs
End User End User End User Analyst Analyst Analyst Analyst Analyst
Analyst
ChangeRequestsNeedToReview.cs
3. Portal Setup
Run the Portal setup on the web server where you want host your customized portal. Portal setup provisions the SDK so that it can use the ServiceManager database and sets up the performance counters required to initialize and use the in-process SDK. The portal is designed to host the SDK in the same process as w3p.exe.
2. Copy the folders (Analyst, EndUser, aspnet_client) contained in C:\Inetpub\wwwroot\System Center Service Manager Portal to the new directory.
3. Create a new EndUser2 (or any name you choose) application in IIS under the same website (SCSMPortal) installed by SM portal setup. Configure the physical path to point to the EndUser directory inside of new physical directory (Custom System Center Service Manager Portal) you created in step #2.
4. Create a new Analyst2 (or any name you choose) application in IIS under the same website (SCSMPortal) installed by SM portal setup. Configure the physical path to point to the Analyst directory inside of new physical directory (Custom System Center Service Manager Portal) you created in step #2.
5. For both applications configure the following: a. Optionally create a new application pool (you can use the SM_AppPool from the IIS application pools as shown above). If you create a new application pool make sure it uses: i. Integrated managed pipeline ii. Load user profile is set to true iii. Identity is set to SM data access service account b. Make sure only Windows authentication is enabled for your application.
c. Since the System Center Data Access Service, portal helper functions, and utilities in Microsoft.EnterpriseManagement.ServiceManager.Portal.Common.dll dont encrypt any data sent over the wire it is recommended that your web site use https binding along
with an SSL certificate. This is only necessary to consider if you are creating a new web site to host the applications instead of using the web site installed by portal set up. The web sites should look like this when you are done:
Common
Web Parts
and then add it again (Add Reference) by browsing to the corresponding .dll in the \Common folder.
5. For the End User Web Parts project create a reference to the Portal Common project:
File
MS.EM.SM.WebParts.dll MS.EM.SM.WebParts.pdb MS.EM.SM.Portal.Common.dll MS.EM.SM.Portal.Common.pdb MS.EM.SM.Portal.dll MS.EM.SM.Portal.pdb *.aspx *.Master *.css EndUserPortalResources.resx MS.EM.SM.Portal.Common.dll MS.EM.SM.Portal.Commonpdb MS.EM.SM.AnalystWebParts.dll MS.EM.SM.AnalystWebParts.pdb *.aspx *.Master
Destination
.\EndUser\Bin\ .\EndUser\Bin\ .\EndUser\Bin\ .\EndUser\Bin\ .\EndUser\Bin\ .\EndUser\Bin\ .\EndUser\ .\EndUser\MasterPages\ .\EndUser\MasterPages\ .\EndUser\App_GlobalResources\ .\Analyst\Bin\ .\Analyst\Bin\ .\Analyst\Bin\ .\Analyst\Bin\ .\Analyst\ .\Analyst\MasterPages\
.\AnalystWeb\MasterPages\ .\AnalystWeb\App_GlobalResources\
*.css AnalystPortalResources.resx
.\Analyst\MasterPages\ .\Analyst\App_GlobalResources\
Note: the file names above are shortened MS=Microsoft, EM=EnterpriseManagement, SM=ServiceManager. Of course if you add any .aspx, .css, images, new projects that generate assemblies, etc. you will need to get those copied to the corresponding places. Remember to use CTRL+F5 to refresh the page after making changes to make sure that the browser doesnt use any cached content like images, .css files, etc and requests the entire page new from the server.
7. Making a New Web Part and Page on the Portal (New User Provisioning Example)
The modified portal contains a new page for requesting a new user. This is the process that was used to create this solution: 1) Create a new management pack in the SCSM Authoring Tool. 2) Create a new activity work item class with some properties to capture the data inputs. 3) Create a custom form for the new activity work item class (optional; you can just use the generic form). 4) Create a workflow to automate the implementation of the request 5) Import the MP into SCSM. 6) Copy the workflow .dll to C:\Program Files\Microsoft System Center\Service Manager 2010 on the SCSM management server. 7) Create a new Web Part (see RequestNewUser.cs in the modified source Visual Studio solution) 8) Create a new .aspx page to host the web part (see RequestNewUser.aspx). 9) Modify the HomePageTasks.cs web part to show an additional link to the new page (see modified HomePageTasks.cs). 10) Modify web.enduser.config to have a new appSetting (see modified web.enduser.config).
shared between the portal and WPF rich console. The following binaries contain the implementation of this data model: Microsoft.EnterpriseManagement.UI.Foundation.dll Microsoft.EnterpriseManagement.UI.SdkDataAccess.dll
cache of connections one for each language based on the incoming requests default language setting in the browser.
ReadOnlyWebPart: abstract base web part from which almost all SM web parts derive. This web
part disables actions like closing/editing a web part. It also provides a virtual method HandleException which can be used by derived web parts to handler exceptions as desired.
PoppableWebPart: it can be derived from to create a web part with modal dialog support. E.g.: Announcements web part.
IDataItem:
This is a UI wrapper of SDK objects (instance/projection instances/MP elements/templates) used by the portal and SM WPF console. It provides get/set operations on SDK object properties if it is supported by the wrapped SDK object. The oortal uses System.WorkItem.IncidentPortalProjectiontype projection for incidents. I. Property CreatedDate on MP class System.WorkItem can be accessed from the above incident projection as dataItem*CreatedDate+. II. To get the resolved by users name you can use: String resolvedByUserName = (dataItem*ResolvedByUser+ as IDataItem)*DisplayName+.ToString(); This will work provided incident was resolved and dataItem*ResolvedByUser+ as IDataItem) is not null.
SdkQueryUtility: publicly exposes the typical type and instance space operations required to
implement any business logic from the web parts. Example: GetInstances can be used to query for all instances of a ManagementPackClass Id, matching a search criteria.
/// <summary> /// Gets the instances. /// </summary> /// <param name="classId">The class id.</param> /// <param name="criteria">The criteria.</param> /// <returns></returns> public IList<IDataItem> GetInstances(Guid classId, string criteria)
Notes: Portal doesnt use any kind of IOC container or such so you need to take a hard dependency on the binaries listed above if you want to customize any OOB SM v1 portal web parts/build custom web parts. The list of above binaries is applicable only for Service Manager V1 (RTM).
10.
Dependency Reference
The portal depends on the following assemblies: Binary Description Microsoft.EnterpriseManagement.ServiceManager.Portal.Common.dll Required if you want to customize any portal end user or analyst web parts. Provides you with boiler plate code like connection to a management group. Microsoft.EnterpriseManagement.Common.dll Required to initialize and use the SDK Microsoft.EnterpriseManagement.Config.dll client and server Microsoft.EnterpriseManagement.Core.dll Microsoft.EnterpriseManagement.DataAccessLayer.Common.dll Microsoft.EnterpriseManagement.DataAccessLayer.dll Microsoft.EnterpriseManagement.DataAccessLayer.QueryCache.dll Microsoft.EnterpriseManagement.DataAccessService.Core.dll Microsoft.EnterpriseManagement.HealthService.dll Microsoft.EnterpriseManagement.Modules.DataTypes.dll Microsoft.Mom.Common.dll
Contains references to Management Pack elements. The portal code uses references from this binary to query for portal specific MP element references.