I am working on migrating a legacy CMS onto EPiServer CMS. I want to move the content from legacy CMS into EPiServer's database. Anyone ran into a scenario like this? I followed their document on world.episerver.com, but it is not very clear. It says to configure EPiServer site under config tab in Admin section to define Content Channel. But they do not talk about exactly what APIs to use and how different fields map in their database to EpiServer's database. Any help would be much appreciated.
You should not copy directly into the database since it is extremely difficult to get it right.
You need to start by building up your content types inside your project and then I think the easiest way to import the content would to build scheduled task or extend the admin interface with a import page.
In that you do your own mapping since you are the only one that knows what the things in the old CMS should be in EPiServer.
This is not an easy thing to do if you are new to EPiServer and I think that it might be the quickest way to contact expert services and they will then help end guide you.
Good luck!!
You can add page programmatically using EpiServer's IContenntRepository and IContentTypeRepositoiry as follows:
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
using EPiServer.ServiceLocation;
PageReference parent = PageReference.RootPage;
IContentRepository contentRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentRepository>();
IContentTypeRepository contentTypeRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentTypeRepository>();
PageData myPage = contentRepository.GetDefault<PageData>(parent, contentTypeRepository.Load("StandardPage").ID);
StandardPage standardPage = contentRepository.GetDefault<StandardPage>(parent);
myPage.Property["PageName"].Value = "Name";
myPage.Property["MainBody"].Value = "My Page";
myPage.Property["PageTypeName"].Value = "Standard Page";
myPage.Property["PagePendingPublish"].Value = true;
myPage.URLSegment = EPiServer.Web.UrlSegment.CreateUrlSegment(myPage);
contentRepository.Save(myPage, EPiServer.DataAccess.SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);
Related
i defined a hook in ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc']['titleTagsInHiddenText'] = SNM\StmwiAccessibility\ExtendTypolink::class . '->convertTitleInHiddenText';
This hook will be executed on every link on the page, on all pages of all sites. This could be a performance killer ...
So, is there a possibility to restrict the use of the hook to the actual page? Is it possible to get the current site in ext_localconf.php?
e.g.:
$currentSite = ????;
if ($currentsite = 'rootPidOfMySite') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']
}
This question rises in other contexts too: i often want to restrict the performance consuming configuration of extensions to one single site. I can do it with the static setup file but not with the stuff in ext_localconf.php.
Thanks!
Which TYPO3 version do you use? There is an API to access the site configuration. I'd say you need to register PSR-15 middleware and then you can access the site configuration. More details can be found in the documentation.
Can someone help me out how I would go on about create documents to repository using soap createDocument.
I have a custom content model and and when I add a new document does not have the properties of the content model.
<ns:properties> <ns1:propertyId
propertyDefinitionId="cmis:objectTypeId">
<ns1:value>cmis:document</ns1:value>
<ns1:value>cms:customModel</ns1:value> </ns:properties>
Also I am looking to upload multiple attachments at time but right now I can't
<ns:contentStream>
<ns:mimeType>application/octet-stream</ns:mimeType>
<!-- Optional:-->
<ns:filename></ns:filename>
<ns:stream><xsl:copy-of select="//someelement"></xsl:copy-of></ns:stream>
</ns:contentStream>
any help on how I can get this working is greatly appreciated.
You should use OpenCMIS or a similar CMIS library instead of writing to the WS binding directly.
You appear to be attempting to set two values for cmis:objectTypeId. If you are trying to create an instance of cms:customModel, that should be the only value.
You aren't setting any custom property values in the snippets you provided.
To my knowledge, there is nothing in the spec allows you to provide multiple attachments simultaneously. You should get a single upload working first.
I'm using VS 2013 with CodedUI to automate UI tests on an application that is not built by my client (it's an implementation project). When inspecting the UI Control using inspect or coded UI, I see that the Automation ID keeps changing and I have no real way (beside position based) to capture my controls (the application is developed in Delphi).
So I'm wondering if there exist some library or add-ons (or something not even related to Coded UI and VS) that can help with this? For example some tools that can capture a screen shot of the control and then map it (the screenshot) to an Control Id that I will define and use that to automate?
Wow....I was able to find a way to do what I need using sikuli (http://www.sikuli.org/) checkout this post. Ill actually try it out tomorrow. But I found on the web (link below) that it`s possible.
From Coded UI we can call the sikuli script like that:
Process process = new Process();
ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = #"D:\Sikuli\ds.bat";
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();
(code from) https://answers.launchpad.net/sikuli/+question/232233 , read this post guys!
I've started investigating alternatives to my project and a few questions came out that I couldn't answer by myself.
The problem is: I want to create a web page able to access multiple Magento instances installed in the same server. Currently, I have one Magento instance per client and this project will access several Magneto instances to export reports from each one (for example).
The alternatives I thought til this moment are:
Have another Magento instance, create a new module within it that changes its 'database target' before triggering operations/queries;
Questions until this moment:
Can I 'change the database target' of a Magento instance?
How can I access data from a Magento instance without appeal to SOAP/REST?
I want to re-use some components (grids, tabs, forms..) from Magento, that's why I'm not considering an independent project (Zend, for instance) that can access this code from another projects. Does it make sense?
Any other idea?
==Edited==
Thanks by the tips and sorry by my ignorance. The comments let me believe that I'm able to execute something like this:
// File myScript.php
require '/home/DOMAIN1/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN1
require '/home/DOMAIN2/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN2
Is it right? Can I execute require twice (and override things from first require)?
==Edited2==
I'm still trying to connect to several Magento instances from a single third party file. Is there any tip? I'm facing several/different errors at this moment.
The only thing I know is that I can still rely on SOAP to get the information I need, but this will be expensive.
Thanks!
The easiest way would be to include Mage.php from each shop instance. You would need to use namespaces or some other trickery to be able to load more then one.
Or if that doesn't work - make your own API in a separate file to get what you want from one shop, and combine the results in the PHP-file that calls the API.
Here's a sample on how to use Magento functionality outside of Magento:
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// your custom code here, for example, get the product model..
$productModel = Mage::getModel('catalog/product');
I'm trying to integrate N2CMS into an existing application. I'm in the middle of the installation and have been following the documentation supplied for integrating into an existing application.
I'm up to the 'Add Content Package' part of the installation'. However, the 'HomePage' start page is not appearing under the 'start node' drop down list (under 'Manually Insert Nodes'). I've been trying to figure this out for a few days now, looking at various sources but nothing seems to work.
I'll post the Content Item below (the cs code that the installer should be picking up on). All I really need is a CMS that is easy to integrate into an existing website, which is why I went with N2CMS. But the poorly maintained documentation and lack of support really makes me want to try something else. Unfortunately every CMS wants you to use their system from scratch. If anyone knows another Open Source CMS which is easy to integrate into an existing website, please let me know.
Here's the cs code (HomePage.cs, under the 'Models' Folder)
namespace ExistingApplication.Models
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using N2;
using N2.Web;
using N2.Details;
using N2.ContentItem;
using N2.Installation;
[N2.Definition("My page", "MyPage", "A simple page with a chunk of text", "The tooltip", 1, Installer = InstallerHint.PreferredStartPage, TemplateUrl = "~/UI/Home.aspx")]
[N2.Details.WithEditableTitle, N2.Details.WithEditableName]
public class HomePage : N2.ContentItem
{
}
}
By the way the url that 'TemplateUrl' points to does exist. Thanks in advance.
Try modifying HomePage definition by implementing (empty) interface IStartPage
public class HomePage : N2.ContentItem, IStartPage
IStartPage is marker interface that is used exactly for this purpose - so that N2 can distinguish regular pages from those that can serve as Start Page of the site.