Composite C1 Website project to Web Application Project Conversion

Date Created: 2011-04-18
Date Modified: 2013-01-20

Definitions

  • WAP = Web Application Project
  • WS[P] = Web Site [Project]

Motivation

There are several reasons for HolisticWare team's need to convert Composite C1 Visual Studio Web Site project (WSP) to Web Application project (WAP):

  • XDT: Xml Document Transforms
    XDT is not available (without a hacks) in Web Site [Projects]. Web site is actually not a project, because it has no project file (.csproj).
  • Inability to share code as links (add code files as links)
    In order to reuse code from other projects and libraries feature of Visual Studio: (Add existing item > Open (As Link is not available)
    Thus the use of great tools like Visual Studio project linker is impossible and the team needs it because of its dedication to code reuse and multitargeting.
  • Unit testing
    Do to the fact that team develops and customizes Composite C1 for it's own use and for our customers, to assure reasonable Quality, team does Unit Testing. With WSP team has found some difficulties extending Unit tests from our other projects to Composite C1.
  • Advantages of WSP are not needed
    Advantages such as rapid updates (adding new pages to site) and ease of maintenance are not crucial for the team, because this functionality is embedded in the primary function of any decent CMS system. Ad Composite C1 is excellent CMS.

Conversion

References:

Steps:

  1. Create WAP (Solution + Add new project + Web Application project)
  2. Copy stuff from \Bin folder into \libs (or whatever You name it)
  3. Add references to WAP from \libs folder
  4. Compile/Build to check everything is still OK.
  5. Copy all files from WSP to WAP:
    • either on Filesystem and then do "Include in project" or
    • Copy + Paste in Visual Studio Explorer (HolisticWare team).
    Directories and files selected and copied:
          App_Data
          Composite
          Frontend
          Renderers
          default.aspx
          Global.asax
          Web.Config
          
  6. Convert to Web Application
    WAP (Context Menu AKA Rich click +/ Convert to Web Application
    This step generates code behind files needed by WAP.
    Composite C1 team has done tremendous job in making this step easy and (writing on 2013-01-10) with version 4 beta of Composite C1 this step has no isues.
    Historical stuff:
    1. 2013-01 v.4 beta => no issues
    2. 2013-01 v.3.x beta => some issues
    Process with some tips and tricks how to fix possible issues in conversion:
    1. fix missing Page directives in aspx pages!
                <%@ Page  %>
                
      Visual Studio cannot perform conversion with message:
                Build has been canceled.
                Unable to convert to Web Application format because the page directive is 
                missing in the file XXXX
                

      This used to be an error in numerous pages in original Composite C1 WSP, but with each build errors fixed.
      Offending files (aspx) are in following directories:
                Composite\
                Composite\content\
                
      And concrete files are (might be +/- few more/less):
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositecharmap\charmap.aspx'.
                'Composite\content\misc\editors\codemirroreditor\codemirroreditor.aspx'.
                'Composite\content\misc\defaultstart\defaultstart.aspx'.
                'Composite\content\misc\audioloader\audio.aspx'.
                'Composite\content\flow\FlowUiCompletedDialog.aspx'.
                'Composite\content\flow\FlowUiCompleted.aspx'.
                'Composite\content\dialogs\wysiwygeditor\wysiwygeditordialog.aspx'.
                'Composite\content\dialogs\wysiwygeditor\mozsecuritynote\mozsecuritynote.aspx'.
                'Composite\content\dialogs\wysiwygeditor\errors\contenterror.aspx'.
                'Composite\content\dialogs\webservices\error.aspx'.
                'Composite\content\dialogs\util\comparestrings\comparestrings.aspx'.
                'Composite\content\dialogs\treeselector\treeselector.aspx'.
                'Composite\content\dialogs\treeselector\special\imageselector.aspx'.
                'Composite\content\dialogs\translations\translations.aspx'.
                'Composite\content\dialogs\systemtrees\detailedpaste.aspx'.
                'Composite\content\dialogs\standard\standard.aspx'.
                'Composite\content\dialogs\save\saveall.aspx'.
                'Composite\content\dialogs\postback\postbackdialog.aspx'.
                'Composite\content\dialogs\options\options.aspx'.
                'Composite\content\dialogs\multiselector\multiselectordialog.aspx'.
                'Composite\content\dialogs\imageeditor\scaleimage\scaleimage.aspx'.
                'Composite\content\dialogs\about\about.aspx'.
                'Composite\compile.aspx'.
                'Composite\blank.aspx'.
                'Composite\app.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositecharmap\charmap.aspx'.
                'Composite\content\misc\editors\codemirroreditor\codemirroreditor.aspx'.
                'Composite\content\misc\defaultstart\defaultstart.aspx'.
                'Composite\content\misc\audioloader\audio.aspx'.
                'Composite\content\flow\FlowUiCompletedDialog.aspx'.
                'Composite\content\flow\FlowUiCompleted.aspx'.
                'Composite\content\dialogs\wysiwygeditor\wysiwygeditordialog.aspx'.
                'Composite\content\dialogs\wysiwygeditor\mozsecuritynote\mozsecuritynote.aspx'.
                'Composite\content\dialogs\wysiwygeditor\errors\contenterror.aspx'.
                'Composite\content\dialogs\webservices\error.aspx'.
                'Composite\content\dialogs\util\comparestrings\comparestrings.aspx'.
                'Composite\content\dialogs\treeselector\treeselector.aspx'.
                'Composite\content\dialogs\treeselector\special\imageselector.aspx'.
                'Composite\content\dialogs\translations\translations.aspx'.
                'Composite\content\dialogs\systemtrees\detailedpaste.aspx'.
                'Composite\content\dialogs\standard\standard.aspx'.
                'Composite\content\dialogs\save\saveall.aspx'.
                'Composite\content\dialogs\postback\postbackdialog.aspx'.
                'Composite\content\dialogs\options\options.aspx'.
                'Composite\content\dialogs\multiselector\multiselectordialog.aspx'.
                'Composite\content\dialogs\imageeditor\scaleimage\scaleimage.aspx'.
                'Composite\content\dialogs\about\about.aspx'.
                'Composite\compile.aspx'.
                'Composite\blank.aspx'.
                'Composite\updated.aspx'.
                'Composite\unsupported.aspx'.
                'Composite\unknownbrowser.aspx'.
                'Composite\postback.aspx'.
                'Composite\dead.aspx'.
                'Composite\content\views\systemview\systemview.aspx'.
                'Composite\content\views\start\start.aspx'.
                'Composite\content\views\seoassist\seoassist.aspx'.
                'Composite\content\views\help\help.aspx'.
                'Composite\content\views\generic\generic.aspx'.
                'Composite\content\views\explorer\explorer.aspx'.
                'Composite\content\views\editors\permissioneditor\permissioneditor.aspx'.
                'Composite\content\views\editors\imageeditor\imageeditor.aspx'.
                'Composite\content\views\dev\viewsource\viewsource.aspx'.
                'Composite\content\views\dev\systemlog\systemlogoutput.aspx'.
                'Composite\content\views\dev\systemlog\systemlog.aspx'.
                'Composite\content\views\dev\icons\files\republicrender.aspx'.
                'Composite\content\views\dev\icons\files\republic.aspx'.
                'Composite\content\views\dev\icons\files\harmonyrender.aspx'.
                'Composite\content\views\dev\icons\files\harmony.aspx'.
                'Composite\content\views\dev\developer\developer.aspx'.
                'Composite\content\views\browser\browser.aspx'.
                'Composite\content\misc\viewers\sourcecodeviewer\viewsourcecontent.aspx'.
                'Composite\content\misc\stage\stagedeck.aspx'.
                'Composite\content\misc\preview\stop.aspx'.
                'Composite\content\misc\preview\error.aspx'.
                'Composite\content\misc\editors\visualeditor\tinymce.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositeword\word.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositetable\table.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositetable\row.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositetable\merge.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositetable\cell.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositelink\link.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositeimage\image.aspx'.
                'Composite\content\misc\editors\visualeditor\tiny_mce\plugins\compositecharmap\charmap.aspx'.
                'Composite\content\misc\editors\codemirroreditor\codemirroreditor.aspx'.
                'Composite\content\misc\defaultstart\defaultstart.aspx'.
                'Composite\content\misc\audioloader\audio.aspx'.
                'Composite\content\flow\FlowUiCompletedDialog.aspx'.
                'Composite\content\flow\FlowUiCompleted.aspx'.
                'Composite\content\dialogs\wysiwygeditor\wysiwygeditordialog.aspx'.
                'Composite\content\dialogs\wysiwygeditor\mozsecuritynote\mozsecuritynote.aspx'.
                'Composite\content\dialogs\wysiwygeditor\errors\contenterror.aspx'.
                'Composite\content\dialogs\webservices\error.aspx'.
                'Composite\content\dialogs\util\comparestrings\comparestrings.aspx'.
                'Composite\content\dialogs\treeselector\treeselector.aspx'.
                'Composite\content\dialogs\treeselector\special\imageselector.aspx'.
                'Composite\content\dialogs\translations\translations.aspx'.
                'Composite\content\dialogs\systemtrees\detailedpaste.aspx'.
                'Composite\content\dialogs\standard\standard.aspx'.
                'Composite\content\dialogs\save\saveall.aspx'.
                'Composite\content\dialogs\postback\postbackdialog.aspx'.
                'Composite\content\dialogs\options\options.aspx'.
                'Composite\content\dialogs\multiselector\multiselectordialog.aspx'.
                'Composite\content\dialogs\imageeditor\scaleimage\scaleimage.aspx'.
                'Composite\content\dialogs\about\about.aspx'.
                'Composite\compile.aspx'.
                'Composite\blank.aspx'.
                'Composite\app.aspx'.
                
      Solution:
      Add Page directive to each of those files (at the beginning) to WAP or even better to WSP
      (Composite C1 guys did it and nothing broke and with v.4 users can transform Website to Webapp on the fly)
      WARNING!!!
      Take care of tag order in files (xml tag comes before Page tag!
                <?xml version="1.0" encoding="UTF-8"?>
                <%@ Page %>
                
      And not:
                <%@ Page %>
                <?xml version="1.0" encoding="UTF-8"?>
                
    2. If change was performed on WSP repeat steps 5. and 6.
      Else/otherwise if change was performed on WAP repeat step 6.
    3. Old issue (not needed anymore):
      Exclude from project automatically generated code behind page:
                WebApplication1\Composite\content\views\showelementinformation\Default.aspx.design.cs
                
  7. Build
  8. Run

TODOs (future plans)

Although HolisticWare team has written batch script for transformation/conversion this script is not needed anymore. Team is working on VS macro that could do this automagically.

Team's 2 cents solution with 2.1.1 WSP and WAP. Solution was not initialized (no Startup page type chosen, no password).
Solution with WSP and WAP.
Username: Admin
Password: 123456