Not able access AEM author using JcrUtils.getRepository - aem-6

I want to access one author crx from another author CRX. For example, I am trying to make a connection from Dev author to QA author. I am using JCRUtil class to access the repository . Below is code snippet
try {
repository = JcrUtils.getRepository("http://localhost:4502/crx/server");
} catch (RepositoryException e1) {
e1.printStackTrace();
}
It is throwing below exception -
javax.jcr.RepositoryException: Unable to access a repository with the following settings:
org.apache.jackrabbit.repository.uri: http://localhost:4502/crx/server
The following RepositoryFactory classes were consulted:
org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
Perhaps the repository you are trying to access is not available at the moment.
I went through some article and forum and it suggested to add below dependency.
org.apache.jackrabbit
jackrabbit-jcr2dav
2.6.0
Even after adding above dependency it is working. Can you please let me if I am missing something or is there another way to make the connection between two author instance? Thank you

Get Repository API is generally used to connect to the instance from a standalone web application. What is your actual requirement to connect from one environment to other?
If you are looking for content sync, there are multiple options like using package manager or Grabbit etc..

Related

TYPO3 backend form module gives error when creating forms

I'm currently running TYPO3 version 8.7.18 and running a site_package that was made by using the site package builder: link
Whenever I try to add a form by using the default backend forms module I get the default message Oops, an error occurred! along with that the following error
TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Converters\AddHmacDataConverter not found
Searching for the issue I get several hits on the Gitlab but these do not provide any solution.
Along with this setup, I've added the forms module as a static include in my top-level template.
do you have a composer installation or an extension manager build up?
If a class is not found you may need to rebuild the autoloader information.
My error turned out to be caused by a corrupt installation. I've had to upload the file AddHmacDataConverter.php in the following path /public_html/typo3/sysext/form/Classes/Domain/Configuration/FormDefinition/Converters. A very weird error indeed.
For those that came here with the same error, make sure to check that folder. Apart from that add the news as a static inclusion in your top domain. You could also follow #Bernd Wilke's idea which s to disable the extension, clear all system caches (and additionally remove typo3/temp/autoload and then active the extension again.

How to programmatically retrieve product version of AEM/CQ5

AEM 5.6.1.
I have a package. I'd like to be able to 'sniff' the version of AEM a user/administraor is using when attempting to install the package.
The version is available in the front-end via Tools -> Web Console -> Main -> Product Information
I appreciate I could parse the above page and extract but surely there's a more elegant way to do it?
I've looked through Adobe docs on Packages: (I would post links but SO complaining I've not got enough reputation) And had a good hunt around SO.
The closest I've come is through this doc: https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html and assuming that the details found in CRX # /etc/packages/day:
cq5
cq560
cq561
represent a typical install?
Current versions of AEM provide this info is via the ProductInfoService described at [1], which can return a number of ProductInfo objects.
This is already available in 5.6.1, also via the OSGi console at /system/console/status-productinfo .
[1] https://docs.adobe.com/docs/fr/aem/6-0/develop/ref/javadoc/com/adobe/granite/license/package-summary.html
To pro-grammatically retrieve the product version of any running AEM instance can be done by the following code snippet.
#Reference
private ProductInfoProvider productInfo;
String version = productInfo.getProductInfo().getShortVersion();
First we need to inject the ProductInfoProvider service or define the references of ProductInfoProvider into your service and use following functions calls to get the version information as
productInfo.getProductInfo().getShortVersion();
The product information is stored on the node "/libs/cq/core/productinfo" , you can read the information from those nodes.
You don't specify if you'll have repository access while the package is being installed. In case you want the data as JSON over HTTP just hit the path with ".json" extension
Source : Checked the network requests made by the aem developer chrome plugin
For AEM 6.5
com.adobe.granite.license.ProductInfoProvider;
com.adobe.granite.license.ProductInfo;
#OSGiService
private ProductInfoProvider productInfoProvider;
ProductInfo productInfo = productInfoProvider.getProductInfo();
productInfo.getVerion().toString(); //6.5.13.0
productInfo.getShortVersion(); //6.5
Thanks

How to share a GWT RPC RemoteServiceServlet among multiple client modules / apps

