I am using CQ 5.6.1 and have a requirement wherein we should have the capability to compare page to previous versions. That I believe basically means is we have to induce the versioning capability to components other than the standard out of the box text, the image, the text-image and the title components.
Is that possible ?
Thanks in advance
There is the timewarp feature where you can "scroll" back in time to look at previous versions of the page. You can find this in the sidekick, 4th tab "Versioning" at the bottom.
The only downside of this are DAM assets. As they are only referenced by their path only the current version of this asset will be displayed even if you look at an ancient version of the page itself. If the asset was directly uploaded to the page it will be versioned together with the rest of the page.
If you want to approach this programmatically, here a short code snippet I used recently in my current project.
The imports:
import javax.jcr.Session;
import javax.jcr.version.Version;
import javax.jcr.version.VersionHistory;
import javax.jcr.version.VersionIterator;
import javax.jcr.version.VersionManager;
The code:
Session session = currentNode.getSession();
VersionManager vm = session.getWorkspace().getVersionManager();
VersionHistory versionHistory = vm
.getVersionHistory(currentNode.getPath());
VersionIterator vIt = versionHistory.getAllVersions();
while (vIt.hasNext()) {
Version version = vIt.nextVersion();
}
Related
I cannot seem to export then import a powerapps solution that has a canvas app that references a custom component. I'm using the powerapps portal to create the solution, where I add the canvas app that uses the custom component. When I export, download, and try to import the solution at this point it fails with the error:
error code 8004F036: The dependent component CustomControl (Id=xxx) does not exist. Failure trying to associate it with CanvasApp (Id=yyy) as a dependency. Missing dependency lookup type = EntityNameLookup.
If I first go to the solution and click 'add required objects' it will not add the custom component. If I manually add it, it shows it as added, but still after exporting, downloading, and importing, I get the same error. It would be great if someone knows the proper steps to get this working.
You will have to do this in 2 steps.
custom control (either you created on or you used from some 3 rd party) should be deployed (imported) to Target system. If it is managed solution from 3rd party then you might have solution.zip file use this and deploy to target system. If you created this custom control, then create separate solution and just add your custom control and deploy this solution.
Once custom control is imported, then deploy/import your powerapps solutions.
I want to access a file from material.dart library ('src/material/search.dart';) so that I can access private fields (_somethingsomething) in it to create a widget.
I read a bit about part/part of and so on, but it seems that I am not using it properly.
Is something like this possible?
Steps: Copying a file from Flutter into your own app.
Create a file search_copy.dart, and copy the content of material's search.dart.
Remove the internal imports used in the file.
Instead add the import import 'package:flutter/material.dart' to search_copy.dart
Modify the new file according to your needs, like exposing the private field.
Import the file with a prefix import 'search_copy.dart' as search; so you don't get import conflicts with material itself.
When you want to access it do so like search.showSearch(context: context, delegate: delegate)
Note: The search.dart file is part of flutter itself which is BSD-licensed. (https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/search.dart)
License:
https://github.com/flutter/flutter/blob/master/packages/flutter/LICENSE
The answer is NO. And probably there is a reason why these fields are private since package owners (in this case, framework maintainers) do not want the developer to use the variables directly or change them in any way.
If you would like to adjust the code for the component in the material library, you could:
a) Create an issue under flutter repository and explain why you need to access the fields, maybe even create a POC by forking the repository and implementing your changes. The Flutter team may approve this and your changes will be a part of the framework - that's the beauty of open-source! However, there is no guarantee that it will happen.
b) Copy-paste the search.dart code to your project and adjust whatever is needed. This is a faster solution to your problem, however, now you should maintain this code by yourself, you would need to keep this component in sync with any Flutter update.
I'm trying to import features available under enterprise license into my angular 6 app, but it seems ag-grid doesn't see license key.
I have already imported ag-grid and ag-grid-community and it works fine, but there are some problems with enterprise licensed features.
Yesterday I got trial license for 2 month;
I downloaded package ag-grid-enterprise via npm and imported LicenseManager component (before bootstraping app):
import { LicenseManager } from 'ag-grid-enterprise';
LicenseManager.setLicenseKey('my_key');
Then added import "'ag-grid-enterprise'" to my module file according to documentation (I'm using lazy loading modules, so I put AgGridModule not into app.module, but into that module where I need ag-grid);
Then switched rowModelType to serverSide and replaced setter with setServerSideDatasource()
I followed the documentation steps, but after grid initialization got errors listed below.
ag-Grid: could not find matching row model for rowModelType serverSide
ag-Grid: rowModelType server side is only available in ag-Grid Enterprise
I'll really appreciate for any suggestions about how to solve this problem. If anyone have some alternative/more detailed guide that would be perfect.
I'm developing an app that uses offline maps.
Now I need to implement offline navigation in the app.
Can I implement offline navigation?
UPD:
I tried grapphopper, but it doesn't work offline.
GeoPoint startPoint = new GeoPoint(41.4670689,69.5824818);
RoadManager roadManager = new GraphHopperRoadManager("API KEY", true);
ArrayList<GeoPoint> waypoints = new ArrayList<>();
waypoints.add(startPoint);
waypoints.add(new GeoPoint(41.3868364,69.4419728));
Road road = roadManager.getRoad(waypoints);
Polyline roadOverlay = RoadManager.buildRoadOverlay(road);
map.getOverlays().add(roadOverlay);
map.getController().setCenter(startPoint);
You are using support for graphopper from osmbonuspack (GraphHopperRoadManager) which apparently does support only online functionality (it just calls the official Graphopper api).
You'll need to integrate the Graphopper library directly into you android project. And that's not as simple as you may think.
You'll need to:
1) Obtain openstreetmap data for your locality (in pbf format).
You can find sliced parts of the globe on internet. There are tools that will help you to cut out a region you need, if you want to work with some specific area.
2) Prepare data for graphopper
Clone the Graphopper project and import your OSM data
git clone git://github.com/graphhopper/graphhopper.git graphhopper
cd graphhopper
git checkout 0.10.0
./graphhopper.sh import your-area.pbf
This will creat a directory (probably next to your pbf named as {your-area}-gh) with preprocessed graphopper data. You have to include this directory in your app. You can add it to the assets directory or download it at runtime.
Note: There may be additional setup steps for the graphopper project, unfortunatelly I don't remember them (I did this integration 2 years ago). Navigating graphopper documentation can be a bit challenging but they have some community support and there are resources online. It can be done.
3) Include graphopper library into your project
They have an android demo app. So check how the library is integrated and used.
At the time of writing, the dependencies are specified in this way:
implementation(group: 'com.graphhopper', name: 'graphhopper-core', version: '0.10-SNAPSHOT') {
exclude group: 'com.google.protobuf', module: 'protobuf-java'
exclude group: 'org.openstreetmap.osmosis', module: 'osmosis-osm-binary'
exclude group: 'org.apache.xmlgraphics', module: 'xmlgraphics-commons'
}
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'org.slf4j:slf4j-android:1.7.25'
But change '0.10.0-SHAPSHOT' to '0.10'. Also, you should have `jcenter()`` repository added in your project's root gradle file.
Note: versions do matter. Your library in app should have exactly the same version as core project you cloned to generate data. There may be incompatibilities in data format between versions. That's why I included git checkout 0.10.0 in the second step.
4) Use the library
Again, check the example: https://github.com/graphhopper/graphhopper/blob/master/android/app/src/main/java/com/graphhopper/android/MainActivity.java
As It's stated above, your application will need the xyx-gh directory with data.
Graphpoper initialization, you should do it on background
GraphHopper hopper = new GraphHopper().forMobile();
hopper.load("yourpathtodirectory-gh");
Usage, again preferably on background:
GHRequest ghRequest = new GHRequest(from, to);
GHResponse response = hopper.route(ghRequest);
For more information and more troubleshooting check the official documentation: https://github.com/graphhopper/graphhopper/blob/0.10/docs/index.md
I'm not an experienced Javascript application developer, however, I've recently been learning some MEAN using http://mean.io/#!/ as my scaffolding.
I can see that the out of the box assets are listed in:
/server/config/assets.json
and when the app is running the referenced assets get combined into client side files:
/modules/aggregated.css
/modules/aggregated.js
When I create a package using MEAN.IO's CLI:
mean package myPackage;
and start including css or scripts in this package, presumably it is bad practice to then put the packages assets into the application's assets.json as these packages are supposed to be reusable modules that could be added to someone else's MEAN application.
What's the right place to reference the new package's assets so that they are added into the aggregration process?
you want to add css or js files into your packages.
If so, it's easy. As the doc says in "Assets and Aggregation" http://learn.mean.io/#mean-packages-assets-and-aggregation
you should use
//Adding another library - global by default is false
MyPackage.aggregateAsset('js','jquery.min.js', {global:true});
//Adding some css to the mean project
MyPackage.aggregateAsset('css','default.css');