02-08-2016 12:21 PM
ParentReference parentReference = new ParentReference(store, uuid, null, ASSOC_CONTAINS,
"{" + Constants.NAMESPACE_CONTENT_MODEL + "}" + name);
// Define the content format for the content we are adding
ContentFormat contentFormat = new ContentFormat("image/tiff", "UTF-8");
NamedValue[] propertiesNV = new NamedValue[] { new NamedValue() };
propertiesNV[0].setName("{http://www.alfresco.org/model/content/1.0}name");
propertiesNV[0].setValue(name);
CMLCreate create = new CMLCreate("1", parentReference, null, null, null, Constants.TYPE_CONTENT, propertiesNV);
NamedValue propAspect1 = Utils.createNamedValue(PROP_APPLY_OCR,
properties.getProperty("ocr"));
NamedValue propAspect2 = Utils.createNamedValue(PROP_CIF_EMPRESA,
properties.getProperty("cif"));
NamedValue propAspect3 = Utils.createNamedValue(PROP_USER_NAME,
properties.getProperty("user"));
NamedValue[] aspectProps = new NamedValue[] {propAspect1, propAspect2, propAspect3};
CMLAddAspect addAspect = new CMLAddAspect(ASPECT_OCR, aspectProps, null, "1");
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
cml.setAddAspect(new CMLAddAspect[]{addAspect});
UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml);
Reference newContentNode = result[0].getDestination();
System.out.println("Ref new node " + newContentNode.getPath());
FileInputStream fileInputStream = new FileInputStream(files.get(i));
byte[] bytes = ContentUtils.convertToByteArray(fileInputStream);
System.out.println("Add content. Bytes size " + bytes.length);
Content content = contentService.write(newContentNode, Constants.PROP_CONTENT, bytes, contentFormat);
System.out.println("Saved!!!! " + content.getUrl());
The Web Script /alfresco/api/RepositoryService has responded with a status of 404 - Not Found.
404 Description: Requested resource is not available.
Message: 01050008 Script url network does not map to a Web Script.
Exception: org.springframework.extensions.webscripts.WebScriptException - 01050008 Script url network does not map to a Web Script.
UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml);
02-08-2016 12:32 PM
02-09-2016 08:54 AM
this.progressMonitor.setNote("Subiendo imagen " + (i + 1) + " al servidor");
String name = filename.replace(".tiff", i + ".tiff");
ParentReference parentReference = new ParentReference(store, uuid, null, ASSOC_CONTAINS,
"{" + Constants.NAMESPACE_CONTENT_MODEL + "}" + name);
ContentFormat contentFormat = new ContentFormat("image/tiff", "UTF-8");
NamedValue[] propertiesNV = new NamedValue[] { new NamedValue() };
propertiesNV[0].setName("{http://www.alfresco.org/model/content/1.0}name");
propertiesNV[0].setValue(name);
CMLCreate create = new CMLCreate("1", parentReference, null, null, null, Constants.TYPE_CONTENT, propertiesNV);
NamedValue propAspect1 = Utils.createNamedValue(PROP_APPLY_OCR, properties.getProperty("ocr"));
NamedValue propAspect2 = Utils.createNamedValue(PROP_CIF_EMPRESA, properties.getProperty("cif"));
NamedValue propAspect3 = Utils.createNamedValue(PROP_USER_NAME, properties.getProperty("user"));
NamedValue[] aspectProps = new NamedValue[] {propAspect1, propAspect2, propAspect3};
CMLAddAspect addAspect = new CMLAddAspect(ASPECT_OCR, aspectProps, null, "1");
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
cml.setAddAspect(new CMLAddAspect[]{addAspect});
UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml);
Reference newContentNode = result[0].getDestination();
FileInputStream fileInputStream = new FileInputStream(files.get(i));
byte[] bytes = ContentUtils.convertToByteArray(fileInputStream);
Content content = contentService.write(newContentNode, Constants.PROP_CONTENT, bytes, contentFormat);
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
{http://www.alfresco.org/ws/service/content/1.0}ContentFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>Transaction silently rolled back because it has been marked as rollback-only</ns1:message>
{http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.content.ContentFault
{http://xml.apache.org/axis/}stackTrace:
at org.alfresco.repo.webservice.content.ContentWebService.write(ContentWebService.java:228)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
….
….
….
02-09-2016 09:01 AM
02-09-2016 11:30 AM
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
{http://www.alfresco.org/ws/service/content/1.0}ContentFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>01090010 A value for the mandatory parameter script-ref has not been set on the rule item script</ns1:message>
{http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.content.ContentFault
{http://xml.apache.org/axis/}stackTrace:
at org.alfresco.repo.webservice.content.ContentWebService.write(ContentWebService.java:228)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
{http://xml.apache.org/axis/}hostname:SM-PC
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
at org.alfresco.webservice.content.ContentFault.getDeserializer(ContentFault.java:147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.alfresco.webservice.content.ContentServiceSoapBindingStub.write(ContentServiceSoapBindingStub.java:513)
at uk.co.mmscomputing.application.imageviewer.ImageTab.saveAlfresco(ImageTab.java:715)
at uk.co.mmscomputing.application.imageviewer.ImageTab.save(ImageTab.java:438)
at uk.co.mmscomputing.application.imageviewer.ScannerTab.update(ScannerTab.java:138)
at uk.co.mmscomputing.device.scanner.Scanner.fireListenerUpdate(Scanner.java:61)
at uk.co.mmscomputing.device.twain.TwainScanner.setState(TwainScanner.java:122)
at uk.co.mmscomputing.device.twain.jtwain.signalStateChange(jtwain.java:293)
at uk.co.mmscomputing.device.twain.TwainSource.setState(TwainSource.java:40)
at uk.co.mmscomputing.device.twain.TwainSource.transfer(TwainSource.java:337)
at uk.co.mmscomputing.device.twain.TwainSource.transferImage(TwainSource.java:373)
at uk.co.mmscomputing.device.twain.TwainSource.handleGetMessage(TwainSource.java:435)
at uk.co.mmscomputing.device.twain.jtwain.cbhandleGetMessage(jtwain.java:263)
at uk.co.mmscomputing.device.twain.jtwain.nstart(Native Method)
at uk.co.mmscomputing.device.twain.jtwain.access$3(jtwain.java:21)
at uk.co.mmscomputing.device.twain.jtwain$1.run(jtwain.java:350)
02-10-2016 07:51 AM
02-10-2016 02:23 AM
02-10-2016 08:22 AM
<bean id="processFra-action" class="org.alfresco.web.actions.ProcessFraActionExecuter" parent="action-executer">
<property name="nodeService">
<ref bean="NodeService" />
</property>
<property name="services">
<ref bean="ServiceRegistry" />
</property>
<property name="facturaService">
<ref bean="facturaService" />
</property>
<property name="authenticationComponent">
<ref bean="AuthenticationComponent" />
</property>
<property name="accountService">
<ref bean="accountService" />
</property>
</bean>
02-10-2016 12:11 PM
ProcessFraActionExecuter
?
02-10-2016 12:26 PM
public class ProcessFraActionExecuter extends ActionExecuterAbstractBase
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.