I have several GWT modules and web apps running in Jetty. They each want to use my LoginService RPC interface, so I put this interface and its servlet implementation in a common module. I serve the servlet (LoginServiceImpl) from my root web context, and web.xml exposes it at the url "/loginService". In a another GWT module, to use this service, I had to set the entry point, like this...
LoginServiceAsync loginService = GWT.create(LoginService.class);
ServiceDefTarget t = (ServiceDefTarget)loginService;
t.setServiceEntryPoint("/loginService");
Now, the module trying to use the loginService is called discussions, and I get this error on the server.
ERROR: The serialization policy file
'/discussions/discussions/7B344C69AD493C1EC707EC98FE148AA0.gwt.rpc' was not found;
did you forget to include it in this deployment?
So the servlet is reporting an error that mentions the client (the discussions module). I'm guessing that the RPC plumbing passed the name of this .rpc file through from the client, and the servlet is now looking for it. (?) As an experiment, I copied, the *.gwt.rpc files from the discussions module into the root web context, so the servlet could find them. This did stop the error. But I still get another error:
com.google.gwt.user.client.rpc.SerializationException: Type
'mystuff.web.shared.User' was not assignable to
'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field
serializer. For security purposes, this type will not be serialized.: ...
This class is serializable; it worked before in other modules, so now I'm lost.
What is the right way to use the LoginService from multiple clients modules?
Update:
This error was showing up in hosted devmode, and it went away after a full compile. Maybe this is related to gwt serialization policy hosted mode out of sync . I will update again if I can better reproduce the problem.
See my answer here. The short answer is: you'll need to make mystuff.web.shared.Users source available at compile-time to your discussions module.

Mylyn connector for sourceforge feature/bug tracking system

