Create site programatically in alfresco:
PostMethod createSitePost = new PostMethod("http://127.0.0...);
String shortName = "TestSiteFromCode";
JSONObject siteObject = new JSONObject();
try {
siteObject.put("shortName", shortName);
siteObject.put("Visiblity", "Public");
siteObject.put("sitePreset", "site-dashboard");
siteObject.put("title", shortName);
siteObject.put("description", shortName);
createSitePost.setRequestHeader("Content-Type", "application/json");
createSitePost.setRequestHeader("Accept", "application/json");
createSitePost.setRequestEntity(new StringRequestEntity(siteObject.toString(), "application/json", "UTF-8"));
int status = client.executeMethod(createSitePost);
"alf_ticket":"TICKET_1867481b6f78a70ec5df451f37971fa87d58f1de"
http://01hw537727:8080/share/page/modules/create-s...
-----------------------------------------------------------------------------------------------------
Even on sending a flag (ex: "isContent":true) from request body of JSON from UI to service,the flag received on service side is always false:
1) Resolution: Check the POJO on service side receiving this flag. It should be ideally a wrapper class (not primitive boolean type). Also check similar primitive types in the pojo (make it wrapper) and change its getter/setters.
2) Try sending "isContent":true / "isContent":"true" / "isContent":"false" / "isContent":false
3) Check by debugging, what exact value you receive in the service when the method is called.
4) Check what is the type set in DB column (TINYINT(1) should work). And along with that check what is the default value for this column in db (ideally default value '0' set it to false)
---------------------------------------------------------------------------------------------------
Alfresco upgrade steps:
Upgrade steps on QA:
1) Install 5.1.3.2
2) Start server. Check vanilla and common functionalities working fine.
3) stop server
4) Apply the amps (amps and amps_share)
5) Put all relevant entries in alf-global.properties
6) Copy subsystems folder from extension envt and copy it to alf5.1.3.2/extension.
7) Start node and verify operations.
8) Stop the node
9) Change the following:
Change the solr path in this file to original NAS path where solr indexes are stored: ALFRESCO_INSTALLATION_DIR/tomcat/conf/Catalina/localhost/solr4.xml
Change the solr path in ALFRESCO_INSTALLATION_DIR/solr4/workspace-SpacesStore/conf/solrcore.properties & archive-SpacesStore/conf/solrcore.properties:
Change alfresco-global.properties to point to original dir.root (contentStore) and db properties:
dir.root=/data/alf_data/XXX/XXXdb.name=xxxxdb.username=xxxxxxdb.password=xxxxxxdb.driver=org.gjt.mm.mysql.Driverdb.url=jdbc:mysql://${db.host}:${db.port}/${db.name}?useUnicode=yes&characterEncoding=UTF-8 db.host=xxxxxxxx## Note: your database must also be able to accept at least this many connections. Please see your database documentation for instructions on how to configure this.db.pool.max=575db.pool.validate.query=SELECT 1db.port=xxxx
10) Clear server cache (tomcat/temp and tomcat/work).
11) Start server.
Other case:
1) Take backup of amps, wars and DB. Stop the server
2) Alf1 node is pointing to postgres db currently; now we will point to "alf50_****test" (i.e used by alf2 node)
3) Apply amps sequentially (first RM, cornerstone, and then the other amps) to the war files
4) Start alfresco
5) In indexing errors occur, will reindex the contents.
---------------------------------------------------------------------------------------------------
content-indexing not working for few selected contents:
1) Check that in alf-global, solr node (solr host/port) is pointing to correct solr node
2) Check solrcore.properties. It should point to the same contentstore which alf node is pointing
3) Check if transformation server configured in alf-global is correct, If configured correctly verify it is up and running. Keep an eye on the logs when server starts up, transformation server should start correctly and also jodconverted should work fine (jodconverter or OOOffice).
4) Check if the content file not indexed, has correct mimetype set on it. If mimetype is not set correctly, it won't index by the solr.
--------------------------------------------------------------------------------------------
SAML configuration in alf, Upgrade steps from alf 5.0 to 5.1, aikau error, content-indexing not working for few selected contents - blog
Buzone issue
Alternatives:
1. Keep dojo enabled false in surf.xml and try building amps.
3.
2017-11-09 06:26:49,956 ERROR [extensions.surf.DependencyAggregator] [http-apr-8080-exec-16] Could not find compressed file: /share/services/UserHomePageService.js 2017-11-09 06:26:49,957 ERROR [extensions.surf.DependencyAggregator] [http-apr-8080-exec-16] Could not find compressed file: /share/services/ServicesWarning.js-------------------------------------------------------------------------------------------------------------------------
https://community.alfresco.com/community/ecm/blog...
Post from ddraper: "You can include multiple versions of the Aikau JAR files in the share/WEB-INF/lib folder without any problems"
------------------------------------------------------------------------------------------------
Activiti:
http://localhost:8080/activiti-app
The default app administrator is admin@app.activiti.com with password admin.
To view the Alfresco Process Services Administrator web application, use thefollowing URL:
http://localhost:8080/activiti-admin
The default administrator user is admin with password admin.
The above information is available in the process-services-readme.txt in yourinstallation.
-----------------------------------------------------------------------------------------------
Solution: Inject 'ProcessEngine' interface (belongs to activiti jar) in ur class and give ref= 'ActivityProcessEngine' in ur context.xml file as bean entry.
Solution: If preview of doc does not work, u need to split it as pdf. For that use Itext jar – PDFWriter class and Document class
CORS Filter Class:
public class CORSFilter implements Filter{
private static Logger logger = LoggerFactory.getLogger(CORSFilter.class);
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
// TODO Auto-generated method stub
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With, remember-me");
chain.doFilter(req, res);
}
Alfresco with solr 4/6 provides an intelligent search resulting into some additional search results also being displayed along with the matching search results.
As a solution to this point, we have found that if we provide a validation for user to enter minimum 4 characters in search textbox, and then click search button, then it will give you accurate search results.
So in a nutshell, keep minimum 4 chars in search text field/box. Else you will get unexpected/non-matching results in search (with solr and fts)
--------------------------------------------------------------------------------------------------------
'System' user of Alfresco accidentally gets deleted by someone or through some LDAP configuration:
In this case, some of the webscripts might stop working and also the code which references the 'System' user might not function.
Resolution: Create a new user in Alfresco (using Alfresco Share), entering the First name as 'System' and Username, Password also as 'System'. Email Address you can enter any valid email. It's done. The webscript calls will start working without any server restarts.
--------------------------------------------------------------------------------------------------------
PDFBox error:
java.io.IOException: Push back buffer is full
at java.io.PushbackInputStream.unread(PushbackInputStream.java:232)
at org.apache.pdfbox.io.PushBackInputStream.unread(PushBackInputStream.java:143)
at org.apache.pdfbox.io.PushBackInputStream.unread(PushBackInputStream.java:132)
at org.apache.pdfbox.pdfparser.BaseParser.parseCOSStream(BaseParser.java:552)
[wrapped] org.apache.pdfbox.exceptions.WrappedIOException: Could not push back 811745 bytes in order to reparse stream. Try increasing push back buffer using system property org.apache.pdfbox.baseParser.pushBackSize
at org.apache.pdfbox.pdfparser.BaseParser.parseCOSStream(BaseParser.java:556)
at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:652)
at org.apache.pdfbox.pdfparser.BaseParser.parseCOSStream(BaseParser.java:607)
at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:652)
at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:205)
Resolution:
1) The PDFs which you are trying to merge or split might be having some characters or encoding which is not supported by this PDFBox API. You can check the PDF content and upload new PDFs
2) You can try upgrading to newer version or may be latest of PDFBox API
3) Try setting org.apache.pdfbox.baseParser.pushBackSize=2024768 or any higher value than mentioned in the error to raise the buffer size, restart the server and try.
You can try setting this property in the envt variable OR using System.setProperty("org.apache.pdfbox.baseParser.pushBackSize", "2024768"); in your java code which is actually merging/splitting PDF files.
4) Replace the existing parser with a non-sequential parser. That is, replace the below line with next line:
doc = PDDocument.load(input);
Courtesy: https://stackoverflow.com/questions/22946079/pdfbox-loading-large-files/30780628doc = PDDocument.loadNonSeq(input, null);
--------------------------------------------------------------------------------------------------------
When a document is checked out from Alfresco share, two copies - a working copy and an original copy will be created.
Now, if someone intentionally or accidentally deletes the working copy, the original copy of the document might not be visible in Alfresco Share.
Issue: ADF shows the document (original) as locked, but Share does not show the document itself.
Resolution:
1) Try to find out if it's actually deleted by someone. If yes, have screen sharing session with him/her, and ask that user to go to Alf Share > My Profile > Trashcan > Recover the deleted item
2) If you cannot find the document in anybody's trashcan, you can search it with fts-alfresco query in archive spacesstore from node browser and verify if the document exists in archive store. From it's properties, you can come to know who deleted it and then ask him to recover.
3) If you are unable to find it in archive store, also not able to find in someone's trashcan, it might be deleted through some REST call or script executed by a functional user OR through some other unknown mechanism : If restart of server is permitted, try to write and deploy a webscript which actually deletes or unlocks or check-in the file through it's noderef.
4) If this issue is in production envt, and restart is not permitted, go via the javascript API way.
Try out the following option:
var node = search.findNode("workspace://SpacesStore/....");
node.remove();
If you do not want this file, you can execute the above script by putting it under Data Dictionary > Scripts folder.
If you want to keep the file (and do not want to delete it) , then try following javascript options:
node.checkout();
node.checkin();
node.cancelCheckout();
node.unlock();
Courtesy: https://docs.alfresco.com/6.0/references/API-JS-CheckInOut.html
You might also get an error like : Node is already checked-out OR Access denied OR Cannot perform this operation , etc
Then you may want to go for providing options/actions in ADF - for deleting doc, unlocking doc if you have not kept it.
5) Last (not recommended) way would be accessing the db tables, and checking which document noderef is what you want, and then change/delete the relevant entries. But it is risky and alfresco db is wired in a complex manner and not recommended to be touched/accessed directly. Instead, it should be done via the API layer.
6) Try manually uploading the same file name from Alf.Share in the same folder where it's shown as locked and see what message you are getting.
7) Check if you are able to replicate this behaviour for multiple documents or only this particular document. That is, it's not a data specific issue.
8) Try to check on other envt - DEV, QA ,etc if you can see the same error there.
9) If it's an external service (ex: spring batch) which is pushing files to Alfresco from FTP location, then try with different modes - like try pushing file from DEV spring batch service by pointing it to prod repo server, same way QA spring batch service pointing to prod repo server; try this in case you are seeing different behaviours envt wise and you suspect it's envt specific issue OR issue with the spring batch service.
--------------------------------------------------------------------------------------------------------
PARENT attribute is not working in combination with other attributes like
TAG, cm:name for partial search.
For example:
PARENT:c0ee1ecc-8a1f-467c-b6e0-eca2db5f2f3e
AND ~cm:name:"*.docx" à this is not returning any
item
PARENT:c0ee1ecc-8a1f-467c-b6e0-eca2db5f2f3e
AND TAG:”abc" à not working
PARENT:c0ee1ecc-8a1f-467c-b6e0-eca2db5f2f3e
AND =TAG:”abc" à not working
PARENT:c0ee1ecc-8a1f-467c-b6e0-eca2db5f2f3e
AND ~TAG:”abc" à not working
PARENT:c0ee1ecc-8a1f-467c-b6e0-eca2db5f2f3e
AND TAG:”ABC" à not working
The 1st
part of the query (PARENT:c0ee1ecc-8a1f-467c-b6e0-eca2db5f2f3e) is not held up
in memory so that 2nd part of the query is not searched only
within those contents.
This is working fine in
combination with PATH query:
PATH:"/app:company_home/st:sites/cm:sitename/cm:documentLibrary/cm:foldername//*"
AND cm:name:"*.docx"
Alternate solutions can be using
the PATH query instead of PARENT, so the query would be like à
PATH:"/app:company_home/st:sites/cm:sitename/cm:documentLibrary/cm:foldername//*"
AND cm:name:"*.docx"
OR
searching with type à
TYPE:"custom:csDocument" AND
cm:name:"*.docx"
StackOverFlow Posts (My Posts + Posts that helped me):
https://stackoverflow.com/questions/59050674/alfresco-session-timeout
https://stackoverflow.com/questions/58863206/how-can-i-append-a-pdf-into-another-alfresco/58889451#58889451
https://stackoverflow.com/questions/35704815/watchservice-not-working-in-integration-tests?rq=1
https://stackoverflow.com/questions/48919086/java-watch-service-not-working-for-remote-files-mounted-in-the-local-server?rq=1
https://stackoverflow.com/questions/59193050/alfresco-solr-search-stops-working-after-installing-records-management/
https://stackoverflow.com/questions/40020999/how-to-monitor-folder-directory-in-spring/57604406#57604406
No comments:
Post a Comment