I haven't found any clear information about this around.
Is it possible to integrate the sourceforge tracking system for bugs/features with Mylyn?
I've found this page that seems a bit old (indeed the link for downloading the general connector does not work).
Anyone have a clue about this? It is possible to realise such a kind of connection?
Yes with the move of SourceForge to use Allura the configuration on the page you highlighted is outdated.
I posted details on getting the Web Template Connector to work for Allura at http://officefloor.wordpress.com/2012/12/10/allura-sourceforge-mylyn-connector/
The generic connector is now in the Mylyn incubator. Use this download site:
http://download.eclipse.org/mylyn/incubator/3.7 (for Eclipse 3.6, 3.7, 3.8)
Since I wasn't able to get it running – maybe it's because of Eclipse Luna or something else – I slightly modified Daniel's method which partially uses the REST interface:
Basic Configuration
Add the following parameters and appropriate values to the table unter Additional Settings section in the Properties for Task Repository dialog:
project – your so-called UNIX name of the project
tickets – the ticketing application, e.g. bugs or features
bearer_token – you need to set-up a bearer token as described in the Allura documentation
under Advanced Configuration, use:
Task URL: ${serverUrl}/p/${project}/${tickets}/ (the same as in Daniel's method)
New Task URL: ${serverUrl}/p/${project}/${tickets}/new (the same as in Daniel's method)
Query Request URL: ${serverUrl}/rest/p/${project}/${tickets}?access_token=${bearer_token}
Query Pattern: \{"summary":\s*"({Description}.+?)",\s*"ticket_num":\s*({Id}.+?)\}
Milestone query
To query tasks by milestones, use the following parameters in your Edit Query configuration:
add a parameter milestone with e.g. M1 to the parameter table
use the following Query URL: ${serverUrl}/rest/p/${project}/${tickets}/search?q=_milestone%3A${milestone}&access_token=${bearer_token}

How to deploy Orchard CMS in Windows Azure?

Experts,
Is there any of you guys who has successfully built and deployed Orchard CMS (1.1 and above) in Azure?
I've tried to build the source codes (pulled from Codeplex repo) as suggested here: http://www.orchardproject.net/docs/Deploying-Orchard-to-Windows-Azure.ashx but keep on failing. If you see the comments of that article, you'll see some people are having the same problem with the ClickToBuildAzurePackage.cmd. It fails all the time!! It's not working at all!
Next, I downloaded the source codes package (Orchard.Web.1.2.41.zip) and tried to open the Orchard.Azure solution, build, and publish it (with remote desktop connection configured). I've also put in the correct DataConnectionString in the ServiceConfiguration.cscfg file before publishing it. It gave me a yellow screen of death with this message:
None of the constructors found with policy 'Autofac.Core.Activators.Reflection.BindingFlagsConstructorFinder'
Next, I tried to deploy the Azure package only (without source codes, Orchard.Azure.1.2.41.zip). This time, I could get the installation screen but then after setup was done, it gave me another yellow screen of death with several error messages that basically remind me to give proper permission for Media, Themes, Modules, and some other folders....How do I do that if I can't even setup the remote desktop connection for Azure as mentioned in the above?
I'm giving up on this...I start to think Orchard CMS (1.1 and above) is not ready for Azure. I could get the 1.0.2 version up and running in Azure (directly deployed the Azure-ready package, I didn't build the source codes).
Can anybody share their experience on this matter and the step-by-step guideline to get Orchard CMS (1.1 and above) running smoothly in Azure? May I know if we can also setup 2 instances in Azure for Orchard CMS? What are the things I need to consider / do to achieve that?
Thanks!
Since June 2012 there's also the possibility to easily host Orchard on Windows Azure Web Sites.
Here's an how to guide: How to setup Orchard CMS on Windows Azure Web Sites with a Windows Azure SQL Database.
This is an alternative approach which didn't exist at the time of the original question but might still be interesting for future readers who want to easily deploy Orchard CMS on Windows Azure.
I didn't get ClickToBuildToAcure.cmd script to work and that is why I wrote my own one, that Stuart helped linking to. My blog http://litemedia.info is running on Azure and those blog posts describes how I did it.
Some pointers
My Global.asax.cs looks a bit different on Azure compared to running local.
public class AzureApplication : HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
}
protected void Application_Start()
{
CloudStorageAccount.SetConfigurationSettingPublisher(
(configName, configSetter) =>
configSetter(RoleEnvironment.GetConfigurationSettingValue(configName))
);
// For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
RoleEnvironment.Changing += (sender, e) =>
{
// If a configuration setting is changing
if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange))
{
// Set e.Cancel to true to restart this role instance
e.Cancel = true;
}
};
RegisterRoutes(RouteTable.Routes);
Starter.LaunchStartupThread(MvcSingletons);
}
protected void Application_BeginRequest()
{
Context.Items["originalHttpContext"] = Context;
Starter.OnBeginRequest(Context, MvcSingletons);
}
protected void Application_EndRequest()
{
Starter.OnEndRequest();
}
static void MvcSingletons(ContainerBuilder builder)
{
builder.Register(ctx => RouteTable.Routes).SingleInstance();
builder.Register(ctx => ModelBinders.Binders).SingleInstance();
builder.Register(ctx => ViewEngines.Engines).SingleInstance();
}
}
I had problems deploying with sites in /App_Data/ directory. Make sure that it is empty when you upload your package to Azure.
You need to tell Autofac to use some Azure specific classes for settings and blog storage. You'll find these in /Config/Host.config and /Config/Sites.config. Go to my blog post above to see how I set them up.
I spent several hours hunting down assemblies that was not copied to the Azure package. Make sure that all references are "Copy Local", even the MVC3 ones.
Really make sure that you have the correct DataConnectionString setup in ServiceConfiguration.cscfg. I was banging my head against the wall for a long time because I had put a connection string for another account there.
If you intend to deploy from a script you need to setup a certificate that will be used for the deployment. I used Visual Studio to create the certificate, and then only reference it from my script.
Good luck!
I've not done this myself.
But I've read a few blog posts about deploying Orchard to Azure - e.g. see http://litemedia.info/automate-deploy-of-your-orchard-cms-to-azure - so I believe it can be done.
On the specific yellow screen of death issue - make sure you've used NuGet to resolve the AutoFac dependencies - see http://litemedia.info/deploy-orchard-cms-to-azure
I've done that about a dozen times without a problem. About ClickTobuild, did you do that from a Visual Studio command prompt?
I have the orchard core project from https://github.com/OrchardCMS/OrchardCore. Then I ran into a few issues while adding azure devopsa. In order to offer you a solution proposal.
You must find and include all projects where the app data folder is excluded
You should not forget to add web config to your project
Note: If you are suspicious of the web config you added, you can try to run the project in local iis.
Update the publishing settings of the folders required for app data and publish to copy always